v1

latestOpenAPI 3.1.02026-07-1744202324.0 KB
Files

Get file JSON

Returns the document identified by file_key as a JSON object. The file key can be parsed from any Figma file url: https://www.figma.com/file/{file_key}/{title}.

The document property contains a node of type DOCUMENT.

The components property contains a mapping from node IDs to component metadata. This is to help you determine which components each instance comes from.

get/v1/files/{file_key}

Path parameters

file_keystring required

File to export JSON from. This can be a file key or branch key. Use GET /v1/files/:key with the branch_data query param to get the branch key.

Query parameters

versionstring

A specific version ID to get. Omitting this will get the current version of the file.

idsstring

Comma separated list of nodes that you care about in the document. If specified, only a subset of the document will be returned corresponding to the nodes listed, their children, and everything between the root node and the listed nodes.

Note: There may be other nodes included in the returned JSON that are outside the ancestor chains of the desired nodes. The response may also include dependencies of anything in the nodes' subtrees. For example, if a node subtree contains an instance of a local component that lives elsewhere in that file, that component and its ancestor chain will also be included.

For historical reasons, top-level canvas nodes are always returned, regardless of whether they are listed in the ids parameter. This quirk may be removed in a future version of the API.

depthnumber

Positive integer representing how deep into the document tree to traverse. For example, setting this to 1 returns only Pages, setting it to 2 returns Pages and all top level objects on each page. Not setting this parameter returns all nodes.

geometrystring

Set to "paths" to export vector data.

plugin_datastring

A comma separated list of plugin IDs and/or the string "shared". Any data present in the document written by those plugins will be included in the result in the pluginData and sharedPluginData properties.

branch_databoolean

Returns branch metadata for the requested file. If the file is a branch, the main file's key will be included in the returned response. If the file has branches, their metadata will be included in the returned response. Default: false.

Response

Response from the GET /v1/files/{file_key} endpoint.

namestring required

The name of the file as it appears in the editor.

role'owner' | 'editor' | 'viewer' required

The role of the user making the API request in relation to the file.

lastModifiedstring date-time required

The UTC ISO 8601 time at which the file was last modified.

editorType'figma' | 'figjam' required

The type of editor associated with this file.

thumbnailUrlstring

A URL to a thumbnail image of the file.

versionstring required

The version number of the file. This number is incremented when a file is modified and can be used to check if the file has changed between requests.

componentsobject required

A mapping from component IDs to component metadata.

componentSetsobject required

A mapping from component set IDs to component set metadata.

schemaVersionnumber required

The version of the file schema that this file uses.

stylesobject required

A mapping from style IDs to style metadata.

linkAccessstring

The share permission level of the file link.

mainFileKeystring

The key of the main file for this file. If present, this file is a component or component set.

All 44 operations