v17

latestOpenAPI 3.0.1raw.githubusercontent.com2026-07-08165682.0 MB
OAuth tokens

Create or renew an OAuth token

Create an OAuth token from an authorization grant code, or refresh an OAuth token from a refresh token

Authorization

A service token must have at least one of the following access in order to use this API endpoint:

Service Token Accesses write_oauth_tokens

post/organizations/{organization}/oauth-applications/{id}/token

Path parameters

organizationstring required

The name of the organization the OAuth application belongs to

idstring required

The ID of the OAuth application

Request body

client_idstring required

The OAuth application's client ID

client_secretstring required

The OAuth application's client secret

grant_type'authorization_code' | 'refresh_token' required

Whether an OAuth grant code or a refresh token is being exchanged for an OAuth token

codestring

The OAuth grant code provided to your OAuth application's redirect URI. Required when grant_type is authorization_code

redirect_uristring

The OAuth application's redirect URI. Required when grant_type is authorization_code

refresh_tokenstring

The refresh token from the original OAuth token grant. Required when grant_type is refresh_token

Response

Returns the created OAuth token

idstring required

The ID of the service token

namestring nullable required

The name of the service token

display_namestring required

The display name of the service token

tokenstring nullable

The plaintext token. Available only after create.

plain_text_refresh_tokenstring nullable

The plaintext refresh token. Available only after create.

avatar_urlstring required

The image source for the avatar of the service token

created_atstring required

When the service token was created

updated_atstring required

When the service token was last updated

expires_atstring nullable required

When the service token will expire

last_used_atstring nullable required

When the service token was last used

actor_idstring nullable required

The ID of the actor on whose behalf the service token was created

actor_display_namestring nullable required

The name of the actor on whose behalf the service token was created

actor_typestring nullable required

The type of the actor on whose behalf the service token was created