Skip to content

Mint a short-lived token for a client app.

POST
/api/v1/tokens
curl --request POST \
--url https://api.utmelab.com/api/v1/tokens \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "expires_in": 1 }'

Requires a secret key with read:catalog. The returned token can read the catalog and nothing else, expires in at most 15 minutes, cannot mint another token, and is billed to the presenting key’s quota.

Media typeapplication/json

What a mint asks for. Only the lifetime is negotiable; the grant is derived from the presenting key, so a client cannot name a scope.

object
expires_in

Requested lifetime in seconds. Defaults to 300; clamped to 60-900.

integer | null format: int64

Example generated

{
"expires_in": 1
}
Media typeapplication/json

A freshly minted short-lived client token, in plaintext and only once. The table keeps the hash alone, so this response cannot be replayed.

object
access_token
required
string
expires_in
required

The lifetime actually granted, in seconds.

integer format: int64
scopes
required

The grant carried by the token. Today always ["read:catalog"].

Array<string>
token_type
required
string

Example generated

{
"access_token": "example",
"expires_in": 1,
"scopes": [
"example"
],
"token_type": "example"
}

An API key is missing or invalid.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The API key lacks the required scope.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The caller has exceeded the applicable rate limit.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}

The API is temporarily unavailable.

Media typeapplication/json

Stable body returned by HTTP error responses.

object
code
required
string
error
required
string

Example generated

{
"code": "example",
"error": "example"
}