Endpoints
Dev Resources endpoints allow you to create, read, update, and delete dev resources in Figma files.
GET dev resources
Get dev resources in a file.
This is a Tier 2 endpoint and requires the file_dev_resources:read
scope.
HTTP endpoint
GET /v1/files/:file_key/dev_resources
Return value
{
"dev_resources": DevResource[]
}
Path parameters | Description |
---|---|
file_key |
|
Query parameters | Description |
---|---|
node_ids |
|
Error codes | Description |
---|---|
400 | Invalid parameter. The message parameter on the response will describe the error. |
401 | Issue with authentication. The message parameter on the response will describe the error. |
POST dev resources
Bulk create dev resources across multiple files.
Dev resources that are successfully created will show up in the links_created
array in the response.
If there are any dev resources that cannot be created, you may still get a 200 response. These resources will show up in the errors
array. Some reasons a dev resource cannot be created include:
- Resource points to a
file_key
that cannot be found. - The node already has the maximum of 10 dev resources.
- Another dev resource for the node has the same url.
This is a Tier 2 endpoint and requires the file_dev_resources:write
scope.
HTTP endpoint
POST /v1/dev_resources
Return value
{
"links_created": DevResource[]
"errors": [
{
"file_key": String | null,
"node_id": String | null,
"error": String,
},
...
]
}
Body parameters | Description |
---|---|
dev_resources |
|
Error codes | Description |
---|---|
400 | Invalid parameter. The message parameter on the response will describe the error. |
401 | Issue with authentication. The message parameter on the response will describe the error. |
PUT dev resources
Bulk update dev resources across multiple files.
Ids for dev resources that are successfully updated will show up in the links_updated
array in the response.
If there are any dev resources that cannot be updated, you may still get a 200
response. These resources will show up in the errors
array.
This is a Tier 2 endpoint and requires the file_dev_resources:write
scope.
HTTP endpoint
PUT /v1/dev_resources
Return value
{
"links_updated": String[]
"errors": [
{
"id": String,
"error": String,
},
...
]
}
Body parameters | Description |
---|---|
dev_resources |
|
Error codes | Description |
---|---|
400 | Invalid parameter. The message parameter on the response will describe the error. |
401 | Issue with authentication. The message parameter on the response will describe the error. |
DELETE dev resources
Delete a dev resources from a file.
This is a Tier 2 endpoint and requires the file_dev_resources:write
scope.
HTTP endpoint
DELETE /v1/files/:file_key/dev_resources/:dev_resource_id
Return value
Nothing is returned from this endpoint
Path parameters | Description |
---|---|
file_key |
|
dev_resource_id |
|
Error codes | Description |
---|---|
401 | Issue with authentication. The message parameter on the response will describe the error. |
404 | The specified dev resource / file was not found |