Get file with the Figma API

Returns the document tree of a file: pages, frames and layers with their properties and ids, plus the components and styles the file uses. The tree of a large file is huge: pass depth 1 for the pages only, or 2 for the top-level frames of each page, then read a frame with Get file nodes. Figma puts this call in its smallest rate limit tier: files in a Starter plan, and users with a View or Collab seat, get only up to 20 calls a month.

Identifier
figma_get_file

The request

POST https://connect.reportei.com/api/tools/figma_get_file/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "file_key": "<file_key>"
  }
}

Your system sends your customer's connection id and the tool arguments. The headers are the same as the rest of the Connect API: your product's token and your customer's token.

Parameters

ParameterTypeRequiredDescription
file_keystringYesKey of the file: the part after /design/, /file/ or /board/ in the URL of the file in Figma. The key of a branch also works.
depthintegerNoHow deep to go into the tree, counted from the document: 1 returns the pages, 2 the pages and their top-level frames. Omit it to return every layer.
idsstringNoComma-separated node ids, like 1:2,1:3, to return only those nodes, their children and the path to them. A node id is the node-id of a Figma link with the hyphen changed to a colon (node-id=1-2 is 1:2), or an id returned by Get file.
versionstringNoId of a version from List file versions, to read the file as it was then. Omit it for the current version.
branch_databooleanNoAlso returns the branches of the file with their keys, which the other tools accept as file_key. The default is false.

Supported connections

Your customer connects their Figma account once, with one of the modes below. The same connection serves every tool of the toolkit.

OAuth with your product's app

You register your product's OAuth app once, with POST /api/merchants/credentials/figma, and your customer authorizes the account on a consent screen. Connect renews the token when it is about to expire.

The response

On success, Connect preserves the app's response status and body. HTTP errors returned by the app use the {error, api_error} envelope; authentication or validation can fail before execution. The X-Toolkit-Execution-Id header identifies the recorded execution, available at GET /api/tools/executions/{uuid}.

Ready for AI agents

This tool's input is a JSON Schema, available at GET /api/tools/figma_get_file. It becomes your agent's tool definition with no conversion.

Other Figma tools

See all 12 tools

Toolkits in the same category

See all 100 toolkits

See Connect applied to your product.

Try it for 15 days with no card, or walk our team through your use case.