---
title: "Assign roles"
method: POST
path: "/roles/assign"
tags: ["Roles"]
---

# Assign roles

`POST /roles/assign`

Assigns the specified roles to a user. This will replace any existing role assignments for the user.

## Request body

- object
  - `userId` string, required
  - `roles` number[], required

## Response `200`

Roles successfully assigned

## Other responses

- `201`
- `400` — Bad request — invalid user ID or role IDs

---

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