Skip to main content
Use this guide when your Enterprise SSO workspace needs to manage people across multiple connected Git providers through the CodeRabbit API. SSO workspace user management is person-centric after provider accounts are linked: CodeRabbit counts and assigns seats on the workspace member, then mirrors that state to the linked provider accounts used for pull request reviews. For the generated endpoint reference, see GET /v1/users and POST /v1/users/seats. Because the request body depends on the API key type, use the examples on this page for SSO workspace tokens and the generated reference for shared endpoint details.

How SSO workspace users work

An SSO workspace can connect multiple Git providers. The same person might have a GitHub account, a GitLab account, and a self-hosted GitLab account. CodeRabbit cannot always know which provider accounts belong to the same person. Until those accounts are linked to one workspace user, each account can be treated as a separate identity and can consume its own seat. Link the provider accounts to one workspace user to count that person as one seat across providers. You can link accounts in Workspace Team Management, or use this API for automation and bulk updates. After accounts are linked, CodeRabbit stores the seat assignment on the workspace user and applies it to all linked provider accounts used for pull request reviews.

Before you start

Make sure you have:
  • Enterprise SSO enabled for the workspace
  • A workspace API token
  • Workspace admin access for the token owner
  • The email address for each person in the update, or their CodeRabbit user ID (the cr_user_id from GET /v1/users) for members who do not have an email
  • Provider user IDs for the Git identities you plan to link or repair. See Find provider user IDs.
Pass the token in the x-coderabbitai-api-key header:

List workspace users

Use GET /v1/users with a workspace API token and omit org_id to list the whole SSO workspace as one roster.
The response returns one row per CodeRabbit user. The accounts array lists the provider identities linked to that person.
Use seat_filter=assigned or seat_filter=unassigned to filter by the workspace seat state. To filter by provider-account linking status, use linked=true for members who have an email address and at least one active linked account, or linked=false for members who have no email address or no active linked accounts. CodeRabbit applies the linked-status filter before cursor pagination. Use cursor with the next_cursor value from the previous response to fetch the next page. The linked filter is available only for the workspace-wide SSO roster. If you include org_id with a workspace token, CodeRabbit resolves that provider organization inside the workspace and returns the regular organization-scoped user list instead; including linked in that request returns 400 INVALID_REQUEST. Non-SSO requests that include linked also return 400 INVALID_REQUEST.

Manage seats and identities

Use POST /v1/users/seats with a workspace API token to create or update SSO workspace members. Identify each member by email or by cr_user_id (the cr_user_id returned by GET /v1/users). The request body uses a members array.
Each member can include these fields: Each identity can include these fields:

Find provider user IDs

Use identities[].user_id for the stable user identifier CodeRabbit receives from the Git provider. The value is usually not the display name, and it can differ from the username shown in the provider UI. If the account is already linked in CodeRabbit, first call GET /v1/users and reuse the value from accounts[].user_id. If you are repairing an account that is not linked yet, collect the ID from the provider.

Assign a seat

Remove a seat

Manage a member without an email

Some workspace members have no email address, such as unlinked users whose provider accounts are not yet tied to a person. Because those members have no email key, identify them by cr_user_id instead. Read the cr_user_id from GET /v1/users and send it as cr_user_id. Remove a seat from a member by CodeRabbit user ID:
cr_user_id works for any member, including members that also have an email, and you can combine it with seat_assigned and identities in the same request. CodeRabbit never creates a member from cr_user_id; if the ID does not match a member in the workspace, that member fails with USER_NOT_FOUND. If a payload includes both email and cr_user_id, CodeRabbit uses cr_user_id.

Repair linked identities

Include identities when you need CodeRabbit to link, move, or repair the provider accounts for a person. When identities is present, CodeRabbit treats it as the full identity set for that member.

Remove all linked identities

Send an empty identities array to remove all provider links for a member while keeping the workspace member record.

Response format

The response uses the same bulk operation shape as the standard seat management API. For workspace-token requests, the succeeded array and each failed.user_id value echo the identifier you supplied for that member: the email address, or the cr_user_id when you identified the member that way.
Common per-member failure codes include:

Compatibility

This workspace-token flow only applies to Enterprise SSO workspace management. Organization API keys and self-hosted organization keys continue to use the existing provider-user contract for POST /v1/users/seats:
Do not send the provider-user contract with a workspace API token. Do not send the members contract with an organization API key.

What’s next

Enterprise SSO overview

Review the shared Enterprise SSO rollout flow and workspace administration model.

Seat assignment

Learn how manual and automatic seat assignment work across CodeRabbit organizations and SSO workspaces.

Workspace API tokens

Create a workspace-scoped token and review the supported APIs for Enterprise SSO workspaces.