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

// Delete group conversation
await CometChat.deleteConversation("GUID", "group");
Note: Deletes only for the logged-in user. Use REST API to delete for all participants.
Available via: SDK | REST API | UI Kits
This operation is irreversible. Deleted conversations cannot be recovered for the logged-in user.
In case you want to delete a conversation, you can use the deleteConversation() method. This method takes two parameters. The unique id (UID/GUID) of the conversation to be deleted & the type (user/group) of conversation to be deleted.
let UID = "UID";
let type = "user";
CometChat.deleteConversation(UID, type).then(
  deletedConversation => {
      console.log(deletedConversation);
  }, error => {
      console.log('error while deleting a conversation', error);
  }
); 
This method deletes the conversation only for the logged-in user. To delete a conversation for all the users of the conversation, please refer to our REST API documentation here. The deleteConversation() method takes the following parameters:
ParameterDescriptionRequired
conversationWithUID of the user or GUID of the group whose conversation you want to delete.YES
conversationTypeThe type of conversation you want to delete . It can be either user or group.YES

Next Steps