> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-rn-guide-message-privately.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete A Group

> Delete a group permanently using the CometChat Flutter SDK. Only the group owner can perform this operation.

<Accordion title="AI Integration Quick Reference">
  ```dart theme={null}
  // 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.
</Accordion>

Permanently delete a group and all its messages. Only the group owner can perform this operation. The group is represented by a [`Group`](/sdk/reference/entities#group) object.

<Warning>
  This operation is irreversible. Deleted groups and their messages cannot be recovered.
</Warning>

## Delete a Group

Use `deleteGroup()` with the group's GUID.

<Note>
  **Available via:** SDK | [REST API](https://api-explorer.cometchat.com) | [UI Kits](/ui-kit/flutter/overview)
</Note>

### Parameters

| Parameter   | Type                                  | Description                                    |
| ----------- | ------------------------------------- | ---------------------------------------------- |
| `guid`      | `String`                              | The GUID of the group you would like to delete |
| `onSuccess` | `Function(String message)?`           | Callback triggered on successful deletion      |
| `onError`   | `Function(CometChatException excep)?` | Callback triggered on error                    |

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    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}");
    });
    ```
  </Tab>
</Tabs>

<Accordion title="Response">
  **On Success** — A `String` message confirming the operation:

  <span id="delete-group-message" style={{scrollMarginTop: '100px'}} />

  | Parameter | Type   | Description                  | Sample Value                              |
  | --------- | ------ | ---------------------------- | ----------------------------------------- |
  | `message` | string | Success confirmation message | `"cometchat-guid-1 deleted successfully"` |
</Accordion>

<Accordion title="Error">
  <span id="delete-group-error" style={{scrollMarginTop: '100px'}} />

  | Parameter | Type   | Description                  | Sample Value                            |
  | --------- | ------ | ---------------------------- | --------------------------------------- |
  | `code`    | string | Error code identifier        | `"ERR_GUID_NOT_FOUND"`                  |
  | `message` | string | Human-readable error message | `"The specified group does not exist."` |
  | `details` | string | Additional technical details | `"Please provide a valid group GUID."`  |
</Accordion>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Update a Group" icon="pen-to-square" href="/sdk/flutter/update-group">
    Update group name, icon, description, and metadata
  </Card>

  <Card title="Leave a Group" icon="right-from-bracket" href="/sdk/flutter/leave-group">
    Leave a group you are a member of
  </Card>

  <Card title="Create a Group" icon="plus" href="/sdk/flutter/create-group">
    Create public, private, or password-protected groups
  </Card>

  <Card title="Groups Overview" icon="users" href="/sdk/flutter/groups-overview">
    Overview of all group management features
  </Card>
</CardGroup>
