---
title: "Update Role"
method: PATCH
path: "/rbac/roles/{role_id}"
tags: ["rbac"]
---

# Update Role

`PATCH /rbac/roles/{role_id}`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/rbac/roles/{role_id}`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Update a role.

Requires: org:rbac:update scope

## Path parameters

- `role_id` string, uuid, required

## Request body

- RoleUpdate: Update schema for a role.
  - `name` string, nullable: Role name
  - `description` string, nullable: Optional description of the role
  - `scope_ids` string[], nullable: List of scope IDs to assign to the role (replaces existing)

## Response `200`

Successful Response

- RoleReadWithScopes: Read schema for a role with its scopes.
  - `id` string, uuid, required
  - `name` string, required
  - `slug` string, nullable
  - `description` string, nullable
  - `organization_id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `created_by` string, uuid, nullable
  - `scopes` ScopeRead[]
    - `id` string, uuid, required
    - `name` string, required
    - `resource` string, required
    - `action` string, required
    - `description` string, nullable
    - `source` 'platform' | 'custom', required: Source/ownership of a scope definition.
    - `source_ref` string, nullable
    - `organization_id` string, uuid, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `is_system` boolean, required: Whether this is a preset system role.

## Other responses

- `403`: System role scopes cannot change.
- `404`: Role not found.
- `409`: Duplicate name, or a level switch while the role is in use.
- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
