Documentation Index
Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
AI Integration Quick Reference
AI Integration Quick Reference
Retrieve List of Conversations
UseConversationsRequestBuilder 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.- Java (Set Limit)
- Kotlin (Set Limit)
Set Conversation Type
Filter by conversation type:user for one-on-one or group for group conversations. If not set, both types are returned.
- Java
- Kotlin
With User and Group Tags
UsewithUserAndGroupTags(true) to include user/group tags in the response. Default is false.
- Java
- Kotlin
Set User Tags
Fetch user conversations where the user has specific tags.- Java
- Kotlin
Set Group Tags
Fetch group conversations where the group has specific tags.- Java
- Kotlin
With Tags
UsewithTags(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().
| Additional Field | Getter | Return Type | Description |
|---|---|---|---|
| tags | getTags() | List<String> | Tags associated with the conversation |
- Java
- Kotlin
Set Tags
Fetch conversations that have specific tags.- Java
- Kotlin
Include Blocked Users
UseincludeBlockedUsers(true) to include conversations with users you’ve blocked.
- Java
- Kotlin
With Blocked Info
UsewithBlockedInfo(true) to include blocked user information in the response.
- Java
- Kotlin
Search Conversations
UsesetSearchKeyword() 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)- Java
- Kotlin
Unread Conversations
UsesetUnread(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)- Java
- Kotlin
Hide Agentic Conversations
UsehideAgentic(true) to exclude AI agent conversations from the list.
- Java
- Kotlin
Only Agentic Conversations
UseonlyAgentic(true) to fetch only AI agent conversations.
- Java
- Kotlin
hideAgentic() and onlyAgentic() are mutually exclusive — use only one per request.Fetch Conversations
After configuring the builder, callbuild() to create the request, then fetchNext() to retrieve conversations. Maximum 50 per request. Call fetchNext() repeatedly on the same object to paginate.
- Java
- Kotlin
Conversation object consists of the following fields:
Tag Conversation
UsetagConversation() to add tags to a Conversation.
| Parameter | Description |
|---|---|
conversationWith | UID or GUID of the user/group |
conversationType | user or group |
tags | List of tags to add |
- Java
- Kotlin
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
UsegetConversation() to fetch a specific Conversation.
| Parameter | Description |
|---|---|
conversationWith | UID or GUID of the user/group |
conversationType | user or group |
- Java
- Kotlin
Convert Messages to Conversations
UseCometChatHelper.getConversationFromMessage() to convert a received message into a Conversation object. Useful for updating your Recent Chats list when receiving real-time messages.
- Java
- Kotlin
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
Conversation Object
Conversation Object
The
Sample Conversation Object:
Conversation object returned by SDK methods contains the following fields:| Parameter | Type | Description |
|---|---|---|
conversationId | String | Unique conversation identifier |
conversationType | String | Type of conversation. Values: "user", "group" |
conversationWith | AppEntity | The User or Group in the conversation |
lastMessage | BaseMessage | Last message in the conversation |
unreadMessageCount | int | Number of unread messages in the conversation |
unreadMentionsCount | int | Number of unread mentions in the conversation |
updatedAt | long | Unix timestamp of last conversation update |
tags | Array<String> | List of tags for conversation organization |
lastReadMessageId | long | ID of the last read message |
latestMessageId | long | ID of the latest message |
User Object (conversationWith)
User Object (conversationWith)
When
conversationType is "user", the conversationWith field contains a User object:| Parameter | Type | Description |
|---|---|---|
uid | String | Unique identifier of the user |
name | String | Display name of the user |
avatar | String | URL to user’s profile picture |
link | String | URL to user’s profile page |
role | String | User role for access control |
metadata | JSONObject | Custom data set by developer |
status | String | User online status. Values: "online", "offline" |
statusMessage | String | Custom status message |
lastActiveAt | long | Unix timestamp of last activity |
hasBlockedMe | boolean | Whether this user has blocked the logged-in user |
blockedByMe | boolean | Whether the logged-in user has blocked this user |
tags | Array<String> | List of tags for user identification |
deactivatedAt | long | Unix timestamp when user was deactivated (0 if active) |
Group Object (conversationWith)
Group Object (conversationWith)
When
conversationType is "group", the conversationWith field contains a Group object:| Parameter | Type | Description |
|---|---|---|
guid | String | Unique identifier of the group |
name | String | Display name of the group |
type | String | Group type. Values: "public", "private", "password" |
icon | String | URL to group icon |
description | String | Group description |
owner | String | UID of group owner |
metadata | JSONObject | Custom data set by developer |
membersCount | int | Number of group members |
tags | Array<String> | List of tags for group identification |
hasJoined | boolean | Whether logged-in user has joined |
scope | String | User’s scope in group. Values: "admin", "moderator", "participant" |
createdAt | long | Unix timestamp when group was created |
updatedAt | long | Unix timestamp of last group update |
LastMessage Object
LastMessage Object
The
lastMessage field contains a BaseMessage object with key fields:| Parameter | Type | Description |
|---|---|---|
id | long | Unique message identifier |
muid | String | Developer-defined message ID |
type | String | Message type. Values: "text", "image", "video", "audio", "file", "custom" |
receiverType | String | Type of receiver. Values: "user", "group" |
category | String | Message category. Values: "message", "action", "call" |
sentAt | long | Unix timestamp when message was sent |
deliveredAt | long | Unix timestamp when message was delivered |
readAt | long | Unix timestamp when message was read |
metadata | JSONObject | Custom message metadata |
conversationId | String | Associated conversation identifier |
sender | User | User who sent the message |
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