Remove a role from a user. Optionally, you can remove this role from a specified scope.
HTTP Method | URL | Requires Auth |
---|---|---|
POST | /api/v1/roles.removeUserFromRole | yes |
{% hint style="info" %}
Permission required: access-permissions
{% endhint %}
Key | Example Value | Description |
---|---|---|
roleName * | guest | The role name. |
username * | rocket.chat | The user name. |
roomId | dK7vNYXMdHGLdukpL | The scope where the role should be removed from. |
curl -H "Content-type:application/json" \
-H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/roles.removeUserFromRole \
-d '{ "roleName": "guest" }' \
-d '{ "username": "rocket.chat" }' \
{
"success": true
}