Token Management
AdminTokenInfo object
- token_idstring
ID of the token.
- creation_timeint64
Timestamp when the token was created.
- expiry_timeint64
Timestamp when the token expires.
- commentstring
Comment that describes the purpose of the token, specified by the token creator.
- created_by_idint64
User ID of the user that created the token.
- created_by_usernamestring
Username of the user that created the token.
- owner_idint64
User ID of the user that owns the token.
- workspace_idint64
If applicable, the ID of the workspace that the token was created in.
- last_used_dayint64
Approximate timestamp for the day the token was last used. Accurate up to 1 day.
- scopesarray of stringGA
Scope of the token was created with, if applicable.
Get token info GA
GET
Gets information about a token, specified by its ID.
API scopes: authentication
Parameters
- token_idstringRequiredpath
The ID of the token to get.
Response
- token_infoobject
Show child attributesHide child attributes
- token_idstring
ID of the token.
- creation_timeint64
Timestamp when the token was created.
- expiry_timeint64
Timestamp when the token expires.
- commentstring
Comment that describes the purpose of the token, specified by the token creator.
- created_by_idint64
User ID of the user that created the token.
- created_by_usernamestring
Username of the user that created the token.
- owner_idint64
User ID of the user that owns the token.
- workspace_idint64
If applicable, the ID of the workspace that the token was created in.
- last_used_dayint64
Approximate timestamp for the day the token was last used. Accurate up to 1 day.
- scopesarray of string
Scope of the token was created with, if applicable.
List all tokens GA
GET
Lists all tokens associated with the specified workspace or user.
API scopes: authentication
Parameters
- created_by_idint64query
User ID of the user that created the token.
- created_by_usernamestringquery
Username of the user that created the token.
Response
Returns a list of AdminTokenInfo objects.
Update an on-behalf token GA
PATCH
Updates a token, specified by its ID.
API scopes: authentication
Parameters
- token_idstringRequiredpath
ID of the token.
Request body
- tokenobjectRequired
Show child attributesHide child attributes
- creation_timeint64
Timestamp when the token was created.
- expiry_timeint64
Timestamp when the token expires.
- commentstring
Comment that describes the purpose of the token, specified by the token creator.
- created_by_idint64
User ID of the user that created the token.
- created_by_usernamestring
Username of the user that created the token.
- owner_idint64
User ID of the user that owns the token.
- workspace_idint64
If applicable, the ID of the workspace that the token was created in.
- last_used_dayint64
Approximate timestamp for the day the token was last used. Accurate up to 1 day.
- scopesarray of string
Scope of the token was created with, if applicable.
- update_maskstringRequired
A list of field name under token, For example, {"update_mask": "comment,scopes"}
Response
Returns the AdminTokenInfo object.
Delete a token GA
DELETE
Deletes a token, specified by its ID.
API scopes: authentication
Parameters
- token_idstringRequiredpath
The ID of the token to revoke.
Create on-behalf token GA
POST
Creates a token on behalf of a service principal.
API scopes: authentication
Request body
- application_idstringRequired
Application ID of the service principal.
- lifetime_secondsint64
The number of seconds before the token expires.
- commentstring
Comment that describes the purpose of the token.
- scopesarray of string
Response
- token_valuestring
Value of the token.
- token_infoobject
Show child attributesHide child attributes
- token_idstring
ID of the token.
- creation_timeint64
Timestamp when the token was created.
- expiry_timeint64
Timestamp when the token expires.
- commentstring
Comment that describes the purpose of the token, specified by the token creator.
- created_by_idint64
User ID of the user that created the token.
- created_by_usernamestring
Username of the user that created the token.
- owner_idint64
User ID of the user that owns the token.
- workspace_idint64
If applicable, the ID of the workspace that the token was created in.
- last_used_dayint64
Approximate timestamp for the day the token was last used. Accurate up to 1 day.
- scopesarray of string
Scope of the token was created with, if applicable.