API Access Tokens
You can use the api_access_token__sys query target to query API access tokens that exist in your Vault. Learn more about access tokens.
Access Token Queryable Fields
Section link for Access Token Queryable FieldsThe following fields are queryable for the api_access_token__sys object:
| Name | Description |
|---|---|
id | The ID of the access token. |
name__v | The name of the access token. |
user__sys | The ID of the user assigned the access token. |
status__v | The status of the access token. |
expiry_date__sys | The expiration date of the access token. |
last_used_date__sys | The date the access token was last used for authentication. |
Access Token Query Examples
Section link for Access Token Query ExamplesThe following are examples of common access token queries.
Query: Retrieve Active Access Tokens for a Specific User
Section link for Query: Retrieve Active Access Tokens for a Specific UserThe following query retrieves all active access tokens for a specific user:
SELECT id, name__v, expiry_date__sys, last_used_date__sys
FROM api_access_token__sys
WHERE user__sys = '12345' AND status__v = 'active__v'Query: Retrieve a Specific Access Token by ID
Section link for Query: Retrieve a Specific Access Token by IDThe following query retrieves a specific access token by ID:
SELECT id, name__v, user__sys, status__v
FROM api_access_token__sys
WHERE id = '0PI00000000C002'