Skip to main content
POST
Exchange a device code for an API key

Body

application/json
device_code
string
required

The device_code returned when the device code was created

Minimum string length: 1
Example:

"kT3n9cQ0yVZr8mWbH1sLx4aPqE6uJ2dFgN7oRtYvS5w"

approval_secret
string

The one-time secret the dashboard adds to the callback URL after the user approves. Required for sign-ins started by the Sevalla MCP server and for device codes created with a callback_url: without it their status stays pending. Device codes without a callback, such as the typed-code sign-in of the Sevalla CLI, do not need it

Minimum string length: 1
Example:

"Zq8vN2mXc4rT7yWb1kLp9sHd3fJg6uEa0oRiQtYxS5w"

Response

Default Response

status
enum<string>
required

Current status of the device code. pending - waiting for the user, approved - the user approved and token is included, denied - the user rejected the request, expired - the code expired, was already used or does not exist

Available options:
pending,
approved,
denied,
expired
Example:

"pending"

token
string

The new API key, only present when status is approved. It is returned once, the code cannot be used again, and the key expires after 90 days. Store it securely

Example:

"svl_abc123..."