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

# Delete A Conversation

> Delete one-on-one or group conversations for the logged-in user in Flutter apps using conversation ID and type.

<Accordion title="AI Integration Quick Reference">
  | Field          | Value                                                                                                                                                                                   |
  | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Package        | `cometchat_sdk`                                                                                                                                                                         |
  | Import         | `import 'package:cometchat_sdk/cometchat_sdk.dart';`                                                                                                                                    |
  | Purpose        | Delete one-on-one or group conversations for the logged-in user in Flutter apps using conversation ID and type.                                                                         |
  | Key methods    | `deleteConversation()`                                                                                                                                                                  |
  | Key classes    | `Conversation` · `CometChatException` · `CometChatConversationType`                                                                                                                     |
  | Prerequisites  | SDK initialised via [`CometChat.init()`](/sdk/flutter/setup) and a logged-in user via [`CometChat.login()`](/sdk/flutter/authentication-overview).                                      |
  | Constraints    | `onSuccess` and `onError` are **both required** — omitting either is a compile error, and awaiting the call alone gives you nothing to act on. Put the success path inside `onSuccess`. |
  | Related        | [Retrieve Conversations](/sdk/flutter/retrieve-conversations)                                                                                                                           |
  | Full reference | [`Conversation`](/sdk/reference/entities#conversation) · [`CometChatException`](/sdk/reference/auxiliary#cometchatexception)                                                            |
</Accordion>

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.

<Tabs>
  <Tab title="Delete User Conversation">
    ```dart theme={null}
    String conversationWith = "UID";
    String conversationType = CometChatConversationType.user;
    await CometChat.deleteConversation(conversationWith, conversationType,
       onSuccess: (String str){
         debugPrint("Conversation deleted successfully at : $str");
       },
       onError: (CometChatException e){
         debugPrint("Conversation deletion failed : ${e.message}");
      	}
    );
    ```
  </Tab>

  <Tab title="Delete Group Conversation">
    ```dart theme={null}
    String conversationWith = "GUID";
    String conversationType = CometChatConversationType.group;
    await CometChat.deleteConversation(conversationWith, conversationType,
       onSuccess: (String str){
         debugPrint("Conversation deleted successfully at : $str");
       },
       onError: (CometChatException e){
         debugPrint("Conversation deletion failed : ${e.message}");
      	}
    ); 
    ```
  </Tab>
</Tabs>

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](https://api-explorer.cometchat.com/reference/deletes-conversation).

The `deleteConversation()` method takes the following parameters:

| Parameter        | Description                                                                       | Required |
| ---------------- | --------------------------------------------------------------------------------- | -------- |
| conversationWith | `UID` of the user or `GUID` of the group whose conversation you want to delete.   | YES      |
| conversationType | The type of conversation you want to delete . It can be either `user` or `group`. | YES      |
