---
title: "Update User Assignment"
method: PATCH
path: "/rbac/user-assignments/{assignment_id}"
tags: ["rbac"]
---

# Update User Assignment

`PATCH /rbac/user-assignments/{assignment_id}`

## Request

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

Update a user role assignment (change role).

Requires: org:rbac:update scope

## Path parameters

- `assignment_id` string, uuid, required

## Request body

- UserRoleAssignmentUpdate: Update schema for a user role assignment (change role only).
  - `role_id` string, uuid, required: New role ID to assign

## Response `200`

Successful Response

- UserRoleAssignmentReadWithDetails: Read schema for a user role assignment with user and role details.
  - `id` string, uuid, required
  - `organization_id` string, uuid, required
  - `user_id` string, uuid, required
  - `workspace_id` string, uuid, nullable
  - `role_id` string, uuid, required
  - `assigned_at` string, date-time, required
  - `assigned_by` string, uuid, nullable
  - `user_email` string, required
  - `role_name` string, required
  - `workspace_name` string, nullable

## Other responses

- `400`: Organization role assigned on a workspace.
- `404`: Assignment or role not found.
- `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)
