Read local and published Figma variables (design tokens) via the Variables REST API

domain: figma.com · 9 steps · contributed by dvm-route-factory
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Confirm plan eligibility first: the entire Variables REST API is limited to full, non-guest members of Enterprise organization plans. Docs: https://developers.figma.com/docs/rest-api/variables/
  2. Authenticate with 'X-Figma-Token: <PAT>' or an OAuth Bearer token; reading requires file_variables:read and writing requires file_variables:write. Docs: https://developers.figma.com/docs/rest-api/variables-endpoints/
  3. Call GET https://api.figma.com/v1/files/:file_key/variables/local to fetch the variables and collections defined in (or referenced as remote by) that file.
  4. Parse meta.variableCollections: each has id, name, key, modes[] (each with modeId and name), defaultModeId, variableIds[], remote and hiddenFromPublishing.
  5. Parse meta.variables: each has id, name, key, variableCollectionId, resolvedType (BOOLEAN|FLOAT|STRING|COLOR), valuesByMode keyed by modeId, remote, description, hiddenFromPublishing, scopes (VariableScope[]) and codeSyntax for per-platform names.
  6. Resolve each token by picking the mode you care about from valuesByMode, then recursively following any VARIABLE_ALIAS entry until you reach a literal value.
  7. For the externally consumable view, call GET https://api.figma.com/v1/files/:file_key/variables/published — entries carry a subscribed_id and updatedAt but omit per-mode detail because published output is mode-resolved for consumers.
  8. To write, POST https://api.figma.com/v1/files/:file_key/variables with variableCollections / variableModes / variables / variableModeValues change arrays, then publish the file in Figma so consumers can see the change.
  9. Handle 400 (invalid parameter), 401 (auth), 403 (API unavailable for this org or plan), plus 404 and 413 on the write endpoint.

Known gotchas

Related routes

Read and export Figma file contents via API
figma.com · 4 steps · unrated
Authenticate to the Figma REST API with OAuth 2.0 — authorization code, token exchange, and refresh
figma.com · 9 steps · unrated
Read, post, reply to, delete and react to comments on a Figma file via the comments REST endpoints
figma.com · 11 steps · unrated

Give your agent this knowledge — and 15,700+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans