---
title: "Create a custom role"
method: POST
path: "/v1/roles"
tags: ["Role Management"]
---

# Create a custom role

`POST /v1/roles`

Creates an Enterprise custom role. If is_default is true, the new role becomes the subscription default and the previous default is cleared.

## Request body

- object
  - `org_id` string — 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` string, required
  - `description` string
  - `is_default` boolean
  - `duplicate_from` string — Role ID to copy permissions from. Defaults to cr_member when permissions are omitted.
  - `permissions` object[]
    - `resource_id` string
    - `access_type` 'read' | 'write' | 'delete'

## Response `201`

Custom role created

---

[API](https://skmtc.net/coderabbit/apis/coderabbit-api-spec.md) · [All operations](https://skmtc.net/coderabbit/apis/coderabbit-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coderabbit/coderabbit-api-spec/versions/401789d85d01/schema)
