> ## Documentation Index
> Fetch the complete documentation index at: https://docs.coderabbit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add users and assign seats for a self-hosted organization (beta)

> Add up to 500 provider-identified users to a self-hosted organization and assign seats. Requires an Enterprise plan and administrator access; self-hosted organization keys retain their existing administrator exemption. SSO-managed workspaces are unsupported; use POST /v1/users/seats with workspace member identities instead. If seats are unavailable, the operation can reclaim seats from users inactive for at least 30 days. Duplicate user_id values are processed once, keeping the first entry. HTTP 200 can contain partial success or failure; inspect status and failed for per-user results.

Open Beta (This feature is currently in open beta. We are actively improving it based on your feedback. If you encounter any issues or have suggestions, please share them on our Discord community or visit the support page.)

> [tab] CLI Tool
>
> ```bash
> coderabbit api request -X PUT /users --input request.json
> ```
>
> To install and sign in to the CLI, see [Call from the CLI](https://docs.coderabbit.ai/api/cli.md).

> [tab] MCP Server
>
> This operation isn't a tool on the [CodeRabbit MCP server](https://docs.coderabbit.ai/api/mcp.md). Call it over REST or from the CLI.


## OpenAPI

````yaml /openapi.json put /v1/users
openapi: 3.0.0
info:
  title: CodeRabbit API
  version: 1.0.0
  description: >-
    Read and manage CodeRabbit reviews, coding tasks, Verify, Triage, security
    findings, Knowledge Base, configuration, and users for your organization.
servers:
  - url: https://api.coderabbit.ai
    description: US region
  - url: https://api.eu.coderabbit.ai
    description: EU region
security:
  - ApiKeyAuth: []
tags:
  - name: Organizations and repositories
  - name: Pull requests and reviews
  - name: Coding Agent
  - name: Coding environments
  - name: Verify
  - name: Triage
  - name: Security
  - name: Knowledge Base
  - name: Automations
  - name: Reports
  - name: Configuration
  - name: Connections
  - name: Users and roles
  - name: Usage and metrics
paths:
  /v1/users:
    put:
      tags:
        - Users and roles
      summary: Add users and assign seats for a self-hosted organization
      description: >-
        Add up to 500 provider-identified users to a self-hosted organization
        and assign seats. Requires an Enterprise plan and administrator access;
        self-hosted organization keys retain their existing administrator
        exemption. SSO-managed workspaces are unsupported; use POST
        /v1/users/seats with workspace member identities instead. If seats are
        unavailable, the operation can reclaim seats from users inactive for at
        least 30 days. Duplicate user_id values are processed once, keeping the
        first entry. HTTP 200 can contain partial success or failure; inspect
        status and failed for per-user results.
      operationId: add-users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - users
              properties:
                users:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    type: object
                    required:
                      - user_id
                      - user_name
                    properties:
                      user_id:
                        type: string
                        minLength: 1
                        description: User ID assigned by the Git provider.
                      user_name:
                        type: string
                        minLength: 1
                        description: Git provider username.
                      email:
                        type: string
                        format: email
                      name:
                        type: string
      responses:
        '200':
          description: Batch processed; individual users may have failed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - succeeded
                  - failed
                properties:
                  status:
                    type: string
                    enum:
                      - success
                      - partial_success
                      - failure
                  succeeded:
                    type: array
                    items:
                      type: string
                    description: Provider user IDs successfully processed.
                  failed:
                    type: array
                    items:
                      type: object
                      required:
                        - user_id
                        - code
                      properties:
                        user_id:
                          type: string
                        code:
                          type: string
                          description: Per-user error code, such as SEAT_NOT_AVAILABLE.
        '400':
          description: >-
            Invalid request (INVALID_REQUEST) or unsupported SSO workspace
            (SSO_WORKSPACE_UNSUPPORTED).
        '401':
          description: Missing or invalid authentication or organization context.
        '402':
          description: No active subscription (NO_ACTIVE_SUBSCRIPTION).
        '403':
          description: >-
            Self-hosted organization, Enterprise plan, or administrator access
            requirement not met.
        '410':
          description: Legacy API key must be regenerated (LEGACY_API_KEY).
        '429':
          description: Rate limit exceeded.
        '500':
          description: Internal error while adding users.
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-coderabbitai-api-key
      description: >-
        See [Authentication](/api/authentication) for the key types and where to
        create a key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.