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

# Users

> List all users in your organization with optional filtering by seat assignment and role status. Supports cursor-based pagination.

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

## Users List

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


## OpenAPI

````yaml get /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:
    get:
      summary: Users
      description: >-
        List all users in your organization with optional filtering by seat
        assignment and role status. Supports cursor-based pagination.
      operationId: list-users
      parameters:
        - name: x-coderabbitai-api-key
          description: Your CodeRabbit API key
          required: true
          example: cr-xxxxxxxxxx
          schema:
            type: string
          in: header
        - name: seat_filter
          description: Filter users by seat assignment status
          required: false
          schema:
            type: string
            enum:
              - all
              - assigned
              - unassigned
            default: all
          in: query
        - name: role_filter
          description: Filter users by role
          required: false
          schema:
            type: string
            enum:
              - all
              - member
              - admin
            default: all
          in: query
        - name: limit
          description: Maximum number of users to return per page
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
          in: query
        - name: cursor
          description: Pagination cursor from previous response's next_cursor field
          required: false
          schema:
            type: string
          in: query
      responses:
        '200':
          description: List of users with seat and subscription info
          headers:
            X-RateLimit-Limit:
              description: Maximum requests allowed per time window (10)
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in current window
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix timestamp when the rate limit resets
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                properties:
                  seats_purchased:
                    type: integer
                    description: Total number of seats purchased in the subscription
                  seats_assigned:
                    type: integer
                    description: Number of seats currently assigned to users
                  seat_assignment_mode:
                    type: string
                    enum:
                      - automatic
                      - manual
                    description: The seat assignment mode for the organization
                  users:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
                  next_cursor:
                    type: string
                    nullable: true
                    description: >-
                      Cursor for the next page of results, or null if no more
                      results
                required:
                  - seats_purchased
                  - seats_assigned
                  - seat_assignment_mode
                  - users
              example:
                seats_purchased: 50
                seats_assigned: 30
                seat_assignment_mode: manual
                users:
                  - user_id: '121358802'
                    seat_assigned: true
                    role: cr_admin
                  - user_id: '22605247'
                    seat_assigned: false
                    role: cr_member
                next_cursor: MjI2MDUyNDc=
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              examples:
                invalid_filter:
                  summary: Invalid filter value
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: >-
                        Invalid seat_filter. Must be one of: "all", "assigned",
                        "unassigned"
                invalid_cursor:
                  summary: Invalid cursor format
                  value:
                    error:
                      code: INVALID_REQUEST
                      message: Invalid cursor format
        '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
        '403':
          description: Forbidden - Not an admin or missing Enterprise plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
              example:
                error:
                  code: NOT_ADMIN
                  message: Only administrators can perform seat management operations
        '410':
          description: >-
            Legacy API key - deprecated and no longer supported for user
            management
          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 listing users
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.coderabbit.ai/v1/users?seat_filter=all&role_filter=all&limit=100' \
              --header 'x-coderabbitai-api-key: <api-key>'
        - lang: Python
          label: Python
          source: |-
            import requests

            url = 'https://api.coderabbit.ai/v1/users'

            headers = {'x-coderabbitai-api-key': '<api-key>'}

            params = {'seat_filter': 'all', 'role_filter': 'all', 'limit': 100}

            response = requests.get(url, headers=headers, params=params)

            print(response.text)
        - lang: JavaScript
          label: JavaScript
          source: >-
            const options = {method: 'GET', headers: {'x-coderabbitai-api-key':
            '<api-key>'}};


            fetch('https://api.coderabbit.ai/v1/users?seat_filter=all&role_filter=all&limit=100',
            options)
              .then(res => res.json())
              .then(res => console.log(res))
              .catch(err => console.error(err));
        - lang: Go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"https://api.coderabbit.ai/v1/users?seat_filter=all&role_filter=all&limit=100\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"x-coderabbitai-api-key\", \"<api-key>\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
components:
  schemas:
    User:
      type: object
      description: A user in the organization
      properties:
        user_id:
          type: string
          description: Unique identifier assigned by the Git provider
        seat_assigned:
          type: boolean
          description: Whether the user has a seat assigned
        role:
          type: string
          description: User role
      required:
        - user_id
        - seat_assigned
        - role
      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.

````