Get room members ordered by their roles. This endpoint sorts the members according to their role in the room in the order Owners > Moderators > all other members. This can be reversed using the query paramter sort={"rolePriority":-1}. You need not be a member of the room.
If the room is a broadcast room, you need the view-broadcast-member-list permission to view the room members.
Changelog
| Version | Description |
|---|---|
| 7.3.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
Enter the room ID.
Instead of using the room ID, you can enter the room name.
Filter the results by using the text that you want to view.
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Sort the rooms in ascending (1) or descending (-1) order. The value must be entered as a JSON string. The options are as follows:
rolePriority: Sort by priority of role (Owners>Moderators> all other members). For example,sort={"rolePriority":-1}username: Sort by usernames. For example,sort={"username":-1}
Enter the user status for which you want the results. For example, online, away, offline.
OK
{
"members": [
{
"_id": "C38WSSzrGd2NCjzqJ",
"username": "test.cat",
"status": "online",
"_updatedAt": "2025-01-22T07:49:47.830Z",
"name": "test.cat",
"roles": [
"owner"
]
},
{
"_id": "P2dgWPPw5veigwcdK",
"status": "offline",
"_updatedAt": "2025-01-22T07:13:19.734Z",
"name": "Fun Smith",
"username": "fun.smith",
"roles": [
"moderator"
]
},
{
"_id": "CNmyTxexxauJ4wrTW",
"username": "agent1",
"status": "offline",
"_updatedAt": "2025-01-22T07:32:57.238Z",
"name": "agent1"
},
{
"_id": "FSA63o85Poa2EQvAH",
"status": "offline",
"name": "cat kate",
"username": "cat.kate",
"_updatedAt": "2025-01-22T08:04:12.251Z",
"roles": [
"leader"
]
}
],
"count": 4,
"offset": 0,
"total": 4,
"success": true
}Bad Request
{
"success": false,
"error": "must have required property 'roomId'\n must have required property 'roomName'\n must match exactly one schema in oneOf [invalid-params]",
"errorType": "invalid-params"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}