Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

A Conversation represents an ongoing message exchange between a user and another user (1-on-1) or a group. Each conversation tracks the last message, unread count, and metadata — making it easy to build a “Recent Chats” list.

Key behaviors

  • Conversations are automatically created when the first message is exchanged.
  • For groups with more than 300 members, conversations and unread message counts are not updated.
  • Conversations can have up to 25 tags, each up to 100 characters (UTF8mb4).
  • The lastMessage property is not visible if the message has been deleted or if a new group has no messages yet.

How conversations connect to other resources

  • Users — A 1-on-1 conversation is between two Users. The conversationWith field contains the other user’s details.
  • Groups — A group conversation is tied to a Group. The conversationWith field contains the group’s details.
  • Messages — The lastMessage field reflects the most recent Message in the conversation.

Available operations

OperationMethodEndpointDescription
List ConversationsGET/conversationsRetrieve all conversations for a user
Get ConversationGET/conversations/{conversationId}Retrieve a specific conversation (deprecated)
Delete ConversationDELETE/conversations/{conversationId}Delete a conversation for a user (deprecated)
Get User ConversationGET/users/{uid}/conversationRetrieve a 1-on-1 conversation with a specific user
Get Group ConversationGET/groups/{guid}/conversationRetrieve a group conversation
Update User ConversationPUT/users/{uid}/conversationUpdate tags on a 1-on-1 conversation
Update Group ConversationPUT/groups/{guid}/conversationUpdate tags on a group conversation
Reset User ConversationDELETE/users/{uid}/conversationReset unread count for a 1-on-1 conversation
Reset Group ConversationDELETE/groups/{guid}/conversationReset unread count for a group conversation
Mark User Conversation as ReadPOST/users/{uid}/conversation/readMark all messages as read in a 1-on-1 conversation
Mark Group Conversation as ReadPOST/groups/{guid}/conversation/readMark all messages as read in a group conversation
Mark User Conversation as DeliveredPOST/users/{uid}/conversation/deliveredMark all messages as delivered in a 1-on-1 conversation
Mark Group Conversation as DeliveredPOST/groups/{guid}/conversation/deliveredMark all messages as delivered in a group conversation
Mark Conversation as UnreadDELETE/users/{uid}/conversation/readMark a user conversation as unread
Mark Group Conversation as UnreadDELETE/groups/{guid}/conversation/readMark a group conversation as unread

Conversation properties

PropertyTypeDescription
conversationIdstringUnique conversation identifier. Format: user_{uid} for 1-on-1 or group_{guid} for group conversations.
conversationTypestringType of conversation: user or group.
unreadMessageCountintegerNumber of unread messages in this conversation.
lastMessageobjectDetails of the most recent message in the conversation. Not present if the message was deleted or if a new group has no messages.
conversationWithobjectDetails of the other user (for 1-on-1) or the group (for group conversations).
createdAtintegerUNIX timestamp of when the conversation was created.
updatedAtintegerUNIX timestamp of when the conversation was last updated.

Error handling

Error CodeDescription
ERR_UID_NOT_FOUNDThe specified user does not exist
ERR_CONVERSATION_NOT_FOUNDThe specified conversation does not exist
For the complete list of error codes, see Error Guide. For all system limits (unread counts, tag counts, group thresholds, etc.), see Properties and Constraints.