Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Diagnose and fix common Figma REST API and Plugin API errors. Use when encountering HTTP errors, plugin sandbox crashes, or unexpected API responses from Figma. Trigger with phrases like "figma error", "fix figma", "figma not working", "figma 403", "figma 429".
.claude/skills/jeremylongshore-figma-common-errors/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 128% | 0% |
| case-17 | ✗→✓ | ▲ Improved | -22% | 0% |
Quick reference for the most common Figma REST API and Plugin API errors, with exact error messages and working solutions.
| Status | Error | Cause | Solution | |--------|-------|-------|----------| | 400 | Bad Request | Malformed request, invalid node IDs | Verify node ID format (pageId:nodeId, e.g., 0:1) | | 403 | Forbidden | Invalid token, wrong scopes, no file access | Regenerate PAT with correct scopes; verify file sharing | | 404 | Not Found | Wrong file key, deleted file, wrong endpoint | Check file key from URL; verify file exists | | 429 | Rate Limited | Too many requests | Read Retry-After header; implement backoff | | 500 | Internal Server Error | Figma server issue | Retry with exponential backoff; check status.figma.com |
bash# Test your token curl -s -o /dev/null -w "%{http_code}" \ -H "X-Figma-Token: ${FIGMA_PAT}" \ https://api.figma.com/v1/me # 200 = token valid, 403 = invalid/expired # Check what scopes your request needs # file_content:read -> GET /v1/files/:key # file_comments:read -> GET /v1/files/:key/comments # file_variables:read -> GET /v1/files/:key/variables/local # webhooks:write -> POST /v2/webhooks
Common 403 causes:
file_content:read but calling comments endpoint)typescript// Figma returns these headers on 429: // Retry-After: <seconds> -- wait this long before retrying // X-Figma-Rate-Limit-Type: <type> -- "low" or "high" tier // X-Figma-Plan-Tier: <plan> -- your plan level async function handleRateLimit(response: Response) { if (response.status === 429) { const retryAfter = parseInt(response.headers.get('Retry-After') || '60'); const limitType = response.headers.get('X-Figma-Rate-Limit-Type'); console.warn(`Rate limited (${limitType}). Retrying in ${retryAfter}s`); await new Promise(r => setTimeout(r, retryAfter * 1000)); return true; // signal to retry } return false; }
bash# Verify your file key is correct # URL format: https://www.figma.com/design/<FILE_KEY>/<file-name> # The file key is the string between /design/ and the next / # Test the file key curl -s -H "X-Figma-Token: ${FIGMA_PAT}" \ "https://api.figma.com/v1/files/${FIGMA_FILE_KEY}" \ | jq '.name // "FILE NOT FOUND"'
nulltypescript// GET /v1/images/:key returns null for nodes that cannot render const images = await exportImages(['0:1', '0:2']); for (const [nodeId, url] of Object.entries(images)) { if (url === null) { // Node failed to render. Common causes: // - Node is invisible (visibility: false) // - Node has 0% opacity // - Node ID does not exist in the file // - Node has no visual content (e.g., an empty frame) console.error(`Failed to render node ${nodeId}`); } }
| Error | Context | Cause | Solution | |-------|---------|-------|----------| | figma is not defined | Node.js / browser | Running plugin code outside Figma sandbox | Plugin code only runs inside Figma desktop app | | Cannot read property of undefined | Plugin | Accessing deleted node reference | Re-query node: figma.getNodeById(id) | | Plugin timed out | Plugin | Operation took too long | Use figma.commitUndo() and batch operations | | Quota exceeded | Plugin | Too many nodes created | Limit to ~5000 nodes per operation | | Permission denied | Plugin | Missing manifest.json permission | Add required permission to permissions array |
bash#!/bin/bash echo "=== Figma API Diagnostics ===" # 1. Check Figma service status echo -n "Figma Status: " curl -s -o /dev/null -w "%{http_code}" https://www.figma.com && echo " OK" || echo " DOWN" # 2. Validate token echo -n "Token Valid: " curl -s -o /dev/null -w "%{http_code}" \ -H "X-Figma-Token: ${FIGMA_PAT}" \ https://api.figma.com/v1/me # 3. Check file access echo -n "File Access: " curl -s -H "X-Figma-Token: ${FIGMA_PAT}" \ "https://api.figma.com/v1/files/${FIGMA_FILE_KEY}" \ | jq -r '.name // "FAILED"' # 4. Check env vars echo "FIGMA_PAT: ${FIGMA_PAT:+SET (${#FIGMA_PAT} chars)}" echo "FIGMA_FILE_KEY: ${FIGMA_FILE_KEY:-NOT SET}"
When the diagnostic itself fails, work outside-in before re-consulting the catalog:
| Symptom | Cause | Solution | |---------|-------|----------| | Every call returns 401, even /v1/me | Token revoked, expired, or wrong header (Authorization vs X-Figma-Token) | Regenerate the PAT; PATs use X-Figma-Token, OAuth uses Authorization: Bearer | | Diagnostic script (Step 4) hangs | No timeout on the probe requests | Add --max-time 15 to curl / AbortSignal.timeout() in fetch | | Error not in the catalog | New API behavior or plugin-API error mistaken for REST | Check Step 3 (plugin errors) and status.figma.com before filing | | Fix applied but error persists | Cached 4xx response or stale token in another env | Bust caches; verify which env's token the failing process actually loaded |
Full per-error diagnosis flow: references/diagnose-specific-errors.md; automated probe: references/quick-diagnostic-script.md.
typescriptfunction diagnoseFigmaError(status: number, body: string): string { switch (status) { case 403: return 'Auth failed. Check: (1) PAT not expired (2) correct scopes (3) file shared with you'; case 404: return 'Not found. Check: (1) file key from URL (2) file not deleted (3) node IDs valid'; case 429: return 'Rate limited. Implement exponential backoff with Retry-After header'; case 500: return 'Figma server error. Check status.figma.com and retry with backoff'; default: return `Unexpected ${status}: ${body}`; } }
For comprehensive debugging, see figma-debug-bundle.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 20,550 | 19,803 | -4% | 1 | 1 | 0% | 3,991 | 5,109 | +28% | 0 | 0 | — |
case-02 | fail→fail | 17,946 | 16,690 | -7% | 1 | 1 | 0% | 3,649 | 5,240 | +44% | 0 | 0 | — |
case-03 | fail→fail | 18,844 | 15,906 | -16% | 1 | 1 | 0% | 3,738 | 5,287 | +41% | 0 | 0 | — |
case-04 | pass→pass | 11,582 | 11,808 | +2% | 1 | 1 | 0% | 2,168 | 3,834 | +77% | 0 | 0 | — |
case-05 | pass→pass | 10,623 | 10,599 | -0% | 1 | 1 | 0% | 2,159 | 3,707 | +72% | 0 | 0 | — |
case-06 | pass→pass | 13,197 | 10,910 | -17% | 1 | 1 | 0% | 2,335 | 4,113 | +76% | 0 | 0 | — |
case-07 | pass→pass | 8,142 | 7,276 | -11% | 1 | 1 | 0% | 1,560 | 3,405 | +118% | 0 | 0 | — |
case-08 | pass→pass | 9,010 | 5,809 | -36% | 1 | 1 | 0% | 1,517 | 2,926 | +93% | 0 | 0 | — |
case-09 | pass→pass | 26,393 | 5,361 | -80% | 1 | 1 | 0% | 1,052 | 2,955 | +181% | 0 | 0 | — |
case-10 | pass→pass | 11,482 | 8,971 | -22% | 1 | 1 | 0% | 2,038 | 3,592 | +76% | 0 | 0 | — |
case-11 | fail→fail | 6,745 | 4,408 | -35% | 1 | 1 | 0% | 1,323 | 2,727 | +106% | 0 | 0 | — |
case-12 | fail→pass | 11,416 | 7,276 | -36% | 1 | 1 | 0% | 2,120 | 3,277 | +55% | 0 | 0 | — |
case-13 | pass→pass | 16,028 | 12,947 | -19% | 1 | 1 | 0% | 2,412 | 3,951 | +64% | 0 | 0 | — |
case-14 | fail→pass | 12,762 | 9,051 | -29% | 1 | 1 | 0% | 2,468 | 3,896 | +58% | 0 | 0 | — |
case-15 | pass→pass | 13,788 | 12,072 | -12% | 1 | 1 | 0% | 2,337 | 4,079 | +75% | 0 | 0 | — |
case-16 | fail→pass | 7,357 | 5,311 | -28% | 1 | 1 | 0% | 1,310 | 2,982 | +128% | 0 | 0 | — |
case-17 | fail→pass | 15,860 | 3,439 | -78% | 1 | 1 | 0% | 3,162 | 2,469 | -22% | 0 | 0 | — |
case-18 | pass→pass | 2,148 | 2,581 | +20% | 1 | 1 | 0% | 358 | 2,444 | +583% | 0 | 0 | — |
case-19 | pass→pass | 14,183 | 6,458 | -54% | 1 | 1 | 0% | 2,039 | 2,934 | +44% | 0 | 0 | — |
case-20 | pass→pass | 19,057 | 14,608 | -23% | 1 | 1 | 0% | 2,995 | 4,397 | +47% | 0 | 0 | — |
case-21 | pass→pass | 10,410 | 728,684 | +6900% | 1 | 1 | 0% | 2,183 | 4,422 | +103% | 0 | 0 | — |
case-22 | pass→pass | 7,775 | 11,688 | +50% | 1 | 1 | 0% | 1,590 | 3,822 | +140% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.