Get Users of a Role
    • Dark
      Light
    • PDF

    Get Users of a Role

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/roles.getUsersInRole

    Gets the users that belong to a specific role.

    Changelog

    VersionDescription
    1.3.0Added
    Header parameters
    X-User-Id
    stringRequired

    The authenticated user ID.

    ExamplerbAXPnMktTFbNpwtJ
    X-Auth-Token
    stringRequired

    The authenticated user token.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    Query parameters
    role
    stringRequired

    The role name or the role ID. For custom roles, use the role ID.

    Example653ec9873c7460e18e6f
    roomId
    string

    The room ID.

    Examplehfiec783ifjl
    offset
    integer

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

    Example50
    count
    integer

    How many items to return.

    Example50
    Responses
    200

    OK

    Success Example
    {
      "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
    }
    Expand All
    object
    users
    Array of object
    object
    _id
    string
    username
    string
    type
    string
    status
    string
    active
    boolean
    name
    string
    success
    boolean
    400

    Bad Request

    Example 1
    {
      "success": false,
      "error": "Query param \"role\" is required [error-param-not-provided]",
      "errorType": "error-param-not-provided"
    }
    Example 2
    {
      "success": false,
      "error": "[error-invalid-roleId]",
      "errorType": "error-invalid-roleId"
    }
    object
    success
    boolean
    error
    string
    errorType
    string
    401

    Unauthorized

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

    Was this article helpful?

    What's Next
    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.