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 Message is the core unit of communication in CometChat. Users can send text, media files, and custom data to other users or groups. Messages support threading, reactions, read receipts, and delivery tracking.

Key behaviors

  • Maximum file upload size is 100 MB per message (includes the file and the entire POST body).
  • The message JSON payload (including metadata) can be up to 65,536 characters (~65 KB).
  • The data object within a message must not exceed 10 KB. It accepts any JSON structure with UTF8mb4 encoding.
  • Messages can have up to 25 tags, each up to 100 characters (UTF8mb4).
  • Soft-deleted messages remain in the database. Permanently deleted messages (via API) are removed entirely.
  • For groups with more than 300 members, unread message counts and conversations are not updated.
  • Delivery and read receipts are sent for groups of up to 300 online users.

How messages connect to other resources

  • Users — Messages are sent by and delivered to Users. The sender must be authenticated.
  • Groups — Messages can target a Group by specifying the group’s GUID as the receiver.
  • Conversations — Each message exchange creates or updates a Conversation that tracks the last message and unread count.
  • Threads — Any message can be a parent for a thread. Replies are managed via the threaded messages endpoints.
  • Reactions — Users can add or remove emoji reactions on messages.

Available operations

OperationMethodEndpointDescription
Send MessagePOST/messagesSend a message to a user or group
List MessagesGET/messagesRetrieve all messages for the authenticated user
List User MessagesGET/users/{uid}/messagesRetrieve messages in a 1-on-1 conversation
List Group MessagesGET/groups/{guid}/messagesRetrieve messages in a group conversation
Get MessageGET/messages/{id}Retrieve a specific message by ID
Update MessagePUT/messages/{id}Edit a sent message
Delete MessageDELETE/messages/{id}Soft-delete or permanently delete a message
Send Threaded MessagePOST/messages/{id}/threadReply to a message in a thread
List Threaded MessagesGET/messages/{id}/threadRetrieve all replies in a thread
Send Bot MessagePOST/bots/{uid}/messagesSend a message as a bot user
Add ReactionPOST/messages/{id}/reactionsAdd an emoji reaction to a message
Remove ReactionDELETE/messages/{id}/reactions/{reaction}Remove an emoji reaction from a message
List All ReactionsGET/messages/{id}/reactionsList all reactions on a message
List Reactions by EmojiGET/messages/{id}/reactions/{reaction}List reactions filtered by a specific emoji

Message properties

PropertyTypeDescription
idintegerUnique message identifier. System-generated, read-only.
typestringMessage type: text, image, audio, video, file, or a custom type.
categorystringMessage category: message or custom.
dataobjectArbitrary JSON structure (max 10 KB). Recognized keys: text, attachments, custom_data, metadata. Accepts UTF8mb4.
tagsarray of stringsTags for categorizing messages. Max 25 tags, 100 characters each (UTF8mb4).
senderstringUID of the user who sent the message. Read-only.
receiverstringUID (for user messages) or GUID (for group messages) of the recipient.
receiverTypestringReceiver type: user or group.
sentAtintegerUNIX timestamp of when the message was sent. Read-only.

Error handling

Error CodeDescription
AUTH_ERR_EMPTY_APIKEYAPI key is missing from the request headers
AUTH_ERR_APIKEY_NOT_FOUNDThe provided API key is invalid
ERR_MSG_NOT_FOUNDThe specified message does not exist
ERR_UID_NOT_FOUNDThe receiver UID does not exist
ERR_GUID_NOT_FOUNDThe receiver group GUID does not exist
For the complete list of error codes, see Error Guide. For all system limits (file upload size, message payload, tag counts, etc.), see Properties and Constraints.