Group Members By Highest Role
    • Dark
      Light
    • PDF

    Group Members By Highest Role

    • Dark
      Light
    • PDF

    Article summary

    Get
    /groups.membersByHighestRole

    Lists the participants of a group/channel sorted by their room-scoped roles.

    Room members are sorted by their most important role in the room. The following hierarchy is used: Owner > Moderator > Other roles. The information related to each user's highest role is returned in the highestRole object within each of them.

    The highestRole object contains a numeric level field, which ranges from 0 to 2

    • Level 0 stands for room owners.
    • Level 1 is assigned to moderators (who are not room owners).
    • Level 2 is assigned to all other team members regardless of their room-scoped roles.

    The highestRole object also contains a role field, which has three possible values: owner, moderator or member, which are assigned to levels 0, 1, and 2, respectively.

    Requires view-broadcast-member-list if the room is a broadcast.

    Changelog

    VersionDescription
    6.5.0Added
    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
    offset
    integer

    Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items.

    Example50
    count
    integer

    The number of items to return.

    Example50
    sort

    List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}

    roomId
    string

    The room id. It is required if the roomName is not provided.

    Exampledlpfuijw7ej
    roomName
    string

    The room name. It is required if the roomId is not provided.

    Examplegeneral
    status
    array of string

    The user's status (search filter).

    Example["online", "away"]
    filter
    string

    Extra search filters to be applied to the fields defined in the Accounts_SearchFields setting.

    Responses
    200

    OK

    Succcess
    {
      "members": [
        {
          "_id": "JmR3T4TFfppJCfmq9",
          "status": "offline",
          "_updatedAt": "2023-07-20T20:43:05.895Z",
          "name": "Matheus Barbosa Silva",
          "statusConnection": "offline",
          "username": "matheus.barbosa",
          "avatarETag": "fdJn5SqCwg4ZwbywD",
          "highestRole": {
            "role": "owner",
            "level": 0
          }
        },
        {
          "_id": "edjvbnb7pGC3MZNSP",
          "status": "offline",
          "_updatedAt": "2023-07-17T21:42:31.845Z",
          "username": "john",
          "name": "John",
          "statusConnection": "offline",
          "highestRole": {
            "role": "member",
            "level": 2
          }
        }
      ],
      "count": 2,
      "offset": 0,
      "total": 2,
      "success": true
    }
    Expand All
    object
    members
    Array of object
    object
    _id
    string
    status
    string
    _updatedAt
    string
    name
    string
    statusConnection
    string
    username
    string
    avatarETag
    string
    highestRole
    object
    role
    string
    level
    integer
    count
    integer
    offset
    integer
    total
    integer
    success
    boolean
    401

    Unauthorized

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

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.