---
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}`

## Request

- Base URL: `https://companynode.pricefx.com/pricefx/companypartition`
- URL: `https://companynode.pricefx.com/pricefx/companypartition/accountmanager.assignrole/{userId}`
- Auth: one of:
  - HTTP basic
  - API key in header `X-PriceFx-jwt`
- TypeScript: <https://skmtc.dev/pricefx/apis/the-pricefx-backend-api/docs/accountmanager.assignrole/:userId/post.ts> (a function with typed inputs; its response is checked against the schema)

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.dev/pricefx/apis/the-pricefx-backend-api.md) - [All operations](https://skmtc.dev/pricefx/apis/the-pricefx-backend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pricefx/apis/the-pricefx-backend-api/revisions/23d941b00ac0?raw)
