API Tokens

Retrieve details of the current API token.

Changed on
get/v1/api_tokens/self

Request

  • Base URL
    https://api.gitguardian.com
  • URL
    https://api.gitguardian.com/v1/api_tokens/self
  • Auth
    HTTP bearer

Response

Current token details

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"
  ]
}

Changes

    • warning

      added the new nhi:read enum value to the / response property for the response status

    • warning

      added the new nhi:write enum value to the / response property for the response status

    • warning

      added the new custom_tags:read enum value to the / response property for the response status

    • warning

      added the new custom_tags:write enum value to the / response property for the response status

    • warning

      added the new health_checks:read enum value to the / response property for the response status

    • warning

      added the new health_checks:write enum value to the / response property for the response status

    • warning

      added the new public-perimeter:read enum value to the / response property for the response status

    • warning

      added the new scan:create-incidents enum value to the / response property for the response status

    • warning

      added the new secrets:read enum value to the / response property for the response status

    • warning

      added the new secrets:write enum value to the / response property for the response status

    • warning

      added the new sources:scan enum value to the / response property for the response status