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

# Bearer Token

> Connect Parable to Figma using a Personal Access Token sent as a Bearer credential

export const platform_0 = "Figma"

export const limit_0 = "60 requests/minute per token on /v1/files; 10 requests/second overall"

export const tokenName_0 = "Personal Access Token"

<Tabs>
  <Tab title="Setup">
    <Card title="What You'll Need" icon="key">
      | Credential                | What it is                                          |
      | ------------------------- | --------------------------------------------------- |
      | **Personal Access Token** | Long-lived token minted from Figma account settings |
    </Card>

    ## Overview

    Connect Parable to Figma using a Personal Access Token (PAT) sent as a Bearer credential. Parable ingests design assets, version history, team structure, and (Enterprise, opt-in) activity logs.

    <CardGroup cols={2}>
      <Card title="Design assets" icon="pen-nib">
        Projects, files, components, variables, and version history
      </Card>

      <Card title="Activity & admin" icon="clock">
        File comments and org-level activity logs (Enterprise, opt-in)
      </Card>
    </CardGroup>

    ## Prerequisites

    <Info>
      **Service account required.** PATs are tied to the minting user -- if that user is removed from the team the token is revoked immediately and ingestion stops. Always mint from a **dedicated service-account user** on a **paid plan** (Professional, Organization, or Enterprise).
    </Info>

    * **`activity_logs`** is **disabled by default**. Enable it only if your organization is on the **Enterprise plan** with the service-account user having org admin access. Non-Enterprise tenants will receive `402 payment_required` on every sync.

    ## Setup Guide

    <Steps>
      <Step title="Open Figma Security settings">
        1. Sign in to Figma as the dedicated service-account user.
        2. Click your avatar in the top-right and open **Settings**.
        3. Switch to the **Security** tab.
        4. Scroll to **Personal access tokens**.
      </Step>

      <Step title="Generate the token">
        1. Click **Generate new token**.
        2. Set:
           * **Token name** -- something traceable, e.g. `parable-platform-prod`.
           * **Expiration** -- choose the longest duration your security policy allows (`30 days`, `60 days`, `90 days`, `180 days`, or `No expiration`). Rotate at least every 12 months even if using no expiration.
           * **Scopes** -- add the following:

        | Scope                       | Purpose                             |
        | --------------------------- | ----------------------------------- |
        | `file_metadata:read`        | Projects and files                  |
        | `file_variables:read`       | Design variables                    |
        | `file_dev_resources:read`   | Dev resources                       |
        | `file_comments:read`        | File comments and reactions         |
        | `library_assets:read`       | Published library assets            |
        | `library_content:read`      | Library content                     |
        | `team_library_content:read` | Team-scoped library content         |
        | `org:activity_log_read`     | Org activity logs (Enterprise only) |

        3. Copy the token.

        <Warning>
          **Copy your {tokenName_0} now!**

          This is the only time it will be displayed. Store it in a secure password manager before closing this page.
        </Warning>
      </Step>

      <Step title="Enter values in the form">
        1. **Personal Access Token**: Paste the token from Figma.
        2. Click **Save & test connection**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Reference">
    ## Verify Your Setup

    Use an environment variable so the secret never enters shell history:

    <CodeGroup>
      ```bash Test Authentication theme={null}
      read -rs -p "Figma PAT: " FIGMA_PAT && echo
      curl --silent -H "Authorization: Bearer ${FIGMA_PAT}" https://api.figma.com/v1/me
      unset FIGMA_PAT
      ```
    </CodeGroup>

    <Check>
      **Success!** If you received a `200 OK` response with valid data, your credentials are configured correctly. You can now proceed to configure this connector in Parable.
    </Check>

    <Tip>
      A successful response returns a JSON object with `id`, `email`, and `handle` for the minting user. If you receive `403 Invalid token`, regenerate the token in Figma and retry.
    </Tip>

    <Tip>
      **Rate Limits:** {platform_0} enforces rate limits of **{limit_0}**.

      Parable handles rate limiting automatically with exponential backoff, but initial syncs of large datasets may take longer due to these limits.
    </Tip>

    ## Troubleshooting

    | Error                             | Meaning                      | Solution                                                                                            |
    | --------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------- |
    | `403 Invalid token`               | Bad PAT, or PAT was revoked  | Re-mint from Figma Settings → Security; confirm minting user is still active                        |
    | `403 Invalid scope`               | PAT missing a required scope | Re-mint with the full scope list above                                                              |
    | `404 Not found` on a file or team | Minting user lacks access    | Add service-account user to the team, or remove the missing resource                                |
    | `429 Too many requests`           | Rate limit exceeded          | Parable respects `Retry-After` and backs off automatically                                          |
    | `Activity logs return empty`      | Tap is disabled by default   | Enable the `activity_logs` tap in connector settings; requires Enterprise plan and org admin access |

    <Accordion title="Common Issues">
      ### Token works in curl but the connector reports invalid

      Confirm you copied the full token string -- Figma PATs are 40+ characters and may contain hyphens. Trailing whitespace from a paste also fails; re-paste into the connector form.

      ### `activity_logs` returns 402 / `payment_required`

      Activity logs are an Enterprise-only feature and are disabled by default. Enable the `activity_logs` tap only on Enterprise plans with org admin access.
    </Accordion>

    ## Additional Resources

    <CardGroup cols={2}>
      <Card title="Figma REST API" icon="book" href="https://www.figma.com/developers/api">
        Full endpoint reference
      </Card>

      <Card title="Personal access tokens" icon="key" href="https://www.figma.com/developers/api#access-tokens">
        Official PAT setup guide including scope semantics
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
