---
title: "Update a user"
method: PATCH
path: "/v2/organisations/{organisation_id}/users/{user_id}"
tags: ["Gateway GRPC"]
---

# Update a user

`PATCH /v2/organisations/{organisation_id}/users/{user_id}`

## Request

- Base URL: `https://api.cautio.in` (the document declares no server; this is the origin it was published from)
- URL: `https://api.cautio.in/v2/organisations/{organisation_id}/users/{user_id}`
- Auth: HTTP bearer

## Path parameters

- `organisation_id` string, required
- `user_id` string, required

## Request body

- UpdateUserDto
  - `first_name` string: User's first name
  - `last_name` string: User's last name
  - `assignments` RoleAssignmentDto[]: List of role assignments
    - `role_id` string, required: Role id
    - `contexts` AssignmentContextDto[], required: Contexts for the role assignment
      - `organisation_id` string, required: Organisation id
      - `resource_type` 'VEHICLE': Resource Type
      - `resource_ids` string[]: Resource IDs
      - `applies_to_descendants` boolean
      - `organisation_name` string
      - `exclude_children` boolean: Exclude children from assignment expansion
  - `auto_assign` boolean: Enable auto-assign for roles

## Response `200`

Updated user details

- UserResponseDto
  - `id` string, required: User ID
  - `email` string, required: User Email
  - `first_name` string, required: User First Name
  - `last_name` string, required: User Last Name
  - `username` string, required: User Username
  - `organisation_id` string, required: Organisation ID
  - `roles` RoleDto[], required: User Roles
    - `id` string, required: Role ID
    - `name` string, required: Role Name

---

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