---
title: "# Assign Role"
method: PUT
path: "/v1/users/{userId}/role"
tags: ["Users"]
---

# # Assign Role

`PUT /v1/users/{userId}/role`

Assign Role; User ID, Role ID

## Path parameters

- `userId` integer, required

## Request body

- object
  - `role_id` integer, required — Role ID to assign to the user

## Response `200`

- object
  - `success` boolean — Success status of the update operation

## Other responses

- `401` — unauthorizedErrorSwagger is represents unauthorized error
- `422` — validationErrorSwagger is represents the erroneous cases
- `default` — genericErrorSwagger is represents the erroneous cases

---

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