CodeRabbit Role Management API

The Role Management API from CodeRabbit — 3 operation(s) for role management.

Operations 6

GET /v1/roles List organization roles #
POST /v1/roles Create a custom role #
GET /v1/roles/permissions List role permission options #
GET /v1/roles/{roleId} Get role details #
PATCH /v1/roles/{roleId} Update a custom role #
DELETE /v1/roles/{roleId} Delete a custom role #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/coderabbit:coderabbit-role-management-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

coderabbit-role-management-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: CodeRabbit API spec Role Management API
  version: 1.0.0
servers:
- url: https://api.coderabbit.ai
security:
- ApiKeyAuth: []
tags:
- name: Role Management
paths:
  /v1/roles:
    x-generated: true
    get:
      operationId: list-roles
      summary: List organization roles
      description: Lists built-in roles and Enterprise custom roles for the authenticated organization.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      parameters:
      - in: query
        name: org_id
        schema:
          type: string
        description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
      - 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
    post:
      operationId: create-role
      summary: Create a custom role
      description: Creates an Enterprise custom role. If is_default is true, the new role becomes the subscription default and the previous default is cleared.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                org_id:
                  type: string
                  description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
                name:
                  type: string
                  example: Security Reviewer
                description:
                  type: string
                is_default:
                  type: boolean
                  default: false
                duplicate_from:
                  type: string
                  description: Role ID to copy permissions from. Defaults to cr_member when permissions are omitted.
                permissions:
                  type: array
                  items:
                    type: object
                    properties:
                      resource_id:
                        type: string
                        example: user_management
                      access_type:
                        type: string
                        enum:
                        - read
                        - write
                        - delete
      responses:
        '201':
          description: Custom role created
  /v1/roles/permissions:
    x-generated: true
    get:
      operationId: list-role-permission-options
      summary: List role permission options
      description: Lists the valid resource_id and access_type values that can be used when creating or updating Enterprise custom roles.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      parameters:
      - in: query
        name: org_id
        schema:
          type: string
        description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
      responses:
        '200':
          description: Successfully retrieved role permission options
          content:
            application/json:
              schema:
                type: object
                required:
                - resource_ids
                - access_types
                properties:
                  resource_ids:
                    type: array
                    items:
                      type: string
                    example:
                    - repository_management
                    - user_management
                    - role_management
                  access_types:
                    type: array
                    items:
                      type: string
                      enum:
                      - read
                      - write
                      - delete
                    example:
                    - read
                    - write
                    - delete
  /v1/roles/{roleId}:
    x-generated: true
    get:
      operationId: get-role
      summary: Get role details
      description: Retrieves one built-in or Enterprise custom role.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      - in: query
        name: org_id
        schema:
          type: string
        description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
      - in: query
        name: include_permissions
        schema:
          type: boolean
          default: true
      - in: query
        name: include_user_count
        schema:
          type: boolean
          default: true
      responses:
        '200':
          description: Successfully retrieved role
    patch:
      operationId: update-role
      summary: Update a custom role
      description: Updates custom role metadata, permissions, or default status. System roles are immutable. Omitting is_default preserves the current default status; true clears any previous default; false unsets this role as default.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                org_id:
                  type: string
                  description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
                name:
                  type: string
                description:
                  type:
                  - string
                  - 'null'
                is_default:
                  type: boolean
                permissions:
                  type: array
                  items:
                    type: object
                    properties:
                      resource_id:
                        type: string
                      access_type:
                        type: string
                        enum:
                        - read
                        - write
                        - delete
      responses:
        '200':
          description: Custom role updated
    delete:
      operationId: delete-role
      summary: Delete a custom role
      description: Deletes an Enterprise custom role when it is not assigned to any organization members. System roles cannot be deleted.
      tags:
      - Role Management
      security:
      - ApiKeyAuth: []
      parameters:
      - in: path
        name: roleId
        required: true
        schema:
          type: string
      - in: query
        name: org_id
        schema:
          type: string
        description: 'Required when authenticating with a workspace-scoped API token: the git-provider organization id to target within the token''s workspace. Ignored for organization and self-hosted keys.'
      responses:
        '204':
          description: Custom role deleted
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.
x-provenance:
  method: harvested
  publisher: CodeRabbit
  source: https://docs.coderabbit.ai/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)