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

# POST /v1/users/{userId}/roles

`POST /v1/users/{userId}/roles`

Create user roles.

## Path parameters

- `userId` string, uuid, required

## Request body

- object
  - `role` 'ADMIN' | 'ASSESSMENT' | 'ACCESSOR' | 'QUALIFYING_ACCESSOR', required — Role of the user.
  - `organisationId` string, uuid, required — Id of the organisation.
  - `unitIds` string[], required — Ids of the organisation units.

## Response `201`

The created roles.

- object[]
  - `id` string, uuid, required — The role id.

## Other responses

- `400` — The request is invalid.
- `401` — The user is not authenticated.
- `403` — The user is not authorized to access this resource.
- `500` — An error occurred while processing the request.

## Changes

- **2024-11-07** `bf0b42ebdc02` — 1 info
  - the response property `items/id` became required for the status `201`
- **2023-08-22** `2b43f8cf5d91` — 1 breaking, 1 warning, 1 info
  - added the new required request property `role`
  - removed the request property `roles`
  - added `subschema #1` to the request body `oneOf` list
- **2023-08-14** `355cfd2329c1` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/nhs/apis/admin-api-nhs-innovation-service/changes/v1/users/:userId/roles/post.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)
