---
title: "Assign a Role to a User"
method: POST
path: "/accountmanager.assignrole/{userId}"
tags: ["User Admin"]
---

# Assign a Role to a User

`POST /accountmanager.assignrole/{userId}`

Assigns a role to a user.

## Request body

- object
  - `data` object, required
    - `assign` boolean, required — Set to `true` to assign the user to the role. Set `false` to remove the role from the user.
    - `typedId` string, required — `TypedId` of the role you want to assign or revoke. Either `typedId` or `uniqeName` is required.
    - `uniqueName` string, required — `uniqueName` of the role you want to assign or revoke. Either `typedId` or `uniqeName` is required.

## Response `200`

OK

- object
  - `response` object
    - `node` string
    - `data` unknown
    - `status` number

---

[API](https://skmtc.net/pricefx/apis/the-pricefx-backend-api.md) · [All operations](https://skmtc.net/pricefx/apis/the-pricefx-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pricefx/the-pricefx-backend-api/versions/0850b5d6be73/schema)
