Skip to content

Give a role to many people

Request

Queues the work of assigning a set of people the role named in the URL and returns a token for the queued job. Nothing is assigned by the time the response comes back, and the token is not something you can poll - confirm the outcome by listing the role's members.

Send the fields as form fields or in the query string, not as a JSON body. selected is read from the query and form data only, so a request carrying it as JSON comes back as a 404 with nothing assigned.

A request whose fields are the right shape always returns a queue token, whether or not the background work then succeeds: someone who belongs to another account, already holds a role here, or would exceed the account's administrator limit is skipped rather than reported.

Security
default
Path
role_idintegerrequired

The ID of the role.

Headers
Rosterfy-Platformstring
Bodyapplication/jsonrequired
applyTostringrequired

Must be sent, with the value selected. This endpoint only ever adds the people named in selected; no other value changes what it does.

selectedArray of integersrequired

The people to add, as a list of user ids. A person who cannot be given the role - because they belong to a different account, or already hold a role in this one - is skipped rather than reported.

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

Responses

Bodyapplication/json
queuestring
Response
{ "queue": "mTsVQ1NCLS3vg7WwP5kG1Vbt" }