OAuth

OAuth token endpoint

Accepts application/x-www-form-urlencoded or application/json.

authorization_code grant: grant_type, code, code_verifier, client_id, redirect_uri

refresh_token grant: grant_type, refresh_token, client_id

post/public/v1/oauth/token/

Request body

grant_type'authorization_code' | 'refresh_token' required

The grant type. Use authorization_code for desktop/CLI apps (requires PKCE), or refresh_token to refresh an expired access token.

codestring

The authorization code received in the redirect. Required for authorization_code grant.

code_verifierstring

PKCE code verifier. The random string used to generate the code_challenge. Required for authorization_code grant.

client_idstring required

The client_id returned during client registration. Required for both grant types.

redirect_uristring

Must match the redirect_uri used in the authorization request. Required for authorization_code grant.

refresh_tokenstring

The refresh token from a previous token response. Required for refresh_token grant.

resourcestring

RFC 8707 resource indicator. If sent, must match the resource from the authorization request.

Response

access_tokenstring required

Bearer token for authenticating API requests.

refresh_tokenstring required

Token used to obtain a new access token when the current one expires.

token_typestring required

Always Bearer.

expires_ininteger required

Lifetime of the access token in seconds.

scopestring required

Space-separated list of scopes granted to this token.

Changes

Changed in 1 of the 3 revisions of this API.13

    • added the media type application/json for the response with the status 400

      response-media-type-added

    • added the non-success response with the status 403

      response-non-success-status-added

    • added the non-success response with the status 429

      response-non-success-status-added

    • added the optional property active_batches to the response with the 401 status

      response-optional-property-added

    • added the optional property available_credits to the response with the 401 status

      response-optional-property-added

    • added the optional property current_status to the response with the 401 status

      response-optional-property-added

    • added the optional property error to the response with the 401 status

      response-optional-property-added

    • added the optional property max_allowed to the response with the 401 status

      response-optional-property-added

    • added the optional property message to the response with the 401 status

      response-optional-property-added

    • added the optional property required_minimum to the response with the 401 status

      response-optional-property-added

    • added the optional property response_meta to the response with the 401 status

      response-optional-property-added

    • added the optional property retry_after to the response with the 401 status

      response-optional-property-added

    • added the required property error_code to the response with the 401 status

      response-required-property-added

    This revision also has 13 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog