---
title: "Poll CLI authentication status"
method: GET
path: "/api/cli/auth"
tags: ["CLI"]
---

# Poll CLI authentication status

`GET /api/cli/auth`

## Request

- Base URL: `https://intentdocs.com`
- URL: `https://intentdocs.com/api/cli/auth`
- Auth: none declared

Check if a CLI authentication request was approved by the user in the browser. Called repeatedly by the CLI until approved or expired.

## Query parameters

- `code` string, required

## Response `200`

Authentication status

- union
  - object
    - `status` 'pending': Still awaiting user approval
  - object
    - `status` 'expired': Request expired (10-minute window passed)
  - object
    - `status` 'approved'
    - `token` string: Long-lived CLI token (intent_cli_* prefix; tokens issued before the rebrand still authenticate)
    - `userId` string
    - `posthogKey` string, nullable
    - `posthogHost` string, nullable

## Other responses

- `400`: Missing or invalid code
- `404`: Authentication code not found
- `429`: Rate limit exceeded for polling

---

[API](https://skmtc.dev/intentdocs/apis/intentdocs-api.md) · [All operations](https://skmtc.dev/intentdocs/apis/intentdocs-api/llms.txt) · [OpenAPI document](https://skmtc.dev/intentdocs/apis/intentdocs-api/revisions/28abdea021d0?raw)
