---
title: "Update user role"
method: PUT
path: "/acc-api/users/{userId}"
tags: ["User"]
---

# Update user role

`PUT /acc-api/users/{userId}`

Updates a specific user's role. Only admin and superadmin users can modify roles. Users cannot modify their own role.

## Path parameters

- `userId` integer, required

## Request body

- UserUpdate — Only role modification is allowed. Requires admin or superadmin permissions.
  - `roleId` integer, required — Role ID (1: admin, 2: editor, 3: viewer, 4: superadmin)

## Response `200`

User role updated successfully

- User
  - `id` integer, required
  - `username` string, required
  - `role` 'admin' | 'editor' | 'viewer' | 'superadmin', required — User's role name
  - `profile` object, nullable
    - `firstName` string
    - `lastName` string
    - `email` string, email
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400` — Invalid request parameters or only role modification allowed
- `401` — Unauthorized
- `403` — Insufficient permissions or cannot modify own role
- `404` — User not found
- `500` — Internal server error

## Changes

- **2026-07-17** `c863d4c0adcd` — 1 breaking, 4 warning, 3 info
  - the request property `roleId` became required
  - removed the request property `password`
  - removed the request property `profile`
  - removed the request property `username`
  - …4 more
- **2025-06-18** `4e8707cf3e99` — 2 info
  - added the new optional request property `profile`
  - added the optional property `profile` to the response with the `200` status
- **2025-06-13** `1609c18b1e7f` — 1 warning, 7 info
  - removed the optional property `profile` from the response with the `200` status
  - added the new optional request property `password`
  - added the new optional request property `username`
  - the request property `roleId` became optional
  - …4 more

[Change history](https://skmtc.dev/nimtable/apis/nimtable-account-api/changes/acc-api/users/:userId/put.md)

---

[API](https://skmtc.dev/nimtable/apis/nimtable-account-api.md) · [All operations](https://skmtc.dev/nimtable/apis/nimtable-account-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nimtable/nimtable-account-api/revisions/c863d4c0adcd/schema)
