Skip to content

Exchange API key for JWT

POST
/auth/token

Exchanges an API key for a JWT access token. The returned token should be used in the Authorization header as Bearer <token> for authenticated requests. Token expires after the time specified in expires_in.

Request to exchange an API key for a JWT.

object
api_key
required

The plaintext API key.

string
expires_in_secs

Optional expiration in seconds from now.

integer | null format: int64
Example
{
"api_key": "pat_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"expires_in_secs": 3600
}

Token generated

JWT token response (for API key exchange).

object
access_token
required

The JWT access token.

string
expires_in
required

Token lifetime in seconds.

integer format: int64
token_type
required

Token type (always “Bearer”).

string
Example
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"token_type": "Bearer"
}

Invalid or revoked API key

Unified error response body for all endpoints.

object
code

Optional machine-readable error code.

string | null
error
required

Human-readable error message.

string

Server error

Unified error response body for all endpoints.

object
code

Optional machine-readable error code.

string | null
error
required

Human-readable error message.

string