Skip to main content

Create an access token

POST 

/api/auth/token

Exchanges a partner's clientId, clientSecret, and partnerId for a short-lived JWT access token. The returned token must be sent as a Bearer token in the Authorization header of subsequent requests. Optionally, a user-scoped token can be minted for one user by also sending userId (the user's id, as used in GET /api/users/by-id/{id}); the user must belong to your partner account, and the id is echoed back as user_id. Endpoints that support it then use that user and ignore any userId passed in the request; Without userId, the token is issued exactly as before.

Request​

Body

required

    clientId stringrequired
    clientSecret stringrequired
    partnerId stringrequired
    scope stringrequired

    Possible values: Value must match regular expression admin|user

    userId string

    Optional, scope 'user' only. Mints the token for this user: the user's id as used in GET /api/users/by-id/{id}. Must be one of your partner account's users. Omit it for a token that is not tied to a user.

Responses​

Token issued successfully

Schema

    access_token string
    token_type string
    expires_in int32
    partner_id string
    scope string
    user_id string

    The user the token was minted for. Present only when userId was sent in the request.

Loading...