Skip to main content

Exchange an API key for an access token

POST 

/api-keys/auth

Send the API key as the bearer token (Authorization: Bearer <api-key>) together with the userId of one of the key's linked users.

The response is an access token with that user's role, valid for the configured token lifetime (see expires).

If the key was created with scopes, the access token is restricted: every route that is not tagged with one of the scopes returns 403 (Scope not allowed by token). The only useful scope is system:register, which limits the token to POST /computers/register. system:ground_station is accepted when creating a key, but no route in this product accepts it, so a token restricted to it cannot call anything.

Both application/json and application/x-www-form-urlencoded bodies are accepted.

Required role: none (authenticate with an API key).

Request​

Responses​

Access granted.