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

# Update a Role

`PATCH /v2/roles/{role_id}`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/roles/{role_id}`
- Auth: HTTP bearer

Updates a custom role's name, permissions, or visibility scope. System roles
cannot be modified.

## Path parameters

- `role_id` string, required

## Request body

- UpdateRoleRequest
  - `name` string, nullable
  - `permissions` string[], nullable
  - `data_visibility_scope` 'organization' | 'business_units' | 'assigned_only'
  - `work_visibility_scope` 'organization' | 'business_units' | 'assigned_only'

## Response `200`

Successful Response

- RoleSchema
  - `id` string, required
  - `slug` string, required
  - `name` string, required
  - `permissions` string[], required
  - `permissions_expanded` string[], required
  - `data_visibility_scope` 'organization' | 'business_units' | 'assigned_only', required
  - `work_visibility_scope` 'organization' | 'business_units' | 'assigned_only', required
  - `is_system` boolean, required
  - `active_member_count` integer, required
  - `deactivated_member_count` integer, required

## Other responses

- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable Content

---

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