Start a `voxrouter login` device-code flow
Alpha
POST
https://api.voxrouter.ai/v1/auth/device-codeBegin 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
AuthorizationstringRequiredBearer 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_codestringRequiredOpaque token the CLI presents to `/v1/auth/poll`. Cryptographically
random and never shown to the user.
user_codestringRequiredShort 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>RequiredBrowser 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_inintegerRequiredSeconds until both codes expire.
intervalintegerRequiredRecommended 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.
| Status | Meaning |
|---|---|
| 503 | Auth backend not configured on this deployment. |