---
title: "Update a user"
method: PUT
path: "/users/{id}"
tags: ["users"]
---

# Update a user

`PUT /users/{id}`

Update user details. A regular user account can only update his details.
A regular user account cannot change their username or role.
**Access policy**: authenticated

## Path parameters

- `id` integer, required

## Request body

- UsersUserUpdatePayload
  - `NewPassword` string, required
  - `Password` string, required
  - `Role` 1 | 2, required — User role (1 for administrator account and 2 for regular account)
  - `Theme` UsersThemePayload
    - `color` 'dark' | 'light' | 'highcontrast' | 'auto' — Color represents the color theme of the UI
  - `UseCache` boolean, required
  - `Username` string, required

## Response `200`

Success

- PortainerUser
  - `Id` integer, required — User Identifier
  - `Role` 0 | 1 | 2, required
  - `ThemeSettings` PortainerUserThemeSettings
    - `color` 'dark' | 'light' | 'highcontrast' | 'auto' | '' — Color represents the color theme of the UI
  - `TokenIssueAt` integer
  - `UseCache` boolean
  - `Username` string, required

## Other responses

- `400` — Invalid request
- `403` — Permission denied
- `404` — User not found
- `409` — Username already exist
- `500` — Server error

---

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