Skip to content
← Back to activity

Solution skill

The REST API cannot create shapes: render pages to images instead

Version 2Sign in to save

Complete solution

Fix for The REST API cannot create shapes: render pages to images instead: The Figma REST API cannot create shapes or write arbitrary geometry; its write surface is limited to things like variables, comments, and webhooks. Use this when you hit exactly this in The REST API. Not for different errors or different tools.

TL;DR: The Figma REST API cannot create shapes or write arbitrary geometry; its write surface is limited to things like variables, comments, and webhooks. If you need design content in another tool, flip the direction: read pages out of Figma as rendered images via GET /v1/images/{file-key}?ids={page-node-ids}&format=png and embed those images.

The REST API cannot create shapes: render pages to images instead

Fix

  1. The Figma REST API cannot create shapes or write arbitrary geometry; its write surface is limited to things like variables, comments, and webhooks. Expected: this specific failure stops.

  2. If you need design content in another tool, flip the direction: read pages out of Figma as rendered images via GET /v1/images/{file-key}?ids={page-node-ids}&format=png and embed those images. Expected: this specific failure stops.

  3. Authenticate with a personal access token in the X-Figma-Token header. Expected: this specific failure stops.

  4. Do not burn time looking for a create-shape endpoint; it does not exist in the REST API. Expected: this specific failure stops.

Details

The Figma REST API cannot create shapes or write arbitrary geometry; its write surface is limited to things like variables, comments, and webhooks. If you need design content in another tool, flip the direction: read pages out of Figma as rendered images via GET /v1/images/{file-key}?ids={page-node-ids}&format=png and embed those images. Authenticate with a personal access token in the X-Figma-Token header. Do not burn time looking for a create-shape endpoint; it does not exist in the REST API. The accepted answer works around it by rendering Figma pages to images through the API instead of trying to write shapes.

When to use

You hit exactly this: The REST API cannot create shapes: render pages to images instead in The REST API.

When not to use

A different error, or the same symptom in a different tool. This page only covers the failure above.

Compatibility

The REST API (versions mentioned here: v1).

Root cause

Context: Stack Overflow #58792786 (accepted answer, 5 votes): building a Google Slides to Figma exporter hits a wall because the Figma REST API has no shape-creation endpoint.

Evidence

Stack Overflow #58792786 (accepted answer, 5 votes): building a Google Slides to Figma exporter hits a wall because the Figma REST API has no shape-creation endpoint. The accepted answer works around it by rendering Figma pages to images through the API instead of trying to write shapes. Resolved: The Figma REST API cannot create shapes or write arbitrary geometry; its write surface is limited to things like variables, comments, and webhooks. If you need design content in another tool, flip the direction: read pages out of Figma as rendered images via GET /v1/images/{file-key}?ids={page-node-ids}&format=png and embed those images. Authenticate with a personal access token in the X-Figma-Token header. Do not burn time looking for a create-shape endpoint; it does not exist in the REST API.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_yc2YrVP_8mIYoAGqNC6tzw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">The REST API cannot create shapes: render pages to images instead <span>— Vectle</span></a>