Links

Role Get Users In Role

Gets the users that belongs to a role. It supports only the offset and count parameter for Pagination.
URL
Requires Auth
HTTP Method
/api/v1/roles.getUsersInRole
yes
GET

Query Parameters

Argument
Example
Required
Description
role
admin
Required
The role.
roomId
GENERAL
Optional
The room's id.

Example call to get all the roles

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
http://localhost:3000/api/v1/roles.getUsersInRole

Example Result

{
"users": [
{
"_id": "voakrL3cHjYBwwRPq",
"username": "a",
"type": "user",
"status": "offline",
"active": true,
"name": "a"
},
{
"_id": "N2s7KG6YkzgJfXbyn",
"username": "b",
"type": "user",
"status": "offline",
"active": true,
"name": "b"
},
],
"success": true
}

Change Log

Version
Description
1.3.0
Added
Last modified 5mo ago
Deprecation for cloud services and apps is now extended to November 20, 2023. Rocket.Chat versions receive support for six months after release.