API Reference/

CLI API

API Endpoints

POST/cli/auth/start

No auth required

Begin the device-code authentication flow. The client sends a label and client name, and the server returns a one-time device code the user must approve in their browser.

Request Body

NameDescription
labelreq
stringA display label for the device or session (e.g., "MacBook Pro", "terminal").
clientNamereq
stringYour application’s name. Shown to the user during authorization.

Request

bash
curl -X POST https://api.playanagrama.com/cli/auth/start \
  -H "Content-Type: application/json" \
  -d '{"label":"terminal","clientName":"anagrama-cli"}'

Response Fields

NameDescription
device_code
stringUnique code used to poll for authorization status.
user_code
stringHuman-readable code the user enters at the verification URL.
verification_url
stringURL where the user approves the device login.
expires_in
integerNumber of seconds until the device code expires.
interval
integerMinimum number of seconds to wait between poll requests.

Response 200

JSON
{
  "device_code": "dvc_abc123xyz",
  "user_code": "ABCD-1234",
  "verification_url": "https://playanagrama.com/activate",
  "expires_in": 900,
  "interval": 5
}
Display user_code to the user and direct them to verification_url. Poll no faster than the returned interval (in seconds).
Was this page helpful?
Anagrama API Docs | Developer Reference