---
title: "Exchange Cli Token"
method: POST
path: "/v1/auth/cli/token"
tags: ["CLI Authentication"]
---

# Exchange Cli Token

`POST /v1/auth/cli/token`

Exchange authorization code for session JWT using PKCE.

## Request body

- CLITokenRequest — Request body for CLI token exchange with PKCE.
  - `code` string, required — Authorization code from OAuth callback
  - `code_verifier` string, required — PKCE code verifier

## Response `200`

Successful Response

- CLITokenResponse — Response for CLI token exchange.
  - `email` string, nullable — User email
  - `expires_in` integer, required — Token expiration in seconds
  - `member_id` string, nullable — User ID from WorkOS
  - `name` string, nullable — User display name
  - `org_id` string, nullable — Organization ID (if applicable)
  - `refresh_token` string, nullable — Refresh token for obtaining new access tokens
  - `session_jwt` string, required — Session JWT (WorkOS access token)

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/terminaluse/apis/sb0-api.md) · [All operations](https://skmtc.net/terminaluse/apis/sb0-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/terminaluse/sb0-api/revisions/f24a474dc415/schema)
