---
title: "PATCH /v1/users/{userId}"
method: PATCH
path: "/v1/users/{userId}"
---

# PATCH /v1/users/{userId}

`PATCH /v1/users/{userId}`

Update a user.

## Path parameters

- `userId` string, uuid, required — Id of the user to lock.

## Request body

- object
  - `accountEnabled` boolean — Activate or inactivate the user.
  - `role` object
    - `name` 'ACCESSOR' | 'QUALIFYING_ACCESSOR', required — Name of the role.
    - `organisationId` string, uuid, required — Id of the organisation.
  - `email` string, email — Email of the user.

## Response `200`

The user has been updated.

- object
  - `id` string, uuid, required

## Other responses

- `400` — Bad request.
- `401` — The user is not authorized to lock a user.
- `404` — The user does not exist.
- `500` — An error occurred while locking a user.

## Changes

- **2024-11-07** `bf0b42ebdc02` — 1 warning, 1 info
  - removed the optional property `userId` from the response with the `200` status
  - added the required property `id` to the response with the `200` status
- **2023-12-28** `3cf60c4d5e18` — 1 info
  - added the new optional request property `email`
- **2023-02-17** `e1476325d401` — 2 breaking, 2 warning
  - the request property `accountEnabled` became not nullable
  - the request property `role` became not nullable
  - deleted the `query` request parameter `code`
  - deleted the `query` request parameter `id`

[Change history](https://skmtc.dev/nhs/apis/admin-api-nhs-innovation-service/changes/v1/users/:userId/patch.md)

---

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