v63

latestOpenAPI 3.0.0Proprietaryraw.githubusercontent.com2026-08-0110571.8 MB
CLI Authentication
x-internal

Create a new CLI session with auth code

Generates a new CLI session with a random 6-character code. This endpoint is the first step in the CLI authentication flow, creating a session that can later be linked to a user account. The generated code is displayed to the user in the CLI and should be entered in the web interface to complete authentication. Optionally accepts a scope ('project' or 'user') and a source string.

post/api/v3.1/cli/create-session

Request body

scope'project' | 'user'

Key scope. 'project' (default) returns a project-level API key; 'user' returns a user-level API key valid across projects.

sourcestring

Free-form string describing the source, e.g. 'Johns MacBook (darwin, v1.2.3)'

Response

CLI session created successfully with a unique ID and temporary authentication code

idstring required

Unique identifier for the CLI session. UUID v4 format used for tracking and retrieval.

codestring required

The 6-character hexadecimal code used for CLI login

expiresAtstring required

The ISO timestamp when the session expires

status'pending' | 'linked' required

The current status of the session

scope'project' | 'user' required

The key scope for this session

Example response

{
  "code": "ABC123",
  "expiresAt": "2023-01-01T12:00:00.000Z",
  "status": "pending",
  "scope": "project"
}