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

# Update Role

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

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 Custom Role

Updates custom role metadata, permissions, or default status. System roles are immutable.

When updating `is_default`: omitting it preserves the current default status, `true` sets this role as default (clearing any previous default), and `false` unsets this role as default.

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


## OpenAPI

````yaml patch /v1/roles/{roleId}
openapi: 3.0.3
info:
  title: CodeRabbit API spec
  version: 1.0.0
servers:
  - url: https://api.coderabbit.ai
security:
  - ApiKeyAuth: []
paths:
  /v1/roles/{roleId}:
    patch:
      tags:
        - Role Management
      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.
      operationId: update-role
      parameters:
        - in: path
          name: roleId
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                  nullable: true
                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
      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.

````