Personal Access Tokens

This represents the API endpoints for personal access tokens. This is a user-based API endpoint, and not on the organization scope.

Personal access tokens (PATs) are a way to authenticate API requests on behalf of a user. They can be used to grant temporary access to specific resources or perform actions on behalf of the user. PATs are typically used in scenarios where a user wants to automate tasks or integrate with external systems.

The personal access token API provides endpoints to provision, manage, and revoke personal access tokens. You can create a new PAT, specify its name, IP restriction, and type. You can also retrieve a list of all PATs associated with the authenticated user and delete a specific PAT.

Using the personal access token API, you can easily integrate PAT management into your applications or scripts, enabling seamless automation and integration with the platform.

For more details on the available endpoints and request/response formats, refer to the API documentation below.

list personal access tokens for your account

list all the personal access tokens (PATs) for your account
HTTP Responses codes for "list personal access tokens for your account"
Status CodeDescription
200OK
400Bad Request
404Not Found
500Internal Server Error
GET /sts/v1/personal-access-tokens

Response

    No Content

                
{
  "items": {
    "$ref": "#/components/schemas/PersonalAccessToken"
  },
  "type": "array"
}
                    

Provision a personal access token

Provision a new personal access token (PAT) for the currently authenticated user.
HTTP Responses codes for "Provision a personal access token"
Status CodeDescription
200OK
400Bad Request
404Not Found
500Internal Server Error
Request Body Parameters
  • ipRestriction string

    IP restriction for the personal access token.

  • name string

    Name of the personal access token.

  • type object

    Type of the personal access token.

POST /sts/v1/personal-access-tokens

Response

Personal Access Token

  • active boolean
  • createdAt string
  • expireAt string
  • id string
  • ipRestriction string
  • lastUsedAt string
  • name string
  • subject string
  • token string
  • type object
                
{
  "description": "Personal Access Token",
  "properties": {
    "active": {
      "description": "Active indicates whether the personal access token is active or not.",
      "type": "boolean"
    },
    "createdAt": {
      "description": "CreatedAt represents the creation time of the personal access token.",
      "type": "string"
    },
    "expireAt": {
      "description": "ExpireAt represents the expiration time of the personal access token.",
      "type": "string"
    },
    "id": {
      "description": "ID represents the unique identifier for a personal access token.",
      "type": "string"
    },
    "ipRestriction": {
      "description": "IPRestriction represents the IP restriction for the personal access token.",
      "type": "string"
    },
    "lastUsedAt": {
      "description": "LastUsedAt represents the last time the personal access token was used.",
      "type": "string"
    },
    "name": {
      "description": "Name represents the name of the personal access token.",
      "type": "string"
    },
    "subject": {
      "description": "Subject represents the subject of the personal access token.",
      "type": "string"
    },
    "token": {
      "description": "Token represents the actual token value.",
      "type": "string"
    },
    "type": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PersonalAccessTokenType"
        }
      ],
      "description": "Type represents the type of the personal access token.",
      "type": "object"
    }
  },
  "type": "object"
}
                    

Revoke a personal access token

Revoke a specific personal access token. Revoking a token will mean it will no longer be able to start new sessions using the Static Token Service API.

Path Parameters:

  • token_id (Personal Access Token ID)
HTTP Responses codes for "Revoke a personal access token"
Status CodeDescription
200OK
400Bad Request
404Not Found
500Internal Server Error
DELETE /sts/v1/personal-access-tokens/{token_id}

Response

  • message string
  • status integer
                
{
  "properties": {
    "message": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    }
  },
  "type": "object"
}