---
title: "Update user by ID"
method: PATCH
path: "/users/{id}"
tags: ["Users"]
---

# Update user by ID

`PATCH /users/{id}`

Updates user fields (name, surname, email, roleId, last_login).
Only provided fields are updated. Organization isolation enforced.
Sends Slack notification on role change. Sends email notification
when role changes from Editor (3) to Admin (1).

## Path parameters

- `id` integer, required

## Request body

- object — All fields are optional; only provided fields are updated
  - `name` string — First name
  - `surname` string — Last name
  - `email` string, email
  - `roleId` integer — New role ID (1=Admin, 2=Reviewer, 3=Editor, 4=Auditor). Can be sent as string.
  - `last_login` string, date-time — Override last login timestamp

## Response `202`

User updated

- object
  - `message` string
  - `data` UserSafe — User object with password_hash excluded
    - `id` integer, required
    - `name` string, required
    - `surname` string, required
    - `email` string, email, required
    - `role_id` integer, required — 1=Admin, 2=Reviewer, 3=Editor, 4=Auditor, 5=SuperAdmin
    - `created_at` string, date-time, required
    - `last_login` string, date-time
    - `updated_at` string, date-time
    - `is_demo` boolean
    - `organization_id` integer, nullable
    - `profile_photo_id` integer, nullable

## Other responses

- `400` — Validation error
- `403` — Access denied or business logic error
- `404` — User not found
- `500` — Internal server error

---

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