---
title: "Approve CLI authentication request"
method: PUT
path: "/api/cli/auth"
tags: ["CLI"]
---

# Approve CLI authentication request

`PUT /api/cli/auth`

## Request

- Base URL: `https://intentdocs.com`
- URL: `https://intentdocs.com/api/cli/auth`
- Auth: API key in cookie `__session`

Called from the browser (authenticated via Clerk) to approve a pending CLI authentication request and generate a long-lived token.

## Request body

- object
  - `code` string, required: The authentication code to approve

## Response `200`

Request approved successfully

- object
  - `ok` boolean

## Other responses

- `400`: Invalid or expired authentication request
- `401`: Not authenticated

---

[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)
