Lists API tokens belonging to the authenticated org or team, newest first. Only active tokens are returned unless the `all` query parameter is set.
Required permission
Account > Admin > ApiTokens > Read
Query parameters
per_page
integerThe number of results to display per request. Maximum of 100 results per page.page
integerThe page number to access.cursor
stringThe cursor returned from the previous page of results, used to request the next page.all
booleanWhen true, include inactive tokens (revoked or expired). By default only active tokens are returned.
Response body
- {object}Response object.
data
{object} requiredResult data.tokens
[array] requiredAn array of API tokens.- {object}An API token.
id
string requiredThe ID (slug) of the API token.name
string requiredThe display name of the API token.description
stringThe description of the API token.role
{object}The role assigned to this token.name
string requiredThe display name of the role.roleId
stringThe ID (slug) of the role.roleType
stringThe type of the role.one ofteam, orgentityType
stringThe entity type of the role.one ofteam, orgcreatorEmail
stringThe email of the user who created this token.createdAt
string requiredThe time the token was created.expiresAt
string | nullThe time the token expires, or null if it has no expiry.revoked
boolean requiredWhether the token has been revoked.revokedAt
stringThe time the token was revoked, if it has been.lastUsedAt
stringThe time the token was last used to authenticate.active
boolean requiredWhether the token is currently active (not revoked and not expired).pagination
{object} requiredData about the endpoint pagination.hasNextPage
boolean requiredIs there another page of results available?cursor
stringThe cursor to access the next page of results.count
number requiredThe number of results returned by this request.
API
CLI
JS Client
GET /v1/tokens
GET /v1/teams/{teamId}/tokens
Example response
200 OK
A list of API tokens.
JSON
{
"data": {
"tokens": [
{
"id": "my-api-token",
"name": "My API Token",
"description": "CI/CD pipeline token",
"role": {
"name": "Developer",
"roleId": "developer",
"roleType": "team",
"entityType": "team"
},
"creatorEmail": "user@example.com",
"createdAt": "2024-01-15T10:30:00.000Z",
"expiresAt": "2024-07-15T10:30:00.000Z",
"revoked": false,
"revokedAt": "2024-06-15T10:30:00.000Z",
"lastUsedAt": "2024-06-01T10:30:00.000Z",
"active": true
}
]
},
"pagination": {
"hasNextPage": false,
"count": 1
}
}