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

# Delete Role

> Deletes an Enterprise custom role when it is not assigned to any organization members. System roles cannot be deleted.

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

## Delete Custom Role

Deletes an Enterprise custom role when it is not assigned to any organization members. System roles cannot be deleted.

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


## OpenAPI

````yaml delete /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}:
    delete:
      tags:
        - Role Management
      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.
      operationId: delete-role
      parameters:
        - in: path
          name: roleId
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Custom role deleted
      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.

````