Skip to main content
A workspace API token lets an Enterprise SSO workspace admin call the API for every organization in the workspace with one token, instead of one key per organization. It works with the export and user-management operations, and with product operations for one GitHub Cloud organization at a time. To compare it with the other key types, see Authentication.

Who can create tokens

Workspace API tokens exist only in Enterprise SSO workspaces. Only workspace admins can create, list, and delete them. CodeRabbit checks that the token’s owner is still a workspace admin every time the token is used, so a token stops working when its owner loses the role.

Create a token

1

Open API tokens

In the CodeRabbit app, open Workspace management > API tokens, or go to /workspace/api-keys.
2

Create the token

Choose Create API Token, enter a name in API token name, and choose an Expiration.
3

Copy the token

Copy the token right away. CodeRabbit shows it only once.
Send the token in the x-coderabbitai-api-key header, like any key. This request lists the people in the whole workspace:

Supported operations

A workspace API token works with these export and user-management operations. Reads cover the whole workspace unless you pass an organization selector: org_name, the GitHub login of a GitHub Cloud organization, or org_id, the provider_organization_id that List organizations returns for it. The table names org_id; org_name works in the same place. Select an organization explains both selectors, where they go, and the errors they can return.

Product operations

Product operations, such as coding tasks, Triage, security scans, and custom role definitions, act on one GitHub Cloud organization. With a workspace API token, pass org_name or org_id on every request; without one, they return 400. The organization must belong to the workspace, and the token acts as an admin of that organization while its owner is a workspace admin. For operations that act on repositories, the token’s owner also needs their GitHub account connected in the workspace; otherwise the request fails with the message “Connect the API key owner’s GitHub account in this workspace.” Organizations on other Git platforms or on self-hosted CodeRabbit return 404 for product operations. The seat assignment mode of an SSO workspace isn’t available through the API: set it in Workspace Team Management. See Choose a seat assignment mode. For a walkthrough of listing workspace members, managing their seats, and linking their Git provider accounts, see SSO user management API.

What’s next

Manage users, seats, and roles

Automate seat assignment, role changes, and audit log exports with your token.

Authenticate requests

See which operations accept which key type, and how to store and rotate keys.

Audit logs

Track administrative activity across the workspace.