Skip to main content
Quick Reference for AI Agents & Developers
// Delete a group (admin only)
String guid = "GROUP_ID";

await CometChat.deleteGroup(guid, 
  onSuccess: (String message) {
    debugPrint("Deleted: $message");
  }, 
  onError: (CometChatException e) {
    debugPrint("Error: ${e.message}");
  },
);
Only group admins can delete a group. Deleting a group removes all messages, members, and associated data permanently.
Available via: SDK | REST API | UI Kits

Delete Group

This operation is irreversible. Deleted groups cannot be recovered. All messages and member data will be permanently lost.
To delete a group you need to use the deleteGroup() method. The user must be an Admin of the group they are trying to delete.
String GUID = "GUID";

CometChat.deleteGroup(GUID, onSuccess: (String message) {
debugPrint("Deleted Group Successfully : $message ");
}, onError: (CometChatException e) {
debugPrint("Delete Group failed with exception: ${e.message}");
});
The deleteGroup() method takes the following parameters:
ParameterDescription
GUIDThe GUID of the group you would like to delete

Next Steps