Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Latest commit

 

History

History
123 lines (111 loc) · 4.28 KB

File metadata and controls

123 lines (111 loc) · 4.28 KB

List users by Status

Returns a list of filtered users based on activation status, first-time log-in, and type of users to be returned. It requires the View Direct Messagesand View Outside Room permission.

HTTP MethodURLRequires Auth
GETapi/v1/users.listByStatusyes

Query Parameters

This endpoint supports the optional #pagination parameters.

KeyExample ValueDescription
statusactiveFilter users based on their activation status. It can either be active or deactivated
hasLoggedIntrueFilter the users who have logged into their accounts for the first time.
typeuserFilter the type of users to be returned. For example, 'bot', 'user', 'app', etc.
roles[]botFilter the users returned based on a list of roles.
searchTermtestFilter the list of users returned based on a search term

Example Call

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     http://localhost:3000/api/v1/users.listByStatus

Example Response

{
    "users": [
        {
            "_id": "W7MRNgkYLXKKAGNvW",
            "username": "agent1",
            "emails": [
                {
                    "address": "agent1@agent.com",
                    "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": "agent2@agent.com",
                    "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": "agent3@agent.com",
                    "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": "guy@guy.com",
                    "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
}

Change Log

VersionDescription
6.8.0Added