---
title: "Update a user"
method: PATCH
path: "/users/{user_id}"
tags: ["User"]
---

# Update a user

`PATCH /users/{user_id}`

Update a user's profile, role, tenant, or email; password changes are restricted.

## Path parameters

- `user_id` integer, required — ID of the user to update.

## Query parameters

- `cookie_name` string, nullable

## Request body

- UserUpdateIn
  - `first_name` string, nullable — New given name.
  - `last_name` string, nullable — New family name.
  - `email` string, email, nullable — New email address; triggers a confirmation flow.
  - `password` string, nullable — New password; cannot be set for your own account here.
  - `admin` boolean, nullable — Whether the user has tenant administrator privileges.
  - `superadmin` boolean, nullable — Whether the user is a platform operator; requires superadmin to change.
  - `tenant_id` integer, nullable — Move the user to this tenant; requires appropriate privileges.

## Response `200`

Successful Response

- UserOut
  - `id` integer, required — Unique identifier of the user.
  - `created_at` string, date-time, required — UTC timestamp when the user was created.
  - `email` string, email, required — Current confirmed email address.
  - `email_confirmed` boolean, required — Whether the email address has been confirmed.
  - `pending_email` string, nullable — New email awaiting confirmation, or null if none pending.
  - `name` string, nullable — Full display name, if set.
  - `first_name` string, nullable — User's given name.
  - `last_name` string, nullable — User's family name.
  - `admin` boolean, required — Whether the user has tenant administrator privileges.
  - `superadmin` boolean, nullable — Whether the user is a platform operator.
  - `active` boolean, required — Whether the account is active and can authenticate.
  - `tenant_id` integer, nullable — Identifier of the tenant the user belongs to.

## Other responses

- `401` — Missing or invalid authentication.
- `403` — Insufficient privileges to change the requested fields or tenant.
- `404` — No user exists with the given id.
- `422` — Validation Error

---

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