Skip to Content
Unmissed Cloud is coming soon.Join the waitlistJoin
Unmissed

Get tokens

Trade a sign-in code or a refresh token for an access token.

POST
/oauth/token

Trades an authorization code, or a refresh token, for an access token and a new refresh token. Apps are public clients, so there's no client secret.

A code works once and for 5 minutes. A refresh token works once: the response has the next one. Sending a used code or refresh token again disconnects the app, since someone else may have a copy.

Each address gets 60 requests a minute.

Request Body

application/x-www-form-urlencoded
  1. body
grant_type*string
Value in"authorization_code""refresh_token"
client_id*string
code?string

For authorization_code.

code_verifier?string

For authorization_code. The PKCE verifier.

redirect_uri?string

For authorization_code. The one the code was sent to.

refresh_token?string

For refresh_token.

resource?string

Optional. When sent, it must be the one the app connected to.

Response Body

New tokens.

application/json
  1. response
access_token*string
token_type*"Bearer"
Value in"Bearer"
expires_in*integer

Seconds the access token lasts.

refresh_token*string
scope*string

read write for full access, read for read-only.

Example Request
curl -X POST 'http://localhost:8080/oauth/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=authorization_code&client_id=string'
Example Response
{
  "access_token": "unm_at_3h9Xk2mQ7vR1tY8wL4pZ6nB0cF5dJ2sA",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "unm_rt_8kP2vN5xQ1mW7tR4yL9zB3cH6dF0sJ2a",
  "scope": "read write"
}