Figma Support Forum

Where can I find the REST API Schema?

Where can I find the REST API Schema?

I’m not entirely sure what schema is but the documentation with interactive examples can be found here: https://www.figma.com/developers/api. I don’t think there are any other materials available about the REST API.

Hi Gleb,

The json that is returned by the Figma REST API, can be defined and validated against a schema. A schema define all possible valid responses by the REST API. There is probably a better explanation than that. https://json-schema.org/

I noticed in your link that an example Figma REST response (see below) the schema is version 0, which may mean they have not taken the time to create one or even want to since it may be a moving target.

A schema would allow a programmer to create valid classes in the language of their choice programmatically from the json-schema. Otherwise the classes need to be hand coded by looking at your link. Using the json-schema for this is faster, and guarantees its complete.

Thanks for the response.

Regards,
Richard

$ curl -sH ‘X-Figma-Token: 29-206…’
https://api.figma.com/v1/files/…’
| python -m json.tool
{
“components”: {},
“document”: {
“children”: [
{
“backgroundColor”: {
“a”: 1,
“b”: 0.8980392156862745,
“g”: 0.8980392156862745,
“r”: 0.8980392156862745
},
“children”: ,
“exportSettings”: ,
“id”: “0:1”,
“name”: “Page 1”,
“type”: “CANVAS”,
“visible”: true
}
],
“id”: “0:0”,
“name”: “Document”,
“type”: “DOCUMENT”,
“visible”: true
},
“schemaVersion”: 0
}

1 Like

That makes sense, thanks for the explanation! I don’t think there is an existing schema for it.