List Users by Status
    • Dark
      Light
    • PDF

    List Users by Status

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/users.listByStatus

    Returns a list of filtered users based on activation status, first-time log-in, and type of users to be returned. Permissions required:

    • view-d-room
    • view-outside-room

    Changelog

    VersionDescription
    6.8.0Added
    Header parameters
    X-Auth-Token
    stringRequired

    The authenticated user token.

    ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
    X-User-Id
    stringRequired

    The authenticated user ID.

    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
    sort

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

    count
    integer

    How many items to return.

    Example50
    status
    string

    Filter users based on their activation status. It can either be active or deactivated

    Exampleactive
    hasLoggedIn
    boolean

    Filter the users who have logged into their accounts for the first time.

    ExampleTrue
    type
    string

    Filter the type of users to be returned. For example, 'bot', 'user', 'app', etc.

    Exampleuser
    roles[]
    string

    Filter the users returned based on a list of roles.

    Examplebot
    searchTerm
    string

    Filter the list of users returned based on a search term

    Exampletest
    Responses
    200

    OK

    Success
    {
      "users": [
        {
          "_id": "W7MRNgkYLXKKAGNvW",
          "username": "agent1",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "type": "user",
          "roles": [
            "user",
            "livechat-agent"
          ],
          "status": "offline",
          "active": true,
          "name": "Agent 1",
          "lastLogin": "2024-04-24T17:47:50.485Z"
        },
        {
          "_id": "Tf44Q5AaYDehtJLzA",
          "username": "agent2",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "type": "user",
          "roles": [
            "user",
            "livechat-agent"
          ],
          "status": "offline",
          "active": true,
          "name": "Agent 2",
          "lastLogin": "2024-04-29T16:38:56.809Z"
        },
        {
          "_id": "JwATAtGzrzHYHCXFy",
          "username": "agent3",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "type": "user",
          "roles": [
            "user",
            "livechat-agent"
          ],
          "status": "online",
          "active": true,
          "name": "Agent3",
          "lastLogin": "2024-04-30T16:59:21.879Z"
        },
        {
          "_id": "u6C62WdHKNk5X8Rzr",
          "username": "guy",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "type": "user",
          "roles": [
            "user"
          ],
          "status": "offline",
          "active": true,
          "name": "guy"
        },
        {
          "_id": "rocket.cat",
          "name": "Rocket.Cat",
          "username": "rocket.cat",
          "status": "online",
          "active": true,
          "type": "bot",
          "roles": [
            "bot"
          ],
          "avatarETag": "MEhPLkenJqs3jTJP5"
        }
      ],
      "count": 5,
      "offset": 0,
      "total": 5,
      "success": true
    }
    Expand All
    object
    users
    Array of object
    object
    _id
    string
    username
    string
    emails
    Array of object
    object
    address
    string
    verified
    boolean
    type
    string
    roles
    Array of string
    string
    status
    string
    active
    boolean
    name
    string
    lastLogin
    string
    avatarETag
    string
    count
    integer
    offset
    integer
    total
    integer
    success
    boolean

    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.