Links
Comment on page

Role Remove

Remove a role from a user. Optionally, you can unset this role for a specified scope.
URL
Requires Auth
HTTP Method
/api/v1/roles.removeUserFromRole
yes
POST

Payload

Argument
Example
Required
Description
roleName
guest
Required
The role name
username
rocket.chat
Required
The user name
roomId
dK7vNYXMdHGLdukpL
Optional
The scope where the role should be unset

Example call to get all the roles after a given date

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" }' \

Example Result

{
"success": true
}
Last modified 1yr ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.