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

# Seat Assignment Mode

> Update the seat assignment mode for the organization. Only accessible by fully self-hosted organizations with enterprise plans.

export const EnterprisePlanBadge = ({tip = "This feature is available exclusively as part of the Enterprise plan. Please refer to our pricing page for more information about our plans and features.", title = "Enterprise Plan", cta = "Read more", href = "https://coderabbit.ai/pricing", disabled = false}) => {
  return <Tooltip tip={tip} cta={cta} href={href}>
        <Badge icon="building-2" disabled={disabled || undefined}>
            {title}
        </Badge>
    </Tooltip>;
};

<EnterprisePlanBadge />

## Update Seat Assignment Mode

To retrieve the current seat assignment mode, use the [Users](/api-reference/users-list) endpoint. The seat assignment mode is included in the response.

<Info>
  Requires **Admin** role. See [Role-based access](/management/roles) for details.
</Info>

<Info>
  Only available for **fully self-hosted** organizations. See [Seat assignment](/management/seat-assignment) for details on assignment modes.
</Info>


## OpenAPI

````yaml post /v1/users/seats/assignment
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/users/seats/assignment:
    post:
      summary: Update Seat Assignment Mode
      description: >-
        Update the seat assignment mode for the organization. Only accessible by
        fully self-hosted organizations with enterprise plans.
      operationId: update-seat-assignment-mode
      parameters:
        - name: x-coderabbitai-api-key
          description: Your CodeRabbit API key
          required: true
          example: cr-xxxxxxxxxx
          schema:
            type: string
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSeatAssignmentModeRequest'
            examples:
              manual:
                summary: Set to manual mode
                value:
                  mode: manual
              automatic:
                summary: Set to automatic mode
                value:
                  mode: automatic
      responses:
        '200':
          description: Seat assignment mode updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeatAssignmentModeResponse'
              example:
                mode: manual
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: INVALID_REQUEST
                  message: >-
                    Invalid enum value. Expected 'manual' | 'automatic',
                    received 'invalid'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: UNAUTHORIZED
                  message: Invalid or inactive API key
        '402':
          description: Payment Required - No active subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: NO_ACTIVE_SUBSCRIPTION
                  message: No active subscription found for the organization
        '403':
          description: >-
            Forbidden - Not an admin, not self-hosted, or missing Enterprise
            plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: SELF_HOSTED_ONLY
                  message: This endpoint is only available for self-hosted instances
        '410':
          description: Legacy API key - deprecated and no longer supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: LEGACY_API_KEY
                  message: >-
                    You are using a legacy API key. We are deprecating use of
                    legacy keys. Regenerate a new API key and retry the request.
        '429':
          description: Rate limit exceeded (10 requests per 60 seconds per organization)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: RATE_LIMIT_EXCEEDED
                  message: Rate limit exceeded. Max 10 requests per 60 seconds
          headers:
            Retry-After:
              description: Seconds to wait before retrying
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Maximum requests allowed per time window
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Always 0 when rate limited
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix timestamp when the rate limit resets
              schema:
                type: integer
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: INTERNAL_ERROR
                  message: Internal server error while updating seat assignment mode
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpdateSeatAssignmentModeRequest:
      type: object
      description: Request to update the seat assignment mode
      properties:
        mode:
          type: string
          enum:
            - automatic
            - manual
          description: >-
            The seat assignment mode to set. 'automatic' auto-assigns seats when
            CodeRabbit is tagged; 'manual' requires admin approval.
      required:
        - mode
      additionalProperties: false
    SeatAssignmentModeResponse:
      type: object
      description: Seat assignment mode for the organization
      properties:
        mode:
          type: string
          enum:
            - automatic
            - manual
          description: >-
            The current seat assignment mode. 'automatic' means new developers
            are auto-assigned seats when CodeRabbit is tagged; 'manual' requires
            admin approval.
      required:
        - mode
      additionalProperties: false
    ApiError:
      type: object
      description: Standard API error response
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Human-readable error message
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  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.

````