GET
/
users
List
curl --request GET \
  --url https://{appid}.api-{region}.cometchat.io/v3/users \
  --header 'apikey: <api-key>'
{
  "data": [
    {
      "uid": "superhero6",
      "name": "Barry Allen",
      "link": "http://placehold.it",
      "avatar": "http://placehold.it/120x120&text=image1",
      "metadata": {
        "email": "user@email.com",
        "contactNumber": "0123456789"
      },
      "status": "offline",
      "role": "manager",
      "createdAt": 1638354015,
      "updatedAt": 1638354799,
      "conversationId": "superhero4_user_superhero6"
    },
    {
      "uid": "superhero2",
      "name": "Captain America",
      "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png",
      "status": "offline",
      "role": "default",
      "createdAt": 1629869270,
      "updatedAt": 1630308676,
      "conversationId": "superhero2_user_superhero4"
    },
    {
      "uid": "superhero3",
      "name": "Captain America",
      "link": "https://data-us.cometchat.io/assets",
      "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png",
      "metadata": {
        "contactNumber": "0123456789"
      },
      "status": "offline",
      "role": "default",
      "blockedByMe": true,
      "blockedByMeAt": 1638346853,
      "blockedAt": 1638346853,
      "createdAt": 1629869270,
      "updatedAt": 1638351060,
      "conversationId": "superhero3_user_superhero4"
    }
  ],
  "meta": {
    "pagination": {
      "total": 0,
      "count": 5,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 1
    }
  },
  "cursor": {
    "updatedAt": 1638354799,
    "affix": "prepend"
  }
}

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Query Parameters

searchKey
string

The searchKey query parameter work for both name and uid: It performs a LIKE% query, searching for uid/name values starting with the specified characters.

searchIn
enum<string>[]

Searches for specified keyword in name,UID or both.

status
enum<string>

User list can be fetched depending on the user status. (available,offline).

Available options:
available,
offline
count
boolean

Fetches users count.

perPage
integer
default:100

Number of users to be fetched in a request. The default value is 100 and the maximum value is 1000.

page
integer
default:1

Page Number.

role
string

Retrieves user list based on role.

withTags
boolean

Includes tags in the response.

tags
string[]

Fetches only those users that have these tags.

roles
string[]

Fetches users based on multiple roles.

onlyDeactivated
boolean

Fetches all the deactivated users of an app.

withDeactivated
boolean

Fetches all the users including deactivated users.

Response

200 - application/json

A list of users

The response is of type object.