Skip to main content
Conversations provide the last message for every one-on-one and group conversation the logged-in user is part of. Each Conversation object includes the other participant (user or group), the last message, unread counts, and optional tags. Use this to build a Recent Chats list.

Retrieve List of Conversations

Use ConversationsRequest with ConversationsRequestBuilder to fetch conversations with various filters.

Set Limit

Set the number of conversations to fetch per request. Maximum is 50.

Set Conversation Type

Filter by conversation type: .user for one-on-one or .group for group conversations. If not set, both types are returned.

With User and Group Tags

Use withUserAndGroupTags(true) to include user/group tags in the response. Default is false.

Set User Tags

Fetch user conversations where the user has specific tags.

Set Group Tags

Fetch group conversations where the group has specific tags.

With Tags

Use withTags(true) to include conversation tags in the response. Default is false.

Set Tags

Fetch conversations that have specific tags.

Include Blocked Users

With Blocked Info

Search Conversations

Search conversations by user or group name.
Conversation & Advanced Search is available on Advanced and Custom plans. Enable it from the CometChat Dashboard under Chats → Settings → General Configuration.

Unread Conversations

Conversation & Advanced Search is available on Advanced and Custom plans. Enable it from the CometChat Dashboard under Chats → Settings → General Configuration.

Fetch Conversations

After configuring the builder, call build() to create the request, then fetchNext() to retrieve conversations. Call fetchNext() repeatedly on the same object to paginate.
The Conversation object consists of the following fields:

Tag Conversation

Use tagConversation() to add tags to a conversation.
Tags for conversations are one-way. If user A tags a conversation with user B, that tag applies only for user A.

Retrieve Single Conversation

Use getConversation() to fetch a specific conversation.

Convert Messages to Conversations

Use getConversationFromMessage() to convert a received message into a Conversation object. Useful for updating your Recent Chats list when receiving real-time messages.
When converting a message to a conversation, unreadMessageCount and tags won’t be available. Manage unread counts in your client-side code.

Next Steps

Delete Conversation

Remove conversations from the logged-in user’s list

Receive Messages

Listen for incoming messages to update conversation lists in real time

Typing Indicators

Show real-time typing status in conversations

Delivery & Read Receipts

Track message delivery and read status per conversation