Skip to main content
Quick Reference for AI Agents & Developers
// Delete user conversation
await CometChat.deleteConversation("user_uid", "user");

// Delete group conversation
await CometChat.deleteConversation("group_guid", "group");

// Note: Only removes from YOUR list, not other participants
// Messages are still accessible if you receive new ones
Delete a conversation to remove it from the user’s conversation list. This only affects the logged-in user’s view.
Availability: SDK, API, UI KitsDeleting a conversation only removes it for the logged-in user, not for other participants.

Delete a Conversation

const UID = "user1";
const type = "user";

CometChat.deleteConversation(UID, type).then(
  (response) => console.log("Conversation deleted:", response),
  (error) => console.log("Failed to delete:", error)
);
ParameterDescription
conversationWithUID of user or GUID of group
conversationType"user" or "group"

What Gets Deleted

DeletedNot Deleted
Conversation from your listMessages (still accessible)
Unread countOther users’ conversations
Last message previewGroup membership
If you receive a new message from the deleted conversation, it will reappear in your conversation list.

Delete for All Users

To delete a conversation for all participants, use the REST API:
curl -X DELETE "https://api-{region}.cometchat.io/v3/users/{uid}/conversation" \
  -H "apiKey: YOUR_API_KEY" \
  -H "Content-Type: application/json"
View REST API Documentation →

Next Steps