How to hit the Figma API

Figma's REST API lives at https://api.figma.com/v1. A file key is the id in a Figma file's URL, after /design/.

Authentication

Create a personal access token under Settings → Security in Figma and send it as the X-Figma-Token header. In the examples it's written {{FIGMA_TOKEN}}.

Full reference: https://developers.figma.com/docs/rest-api/

Get the current user

curl https://api.figma.com/v1/me \
  -H "X-Figma-Token: {{FIGMA_TOKEN}}"
Run in PostTaco

Get a file

depth=1 returns just the pages, not every layer.

curl "https://api.figma.com/v1/files/{{FILE_KEY}}?depth=1" \
  -H "X-Figma-Token: {{FIGMA_TOKEN}}"
Run in PostTaco

A file's comments

curl https://api.figma.com/v1/files/{{FILE_KEY}}/comments \
  -H "X-Figma-Token: {{FIGMA_TOKEN}}"
Run in PostTaco