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

# List Roles

> Lists built-in roles and Enterprise custom roles for the authenticated organization.

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

Lists built-in roles and Enterprise custom roles for the authenticated organization. Use the `role_type` query parameter to filter by role type, and include `permissions` or `user_count` in the response as needed.

For more information, see [Role-based access](/management/roles).


## OpenAPI

````yaml get /v1/roles
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/roles:
    get:
      tags:
        - Role Management
      summary: List organization roles
      description: >-
        Lists built-in roles and Enterprise custom roles for the authenticated
        organization.
      operationId: list-roles
      parameters:
        - in: query
          name: role_type
          schema:
            type: string
            enum:
              - all
              - system
              - custom
            default: all
          description: Optional role type filter.
        - in: query
          name: include_permissions
          schema:
            type: boolean
            default: false
        - in: query
          name: include_user_count
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: Successfully retrieved roles
      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.

````