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

Available via: SDK | REST API | UI Kits
In other words, as a logged-in user, how do I retrieve the latest conversations that I’ve been a part of? To fetch the list of conversations, you can use the ConversationsRequest class. To use this class i.e. to create an object of the ConversationsRequest class, you need to use the ConversationsRequestBuilder class. The ConversationsRequestBuilder class allows you to set the parameters based on which the conversations are to be fetched. Fetching using this builder will return Conversation objects.

ConversationsRequestBuilder Parameters

The ConversationsRequestBuilder to fetch conversations with various filters.

Set Limit

Set the number of conversations to fetch per request.
The default value for limit is 30 and the max value 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.
When conversations are fetched successfully, the response will include an array of Conversation objects filtered by the specified type.

With User and Group Tags

Use withUserAndGroupTags = true to include user/group tags in the Conversation object. Default is false.
When conversations are fetched successfully, the response will include tags arrays on the conversationWith objects (user or group).

Set User Tags

Fetch user conversations where the user has specific tags.
When conversations are fetched successfully, the response will include only user conversations where the user has the specified tags.

Set Group Tags

Fetch group conversations where the group has specific tags.
When conversations are fetched successfully, the response will include only group conversations where the group has the specified 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

Use includeBlockedUsers = true to include conversations with users you’ve blocked.
When conversations are fetched successfully, the response includes conversations with blocked users. To also get blocked info details (blockedByMe, hasBlockedMe), set withBlockedInfo to true.

With Blocked Info

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

Search Conversations

Use searchKeyword 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)
When conversations are fetched successfully, the response includes conversations where the user or group name matches the search keyword.

Unread Conversations

Use unread = 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)
When conversations are fetched successfully, the response includes only conversations with unread messages (unreadMessageCount > 0).

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.
When conversations are fetched successfully, the response will include only conversations with AI agents. Agent users have role: "@agentic" and include agent-specific metadata.

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.
On Success — A List<Conversation> containing conversation objects with their associated user/group and last message details:Conversation Object (per item in list):
conversationWith Object (User):
conversationWith Object (Group):
lastMessage Object (TextMessage):
lastMessage.sender Object:
lastMessage.receiver Object:
The Conversation object consists of the below fields:

Tag Conversation

In other words, as a logged-in user, how do I tag a conversation? Use tagConversation() to add tags to a conversation.
On Success — A Conversation object containing the updated conversation with the applied tags:Conversation Object:
conversationWith Object (User):
lastMessage Object (TextMessage):
lastMessage.sender Object:
lastMessage.receiver Object:
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

In other words, as a logged-in user, how do I retrieve a specific conversation? Use getConversation() to fetch a specific conversation.
On Success — A Conversation object containing the details of the requested conversation:Conversation Object:
conversationWith Object (User):
lastMessage Object (TextMessage):
lastMessage.sender Object:
lastMessage.receiver Object:

Convert Messages to Conversations

As per our Receive Messages guide, for real-time messages, you will always receive Message objects and not Conversation objects. Thus, you will need a mechanism to convert the Message object to a Conversation object. You can use the getConversationFromMessage method for this purpose.
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.

Next Steps

Delete Conversation

Remove conversations from the logged-in user’s list

Typing Indicators

Show real-time typing status in conversations

Read Receipts

Track message delivery and read status

Receive Messages

Listen for incoming messages in real-time