Mint a short-lived token for a client app.
const url = 'https://api.utmelab.com/api/v1/tokens';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"expires_in":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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
Requested lifetime in seconds. Defaults to 300; clamped to 60-900.
Example generated
{ "expires_in": 1}Responses
Section titled “Responses”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
The lifetime actually granted, in seconds.
The grant carried by the token. Today always ["read:catalog"].
Example generated
{ "access_token": "example", "expires_in": 1, "scopes": [ "example" ], "token_type": "example"}An API key is missing or invalid.
Stable body returned by HTTP error responses.
object
Example generated
{ "code": "example", "error": "example"}The API key lacks the required scope.
Stable body returned by HTTP error responses.
object
Example generated
{ "code": "example", "error": "example"}The caller has exceeded the applicable rate limit.
Stable body returned by HTTP error responses.
object
Example generated
{ "code": "example", "error": "example"}The API is temporarily unavailable.
Stable body returned by HTTP error responses.
object
Example generated
{ "code": "example", "error": "example"}