Update User role

Update a user role and, optionally, the set of users assigned to it. Send the role id in the path.

When to use. Rename a role, change its level or two-factor type, or reassign which users belong to it.

Request body. Send only the fields you want to change.

  • name (string): Role name.
  • level (integer): Role level.
  • twofa_type (string): Two-factor authentication type for the role.
  • userIds (array of integers): The complete set of user IDs that should belong to the role. The assignment is rewritten to match this list: users not in it are removed and new ones are added. Omit it to leave the current assignments unchanged.

Returns. { "role": <role> }, the updated role including its current userIds. Returns 404 if the role does not exist.

Example.

PUT /api/roles/9

{ "name": "Team lead", "level": 900, "twofa_type": "default", "userIds": [1, 2, 3] }

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required

Role ID.

Body Params
string

Role name.

integer

Role level.

string

Role two-factor authentication type.

userIds
array of integers

IDs of the users to assign to this role.

userIds
Responses

Language
Credentials
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json