> ## 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

> 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.



## OpenAPI

````yaml /openapi.json put /v1/users
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/users:
    put:
      tags:
        - User Management
      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: >-
        API key for authentication. You can create an API key from the
        CodeRabbit dashboard.

````

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