GET
/
conversations
List conversations
curl --request GET \
  --url https://{appid}.api-{region}.cometchat.io/v3/conversations \
  --header 'apikey: <api-key>'
{
  "data": [
    {
      "conversationId": "group_project-group",
      "conversationType": "group",
      "unreadMessageCount": "0",
      "createdAt": 1630071782,
      "updatedAt": 1630481413,
      "lastMessage": {
        "id": "50",
        "conversationId": "group_project-group",
        "sender": "superhero4",
        "receiverType": "group",
        "receiver": "project-group",
        "category": "action",
        "type": "groupMember",
        "data": {
          "action": "unbanned",
          "entities": {
            "by": {
              "entity": {
                "uid": "superhero4",
                "name": "Wolverine",
                "role": "default",
                "avatar": "https://data-us.cometchat.io/assets/images/avatars/wolverine.png",
                "status": "offline",
                "createdAt": 1629869270
              },
              "entityType": "user"
            },
            "on": {
              "entity": {
                "uid": "superhero3",
                "link": "https://data-us.cometchat.io/assets",
                "name": "Captain America",
                "role": "default",
                "avatar": "https://data-us.cometchat.io/assets/images/avatars/captainamerica.png",
                "status": "offline",
                "createdAt": 1629869270,
                "updatedAt": 1629964825,
                "conversationId": "superhero3_user_superhero4"
              },
              "entityType": "user"
            },
            "for": {
              "entity": {
                "guid": "project-group",
                "icon": "http://placehold.it/120x120&text=image1",
                "name": "Project Group1",
                "type": "private",
                "owner": "superhero4",
                "createdAt": 1630071341,
                "updatedAt": 1630305525,
                "updatedBy": "superhero4",
                "description": "project related discussions between members",
                "membersCount": 4,
                "conversationId": "group_project-group"
              },
              "entityType": "group"
            }
          }
        },
        "sentAt": 1630305562,
        "updatedAt": 1630305562,
        "receipts": {
          "data": [
            []
          ]
        }
      },
      "conversationWith": {
        "guid": "project-group",
        "name": "Project Group1",
        "description": "project related discussions between members",
        "icon": "http://placehold.it/120x120&text=image1",
        "type": "private",
        "scope": "participant",
        "membersCount": 4,
        "joinedAt": 1630071782,
        "conversationId": "group_project-group",
        "hasJoined": true,
        "createdAt": 1630071341,
        "owner": "superhero4",
        "updatedAt": 1630308875,
        "updatedBy": "superhero4"
      }
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 100,
      "current_page": 1,
      "total_pages": 1
    }
  }
}

Authorizations

apikey
string
header
required

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

Headers

onBehalfOf
string

UID of the user on whose behalf the action is performed.

If onBehalfOf header is not passed,then list Conversations API will be ordered based on uid, updatedAt and then conversationWith

If onBehalfOf header is passed, then list Conversations API will be ordered based on updatedAt and then conversationWith.

Query Parameters

searchKey
string

Fetches conversations that include the specified searchKey, allowing you to search for conversations based on the name of a User or Group.

conversationType
string

Retrieves only the specified conversation type (user and group) while fetching conversations list.

withTags
boolean

Includes those groups that have tags.

tags
string[]

Fetches only those groups that have these tags.

withUserAndGroupTags
boolean

Retrieves conversations with tags

userTags
string[]

Filters conversations by tags associated with the user entity in the conversationWith property.

groupTags
string[]

Filters conversations by tags associated with the group entity in the conversationWith property.

unread
boolean

Lists only unread conversations by excluding the conversations with conversation.unreadMessageCount=0

perPage
integer
default:100

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

page
integer
default:1

Page number.

Response

200 - application/json

Get Conversations

The response is of type object.