Skip to content

Poll for the minted API key

POST
/auth/device/token
curl --request POST \
--url https://api.loomta.com/auth/device/token \
--header 'Content-Type: application/json' \
--data '{ "device_code": "example" }'

Poll with the device_code from /auth/device/start. Returns the API key once the user approves. While pending, returns HTTP 400 with an error of authorization_pending, slow_down, expired_token, or access_denied (RFC 8628 §3.5). Honor the interval; back off on slow_down.

Media typeapplication/json
object
device_code
required
string
Examplegenerated
{
"device_code": "example"
}

Approved — the minted API key.

Media typeapplication/json
object
status
required
string
Allowed value: approved
api_key
required

A loomta_sk_… key. Returned exactly once.

string
Example
{
"status": "approved"
}

Pending or terminal device-flow state.

Media typeapplication/json
object
error
required
string
Allowed values: authorization_pending slow_down expired_token access_denied
Example
{
"error": "authorization_pending"
}