Skip to content

Give a person a role

Request

Assigns one person the role named in the URL. A 201 carries no body - read the role's members afterwards if you need the resulting record.

A person may hold only one role per account. Naming someone who already holds one is refused with a 400 and a message saying so, and the way to move them is to remove the existing assignment first. A 400 is also what you get when user_id is missing altogether.

The person has to belong to the same account as the role, and an administrator cannot assign a role to themselves.

Security
default
Path
role_idintegerrequired

The ID of the role.

Headers
Rosterfy-Platformstring
Bodyapplication/jsonrequired
user_idintegerrequired

The person to give the role to.

curl -i -X POST \
  'https://developer.rosterfy.com/_mock/api-docs/openapi/api/v2/account/role/{role_id}/user' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'Rosterfy-Platform: admin' \
  -d '{
    "user_id": 23453473
  }'

Responses

Bodyapplication/json
object
Response
{}