Skip to main content
You are viewing the documentation of release 26.1, which is no longer the current one. Go to the documentation of the current release 26.2.

API Token Management Overview

API tokens provide long-lived authentication for integrations, but proper management is essential for security. This scenario demonstrates how to list all your active API tokens and delete those that are no longer needed. Key benefits of token management:
  • Regular auditing of active tokens helps maintain security
  • Removing unused tokens reduces potential attack surface
  • Token management is a critical part of security best practices
  • Each user can have multiple API tokens active simultaneously
Deleting an API token immediately invalidates it and any integrations using that token will stop working. Make sure you’re deleting the correct token.

Step 1 - Authenticate user to access token management (Optional)

Before managing your API tokens, you need to authenticate with your username and password to obtain a session token.
If you already have a valid API token, you can use that instead of logging in with username and password.
Endpoint
Request
Response
The response contains the following important properties:
  • token - Located at token in the response.
    • The authentication token that should be included in subsequent API requests. This token identifies your session and provides access to authorized resources.
    • Example value: 9rg0M3I4B64yajvt2jfiBqF6hKJY3u5MugcFkpjyGOT4rIrJKnN1fvayPNi6EN88
Authentication successful. The response includes a session token that will be used to list and manage your API tokens.

Step 2 - List all active API tokens

Retrieves a list of all active API tokens for your account. This is an important first step in token management and security auditing.
  • Regular auditing of your active tokens is a security best practice
  • Each token shows when it was created and last used
  • Identify tokens that may no longer be needed or could be compromised
  • Use this information to decide which tokens to revoke
Consider implementing a regular schedule for reviewing your active API tokens as part of your security practices.
Endpoint
Request
Response
The response contains the following important properties:
  • apiToken - Located at results[0].id in the response.
    • The unique identifier of an API token.
    • Example value: VlzlS633OQD2PC290D2a1xjlAGFrE28e95Ob7nhPaAWhOxYdx25QzBFPJjisrNB7
The response contains an array of all active API tokens for your account. Each token includes:
  • A unique identifier that can be used to revoke the token
  • Creation timestamp showing when the token was generated
  • Last usage information to identify potentially unused tokens
  • Human readable description of the token, provided during the token creation
Tokens that haven’t been used recently or were created for temporary purposes are good candidates for deletion.

Step 3 - Revoke an API token

Permanently invalidates an API token that is no longer needed. Once revoked, the token cannot be used for authentication and any systems using it will lose access.
  • Revoking unused tokens is a security best practice
  • Tokens should be revoked when an integration is decommissioned
  • Consider revoking and replacing tokens periodically as part of security rotation
  • There is no way to reactivate a token once it’s been revoked - you’ll need to create a new one
This action cannot be undone. Any systems using this token will immediately lose access to your account.
Endpoint
Request
The API token has been successfully revoked and can no longer be used for authentication.
If you accidentally revoke the wrong token, you’ll need to create a new one and update any affected integrations.

Step 4 - End the management session (Optional)

Terminates your current session after completing the token management tasks. Endpoint
Request
The session has been successfully terminated. Your account security is maintained by not leaving active sessions.

API Token Management Best Practices

Regular auditing and management of your API tokens is an essential security practice:
  • List and review your active tokens on a regular schedule
  • Revoke any tokens that are no longer being used
  • Replace long-lived tokens periodically, especially for critical systems

Example Token Management Code

See our OpenAPI documentation to learn about the full set of API endpoints and parameters.
Please use proper exception handling and function decomposition in your own code. The code is provided for illustrative purposes only and is not intended for production use.