Search docs

Find any page, endpoint, or guide.

Start a `voxrouter login` device-code flow

Alpha
POSThttps://api.voxrouter.ai/v1/auth/device-code

Begin a CLI login. Returns a `device_code` (which the CLI will present back via `/v1/auth/poll`) and a `user_code` (which the user enters in their browser at `verification_uri`). The CLI should print `verification_uri_complete` and start polling. No authentication is required to initiate. Codes expire in 10 minutes; servers may garbage-collect rows past expiry.

bash
curl -X POST https://api.voxrouter.ai/v1/auth/device-code \
  -H "Authorization: Bearer $VOXROUTER_API_KEY"

Headers

AuthorizationstringRequired
Bearer token. Send as Authorization: Bearer pk_....

Response

Device-code pair issued.

json
{
  "device_code": "string",
  "user_code": "ABCD-1234",
  "verification_uri": "https://voxrouter.ai/cli/approve",
  "verification_uri_complete": "string",
  "expires_in": 600,
  "interval": 5
}
device_codestringRequired
Opaque token the CLI presents to `/v1/auth/poll`. Cryptographically random and never shown to the user.
user_codestringRequired
Short human-readable code shown in the terminal (e.g. `ABCD-1234`). The user enters or visits this in the browser to approve.
verification_uristring<uri>Required
Browser URL where the user approves the device. The CLI prints both this and `verification_uri_complete` (which has `?code=` already filled in).
verification_uri_completestring<uri>Required
`verification_uri` with the `user_code` already in the query string — copy/pasteable straight into the browser.
expires_inintegerRequired
Seconds until both codes expire.
intervalintegerRequired
Recommended seconds between `/v1/auth/poll` requests.

Errors

Non-2xx responses return a JSON body with a machine-readable error code and an optional details string.

StatusMeaning
503Auth backend not configured on this deployment.