latestOpenAPI 3.0.3GitGuardian2026-08-201871515.0 MB

511b067cdcb1

API Tokens

List API tokens.

List all the tokens in the workspace, some filters are available and described below.

get/v1/api_tokens

Query parameters

cursorstring

Pagination cursor.

per_pageinteger

Number of items to list per page.

status'active' | 'expired' | 'revoked'

Status of the token.

member_idinteger
Example:1

Filter by member id.

creator_idinteger
Example:1

Filter by creator id.

scopes'scan' | 'incidents:read' | 'incidents:write' | 'incidents:share' | 'members:read' | 'members:write' | 'teams:read' | 'teams:write' | 'audit_logs:read' | 'honeytokens:read' | 'honeytokens:write' | 'honeytokens:check' | 'api_tokens:read' | 'api_tokens:write' | 'ip_allowlist:read' | 'ip_allowlist:write' | 'sources:read' | 'sources:write' | 'nhi:send-inventory' | 'nhi:write-vault' | 'endpoints:send' | 'ai-discover:send'

Tokens with one of the following scopes.

Example:incidents:read,api_tokens:read
searchstring

Search tokens based on their name.

ordering'created_at' | '-created_at' | 'last_used_at' | '-last_used_at' | 'expire_at' | '-expire_at' | 'revoked_at' | '-revoked_at'

Sort the results by their field value. The default sort is ASC, DESC if the field is preceded by a '-'.

Response

API tokens list

idstring

Id of API token

namestring

Name of API token

workspace_idinteger

Workspace id

type'personal_access_token' | 'service_account'
status'active' | 'expired' | 'revoked'
created_atstring date-time

Creation date of the API token

last_used_atstring date-time nullable

Last usage of the API token

expire_atstring date-time nullable

Expiration date of the API token

revoked_atstring date-time nullable

Revocation date of the API token

member_idinteger nullable

Member id

creator_idinteger nullable

Creator id

scopesstring[]

List of scopes

Example response

[
  {
    "id": "5ddaad0c-5a0c-4674-beb5-1cd198d13360",
    "name": "myTokenName",
    "workspace_id": 42,
    "type": "personal_access_token",
    "status": "revoked",
    "created_at": "2023-05-20T12:40:55.662949Z",
    "last_used_at": "2023-05-24T12:40:55.662949Z",
    "revoked_at": "2023-05-27T12:40:55.662949Z",
    "member_id": 22015,
    "creator_id": 22015,
    "scopes": [
      "incidents:read",
      "scan"
    ]
  }
]