How to hit the Linear API

Linear's API is GraphQL at a single endpoint, https://api.linear.app/graphql. Every call is a POST with a JSON body holding a query (and optionally variables).

Authentication

Create a personal API key under Settings → Security & access. Send it as Authorization: <key> — no Bearer prefix for personal keys (OAuth tokens do use Bearer). In the examples it's written {{LINEAR_API_KEY}}.

Full reference: https://linear.app/developers/graphql

Who am I

The user the key belongs to — the quickest check that a key works.

curl https://api.linear.app/graphql \
  -H "Authorization: {{LINEAR_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ viewer { id name email } }"}'
Run in PostTaco

List teams

Team ids and keys — you need a team id to create an issue.

curl https://api.linear.app/graphql \
  -H "Authorization: {{LINEAR_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ teams { nodes { id key name } } }"}'
Run in PostTaco

List your assigned issues

Linear lists paginate as nodes; first sets the page size.

curl https://api.linear.app/graphql \
  -H "Authorization: {{LINEAR_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{"query": "{ viewer { assignedIssues(first: 10) { nodes { identifier title state { name } } } } }"}'
Run in PostTaco

Create an issue

A mutation with variables. Returns the new issue's identifier and URL.

curl https://api.linear.app/graphql \
  -H "Authorization: {{LINEAR_API_KEY}}" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { identifier url } } }",
    "variables": {"input": {"teamId": "{{TEAM_ID}}", "title": "Created from PostTaco"}}
  }'
Run in PostTaco