Assign a role to an user. Optionally, you can set this role to a room.
URL | Requires Auth | HTTP Method |
|
|
|
Argument | Example | Required | Description |
|
| Required | The role name. |
|
| Required | The user name. |
|
| Optional | If the role scope be Subscriptions and assign it to a room, you need to pass the roomId as parameter. |
curl -H "Content-type:application/json" \-H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \-H "X-User-Id: aobEdbYhXfu5hkeqG" \http://localhost:3000/api/v1/roles.addUserToRole \-d '{ "roleName": "guest" }' \-d '{ "username": "rocket.chat" }' \-d '{ "roomId": "dK7vNYXMdHGLdukpL" }' \
{"role": {"_id": "guest","name": "guest","scope": "Subscriptions","description": "","_updatedAt": "2018-08-23T03:57:54.603Z"},"success": true}
Version | Description |
0.70.0 | Added |