Skip to main content

Token

View as Markdown

PublicTokenInfo object

token_idstring

The ID of this token.

creation_timeint64

Server time (in epoch milliseconds) when the token was created.

expiry_timeint64

Server time (in epoch milliseconds) when the token will expire, or -1 if not applicable.

commentstring

Comment the token was created with, if applicable.

scopesarray of string

Scope of the token was created with, if applicable.

List

GET /api/2.0/token/list

Lists all the valid tokens for a user-workspace pair.

API scopes: authentication

Response

Returns a list of PublicTokenInfo objects.

Create

POST /api/2.0/token/create

Creates and returns a token for a user. If this call is made through token authentication, it creates a token with the same client ID as the authenticated token. If the user's token quota is exceeded, this call returns an error QUOTA_EXCEEDED.

API scopes: authentication

Request body

lifetime_secondsint64

The lifetime of the token, in seconds.

If the lifetime is not specified, this token remains valid for 2 years.

commentstring

Optional description to attach to the token.

scopesarray of string

Optional scopes of the token.

Response

token_valuestring

The value of the new token.

token_infoobject

The information for the new token.

Show child attributesHide child attributes
token_idstring

The ID of this token.

creation_timeint64

Server time (in epoch milliseconds) when the token was created.

expiry_timeint64

Server time (in epoch milliseconds) when the token will expire, or -1 if not applicable.

commentstring

Comment the token was created with, if applicable.

scopesarray of string

Scope of the token was created with, if applicable.

Delete

POST /api/2.0/token/delete

Revokes an access token.

If a token with the specified ID is not valid, this call returns an error RESOURCE_DOES_NOT_EXIST.

API scopes: authentication

Request body

token_idstring

The ID of the token to be revoked.