> ## 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.

# API Token

> Connect Parable to Linear using an API key

export const platform_1 = "Linear"

export const limit_0 = "1,500 requests/hour; complexity-based limits for GraphQL"

export const platform_0 = "Linear"

export const role_0 = undefined

export const tokenName_0 = "API key"

<Tabs>
  <Tab title="Setup">
    <Card title="What You'll Need" icon="key">
      | Credential  | What it is                            |
      | ----------- | ------------------------------------- |
      | **API Key** | Personal API key from Linear settings |
    </Card>

    ## Overview

    Connect Parable to Linear for issues, projects, and teams using the GraphQL API.

    <CardGroup cols={2}>
      <Card title="Issues & Projects" icon="list-check">
        Issues, projects, cycles, milestones
      </Card>

      <Card title="Teams & Users" icon="users">
        Team structure, user assignments
      </Card>
    </CardGroup>

    ## Prerequisites

    <Info>
      **Setup access in {platform_0}.** These steps require **{role_0}**, or a colleague with equivalent permissions who can create credentials for you.

      If that is not you, ask your {platform_0} administrator.
    </Info>

    * **Admin** role in Linear workspace (for full data access)
    * API keys are tied to your user account and its permissions

    ## Setup Guide

    <Steps>
      <Step title="Access Linear Settings">
        1. Go to <a href="https://linear.app" target="_blank" rel="noopener noreferrer">linear.app</a>
        2. Click your avatar → **Settings**
        3. Navigate to **Account** → **Security & Access**
      </Step>

      <Step title="Create API Key">
        1. Scroll to **Personal API keys** and click **New API key**
        2. Enter label: `Parable Integration`
        3. Choose permissions (full access or restricted) and click **Create**

        <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="Note Permissions">
        The API key inherits your account's permissions:

        * **Admin users** have access to all workspace data
        * **Member users** have access based on team membership

        <Tip>
          For comprehensive data access, create the key with an admin account.
        </Tip>
      </Step>

      <Step title="Enter values in the form">
        1. **API Key**: Paste your Linear personal API key.
        2. Click **Save & test connection**.
      </Step>
    </Steps>
  </Tab>

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

    <CodeGroup>
      ```bash Test with GraphQL theme={null}
      curl -X POST "https://api.linear.app/graphql" \
        -H "Authorization: Bearer YOUR_LINEAR_API_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{"query": "{ viewer { id email name } }"}'
      ```

      ```bash List Issues theme={null}
      curl -X POST "https://api.linear.app/graphql" \
        -H "Authorization: Bearer YOUR_LINEAR_API_TOKEN" \
        -H "Content-Type: application/json" \
        -d '{"query": "{ issues(first: 5) { nodes { id title } } }"}'
      ```
    </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>
      **Rate Limits:** {platform_1} 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>

    ## GraphQL Examples

    <Accordion title="Query Issues with Details">
      ```graphql theme={null}
      query {
        issues(first: 100) {
          nodes {
            id
            title
            description
            state { name }
            assignee { name email }
            project { name }
            labels { nodes { name } }
            createdAt
            updatedAt
          }
          pageInfo {
            hasNextPage
            endCursor
          }
        }
      }
      ```
    </Accordion>

    <Accordion title="Query Team Members">
      ```graphql theme={null}
      query {
        users {
          nodes {
            id
            name
            email
            active
            admin
          }
        }
      }
      ```
    </Accordion>

    ## Troubleshooting

    | Error                     | Meaning                  | Solution                               |
    | ------------------------- | ------------------------ | -------------------------------------- |
    | `Authentication required` | Missing or invalid token | Verify API key in header               |
    | `Forbidden`               | Insufficient permissions | Use admin account or check team access |
    | `Rate limit exceeded`     | Too many requests        | Implement backoff                      |

    <Accordion title="Common Issues">
      ### Can't see certain teams

      API keys inherit user permissions. If you can't see certain teams, verify the user account has access.

      ### GraphQL errors

      Check your query syntax. Use [Linear's API explorer](https://developers.linear.app/docs/graphql/working-with-the-graphql-api#using-the-api-explorer) to test queries.
    </Accordion>

    ## Additional Resources

    <CardGroup cols={2}>
      <Card title="Linear API" icon="book" href="https://developers.linear.app/docs">
        Official API documentation
      </Card>

      <Card title="GraphQL Schema" icon="code" href="https://developers.linear.app/docs/graphql/working-with-the-graphql-api">
        GraphQL reference
      </Card>
    </CardGroup>
  </Tab>
</Tabs>
