> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Figma

> Design-collaboration API for reading and writing Figma files, comments, components, styles, dev resources, and webhooks that a team already owns in Figma.

Design-collaboration API for reading and writing Figma files, comments, components, styles, dev resources, and webhooks that a team already owns in Figma. Use when an agent needs to pull a file's document tree, render node images, post comments, link external dev resources to nodes, or subscribe to file-change webhooks. Unlike public design databases, Figma returns design data the user has created or been shared — not a public corpus.

13 example endpoints available through Lava's AI Gateway. See the [Figma API docs](https://developers.figma.com/docs/rest-api/) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://api.figma.com` is supported. Any Figma REST API endpoint. Common roots: /v1/files/\{file\_key}, /v1/files/\{file\_key}/nodes, /v1/images/\{file\_key}, /v1/files/\{file\_key}/comments, /v1/teams/\{team\_id}/components, /v1/teams/\{team\_id}/projects, /v1/dev\_resources, /v2/webhooks, /v1/me. Construct URL as [https://api.figma.com/\&#123;versioned\_path\&#125](https://api.figma.com/\&#123;versioned_path\&#125);. Use the literal `{team_id}` placeholder in team-scoped paths — Lava substitutes the team\_id from the connected credential at request time, so the agent never has to look it up. Project and file endpoints don't need \{team\_id}. Variables, library analytics, and org activity endpoints require an Enterprise Figma plan. See [https://developers.figma.com/docs/rest-api/](https://developers.figma.com/docs/rest-api/) for full reference. The endpoints below are curated examples.</Info>

## Endpoints

### Get the authenticated Figma user

**GET** `https://api.figma.com/v1/me` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/me', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fme" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Fetch the full document tree JSON for a Figma file

**GET** `https://api.figma.com/v1/files/{file_key}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/files/{file_key}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Ffiles%2F%7Bfile_key%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Fetch specific nodes of a file by id

**GET** `https://api.figma.com/v1/files/{file_key}/nodes?ids=1:2,1:3` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/files/{file_key}/nodes?ids=1:2,1:3', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Ffiles%2F%7Bfile_key%7D%2Fnodes%3Fids%3D1%3A2%2C1%3A3" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Render file nodes as PNG/SVG/JPG/PDF; returns URLs hosted by Figma

**GET** `https://api.figma.com/v1/images/{file_key}?ids=1:2&format=png` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/images/{file_key}?ids=1:2&format=png', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fimages%2F%7Bfile_key%7D%3Fids%3D1%3A2%26format%3Dpng" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List all comments on a file

**GET** `https://api.figma.com/v1/files/{file_key}/comments` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/files/{file_key}/comments', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Ffiles%2F%7Bfile_key%7D%2Fcomments" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Post a new comment on a file

**POST** `https://api.figma.com/v1/files/{file_key}/comments` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/files/{file_key}/comments', { body: {"message":"Ship blocker — hero CTA mis-aligned on mobile."} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Ffiles%2F%7Bfile_key%7D%2Fcomments" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"message":"Ship blocker — hero CTA mis-aligned on mobile."}'
    ```
  </Tab>
</Tabs>

### List published components in a team library

**GET** `https://api.figma.com/v1/teams/{team_id}/components` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/teams/{team_id}/components', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fteams%2F%7Bteam_id%7D%2Fcomponents" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List projects within a team

**GET** `https://api.figma.com/v1/teams/{team_id}/projects` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/teams/{team_id}/projects', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fteams%2F%7Bteam_id%7D%2Fprojects" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Attach external dev resource links (URLs) to nodes in a file for Dev Mode

**POST** `https://api.figma.com/v1/dev_resources` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/dev_resources', {
      body: {
    "dev_resources": [
      {
        "name": "Storybook — Button",
        "url": "https://storybook.example.com/?path=/story/button",
        "file_key": "{file_key}",
        "node_id": "1:2"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fdev_resources" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"dev_resources":[{"name":"Storybook — Button","url":"https://storybook.example.com/?path=/story/button","file_key":"{file_key}","node_id":"1:2"}]}'
    ```
  </Tab>
</Tabs>

### Create a v2 webhook subscription for file or team events; Figma delivers events to the endpoint URL

**POST** `https://api.figma.com/v2/webhooks` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v2/webhooks', {
      body: {
    "event_type": "FILE_UPDATE",
    "team_id": "{team_id}",
    "endpoint": "https://example.com/figma-webhook",
    "passcode": "shared-secret-for-verification",
    "description": "File updates to design-system library"
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv2%2Fwebhooks" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"event_type":"FILE_UPDATE","team_id":"{team_id}","endpoint":"https://example.com/figma-webhook","passcode":"shared-secret-for-verification","description":"File updates to design-system library"}'
    ```
  </Tab>
</Tabs>

### Update one or more existing dev resources by id

**PUT** `https://api.figma.com/v1/dev_resources` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/dev_resources', {
      method: 'PUT',
      body: {
    "dev_resources": [
      {
        "id": "{dev_resource_id}",
        "name": "Storybook — Button (v2)",
        "url": "https://storybook.example.com/?path=/story/button-v2"
      }
    ]
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Fdev_resources" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"dev_resources":[{"id":"{dev_resource_id}","name":"Storybook — Button (v2)","url":"https://storybook.example.com/?path=/story/button-v2"}]}'
    ```
  </Tab>
</Tabs>

### Delete a v2 webhook subscription by id

**DELETE** `https://api.figma.com/v2/webhooks/{webhook_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v2/webhooks/{webhook_id}', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv2%2Fwebhooks%2F%7Bwebhook_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

### Delete a comment from a file (author only)

**DELETE** `https://api.figma.com/v1/files/{file_key}/comments/{comment_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.figma.com/v1/files/{file_key}/comments/{comment_id}', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.figma.com%2Fv1%2Ffiles%2F%7Bfile_key%7D%2Fcomments%2F%7Bcomment_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
