Skip to main content
Conversations provide the last messages for every one-on-one and group conversation the logged-in user is a part of. This makes it easy for you to build a Recent Chat list.

Retrieve List of Conversations

Use ConversationsRequestBuilder to configure filters, then call fetchNext() to retrieve up to 50 conversations per request.

Set Limit

Set the number of conversations to fetch per request.

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.
This method fetches group conversations that have the specified tags.

With Tags

Use withTags(true) to include conversation tags in the response. Default is false. When withTags(true) is set, each conversation’s tags field will be populated. Access tags using getTags().

Set Tags

Fetch conversations that have specific tags.

Include Blocked Users

Use includeBlockedUsers(true) to include conversations with users you’ve blocked.

With Blocked Info

Use withBlockedInfo(true) to include blocked user information in the response.

Search Conversations

Use setSearchKeyword() to search conversations by user or group name.
This feature is only available with Conversation & Advanced Search. The Conversation & Advanced Search is only available in Advanced & Custom plans. If you’re already on one of these plans, please enable the Conversation & Advanced Search from CometChat Dashboard (Open your app, navigate to Chats -> Settings -> General Configuration)

Unread Conversations

Use setUnread(true) to fetch only conversations with unread messages.
This feature is only available with Conversation & Advanced Search. The Conversation & Advanced Search is only available in Advanced & Custom plans. If you’re already on one of these plans, please enable the Conversation & Advanced Search from CometChat Dashboard (Open your app, navigate to Chats -> Settings -> General Configuration)

Hide Agentic Conversations

Use hideAgentic(true) to exclude AI agent conversations from the list.

Only Agentic Conversations

Use onlyAgentic(true) to fetch only AI agent conversations.
hideAgentic() and onlyAgentic() are mutually exclusive — use only one per request.

Fetch Conversations

After configuring the builder, call build() to create the request, then fetchNext() to retrieve conversations. Maximum 50 per request. 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.
The tags for conversations are one-way. This means that if user A tags a conversation with user B, that tag will be applied to that conversation only for user A.

Retrieve Single Conversation

Use getConversation() to fetch a specific Conversation.

Convert Messages to Conversations

Use CometChatHelper.getConversationFromMessage() to convert a received message into a Conversation object. Useful for updating your Recent Chats list when receiving real-time messages.
While converting a Message object to a Conversation object, the unreadMessageCount & tags will not be available in the Conversation object. The unread message count needs to be managed in your client-side code.

Conversation Payload Structure

The Conversation object returned by SDK methods contains the following fields:Sample Conversation Object:
When conversationType is "user", the conversationWith field contains a User object:
When conversationType is "group", the conversationWith field contains a Group object:
The lastMessage field contains a BaseMessage object with key fields:

Next Steps

Delete Conversation

Remove conversations from the list

Typing Indicators

Show when users are typing

Read Receipts

Track message delivery and read status

Send Messages

Start sending messages in conversations