---
title: "Update a custom role"
method: PATCH
path: "/v1/roles/{roleId}"
tags: ["Roles"]
---

# Update a custom role

`PATCH /v1/roles/{roleId}`

Update a custom role in Comp AI. Create custom roles and resolve permission sets for organization-level access control.

## Path parameters

- `roleId` string, required

## Request body

- UpdateRoleDto
  - `name` string — New name for the custom role
  - `permissions` object — Updated permissions for the role. Keys are resource names, values are arrays of allowed actions.
  - `obligations` object — Updated obligations for the role.

## Response `200`

Role updated successfully

- object
  - `id` string
  - `name` string
  - `permissions` object
  - `isBuiltIn` boolean
  - `createdAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `400` — Invalid role data
- `401` — Unauthorized
- `403` — Forbidden - cannot grant permissions you do not have
- `404` — Role not found

---

[API](https://skmtc.net/trycompai/apis/comp-ai-api.md) · [All operations](https://skmtc.net/trycompai/apis/comp-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/trycompai/comp-ai-api/versions/726b9523fb22/schema)
