Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cometchat-22654f5b-docs-android-v6-beta2.mintlify.app/llms.txt

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

// Delete a group (owner only)
String guid = "GROUP_ID";

CometChat.deleteGroup(guid,
  onSuccess: (String message) {
    debugPrint("Deleted: $message");
  },
  onError: (CometChatException e) {
    debugPrint("Error: ${e.message}");
  },
);
Requirement: Logged-in user must be the owner of the group.
Permanently delete a group and all its messages. Only the group owner can perform this operation. The group is represented by a Group object.
This operation is irreversible. Deleted groups and their messages cannot be recovered.

Delete a Group

Use deleteGroup() with the group’s GUID.
Available via: SDK | REST API | UI Kits

Parameters

ParameterTypeDescription
guidStringThe GUID of the group you would like to delete
onSuccessFunction(String message)?Callback triggered on successful deletion
onErrorFunction(CometChatException excep)?Callback triggered on error
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}");
});
On Success — A String message confirming the operation:
ParameterTypeDescriptionSample Value
messagestringSuccess confirmation message"cometchat-guid-1 deleted successfully"
ParameterTypeDescriptionSample Value
codestringError code identifier"ERR_GUID_NOT_FOUND"
messagestringHuman-readable error message"The specified group does not exist."
detailsstringAdditional technical details"Please provide a valid group GUID."

Next Steps

Update a Group

Update group name, icon, description, and metadata

Leave a Group

Leave a group you are a member of

Create a Group

Create public, private, or password-protected groups

Groups Overview

Overview of all group management features