---
title: "Exchange a CLI auth code for a control-plane session"
method: POST
path: "/agent/v1/control-plane/cli/token"
tags: ["ControlPlane"]
---

# Exchange a CLI auth code for a control-plane session

`POST /agent/v1/control-plane/cli/token`

## Request

- Base URL: `https://api.run402.com`
- URL: `https://api.run402.com/agent/v1/control-plane/cli/token`
- Auth: none declared

PKCE S256 + state verified; mints a sign-in session with grade: loopback. Public (no session yet).

## Request body

- object
  - `code` string, required
  - `code_verifier` string, required
  - `state` string, required

## Response `200`

Control-plane session minted

- object

## Other responses

- `400`: Invalid grant / PKCE failure (INVALID_GRANT)

---

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