Managing API Access & OAuth 2.0 Authentication

From 10.8 onwards, TestRail supports two methods for authenticating external tools and integrations: OAuth 2.0 and API keys. Both methods are available and can be used simultaneously — OAuth 2.0 is an additional option, not a replacement for API keys. The ability to generate API access tokens — including both API keys and OAuth 2.0 tokens — is controlled by a role permission. See Managing user permissions and roles for details.

Administrators can view and revoke all active tokens and API keys from a central Access Management dashboard in Site Settings.

How OAuth 2.0 authentication works

When an OAuth 2.0-enabled tool connects to TestRail for the first time:

  1. Your browser opens to the TestRail authorization screen.
  2. You enter your TestRail instance name.
  3. You sign in to your TestRail account.
  4. The authorization screen shows the tool's name and the permissions it is requesting:
    • Test data — Access and act on your TestRail projects and data within your existing permissions
    • File attachments — Upload and download file attachments within your TestRail projects
    • Profile — View your name, email address and profile information
  5. Click Allow Access to grant the tool access to your account.

The tool receives a token scoped to the permissions approved. Subsequent connections use the stored token — you will not be prompted to sign in again unless the token is revoked or expires.

Login with OAuth
ℹ️ OAuth 2.0 tokens only grant access within your existing TestRail permissions. A token with test data access cannot read projects or cases you do not already have access to.

Managing access tokens — administrators

Viewing all tokens

Go to Site Settings > API > Access Management.

The dashboard lists all active OAuth 2.0 tokens and API keys across your instance:

Column Description
Name Token or key name
Type OAuth 2.0 or API Key
Created by The user who authorized or generated the token
Last used Date and time of the most recent API call
API Calls Total number of API calls made
Site Settings > API > Access Management

Revoking a token

  1. In the Access Management dashboard, find the token you want to revoke.
  2. Click Revoke.
  3. Confirm in the dialog that appears.
⚠️ Revoking a token immediately disables access. Any tool or integration using it will stop working. This action cannot be undone.

Managing your own tokens — users

Viewing your tokens

Go to My Settings > API Keys.

All your active API keys and OAuth 2.0 tokens are listed here. If an administrator has revoked one of your tokens, a notification appears at the top of the list.

Generating an API key

  1. Go to My Settings > API Keys.
  2. Click Add API Key.
  3. Enter a name for the key and click Generate.
  4. Copy the key immediately — it is shown only once.

Revoking your own token or key

  1. Go to My Settings > API Keys.
  2. Click Revoke next to the token or key and confirm.

Note: Revoking a token or key immediately disables access for any tool using it.

Was this article helpful?
0 out of 0 found this helpful