POST /api/v1/device/token
CLI polls this endpoint after starting a device flow. Returns 400 with error=authorization_pending until the user authorizes in the browser, then returns the access token (single-use — the device code is deleted on retrieval).

Request Body

application/json
device_code string REQUIRED

Responses

200 Access token
application/json
access_token string REQUIRED
token_type string REQUIRED
Enum: bearer
400 authorization_pending | expired_token | access_denied
429 slow_down (rate limited)
curl -X POST 'https://littledemo.com/api/v1/device/token' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "device_code": "string"}'
const response = await fetch('https://littledemo.com/api/v1/device/token', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "device_code": "string"  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://littledemo.com/api/v1/device/token', headers=headers, json={  "device_code": "string"})print(response.json())
200 Response
{  "access_token": "<string>",  "token_type": "bearer"}
Ask a question... ⌘I