Get Room Roles

Prev Next
Get
/api/v1/rooms.roles

Get the list of roles in a specific room. This endpoint returns users with the Owner, Leader, and Moderator room roles. You can refer to the Roles user guide for more details on roles in Rocket.Chat.

Changelog

Version Description
7.10.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
rid
stringRequired

Enter the room ID for which you want to view the room roles.

Example658282732dd9f928ad989e98
Responses
200

OK

Example 1
{
  "roles": [
    {
      "_id": "668c75b2b319fc80bf0ed3a1",
      "rid": "658282732dd9f928ad989e98",
      "u": {
        "_id": "P2dgWPPw5veigwcdK",
        "username": "jane.doe",
        "name": "Jane Doe"
      },
      "roles": [
        "moderator"
      ]
    },
    {
      "_id": "6819edfa30c9c71254e45d18",
      "rid": "658282732dd9f928ad989e98",
      "u": {
        "_id": "74HrDgvTTxT56o8R8",
        "username": "mary.shelley",
        "name": "Mary Shelley"
      },
      "roles": [
        "leader"
      ]
    },
    {
      "_id": "668c7717b319fc80bf0ed3b0",
      "rid": "658282732dd9f928ad989e98",
      "u": {
        "_id": "qHWhoJwwgk4bwcoNq",
        "username": "test.user"
      },
      "roles": [
        "moderator"
      ]
    },
    {
      "_id": "6690c37ab319fc80bf0ed407",
      "rid": "658282732dd9f928ad989e98",
      "u": {
        "_id": "C38WSSzrGd2NCjzqJ",
        "username": "test.cat"
      },
      "roles": [
        "owner"
      ]
    }
  ],
  "success": true
}
Expand All
object
roles
Array of object
object
_id
string
rid
string
u
object
_id
string
username
string
name
string
roles
Array of string
string
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "errorType": "error-invalid-params",
  "error": "must have required property 'rid'"
}
object
success
boolean
errorType
string
error
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string