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

# Delete Conversation

> Learn how to delete user and group conversations from the logged-in user's conversation list using the CometChat Flutter SDK.

<Accordion title="AI Integration Quick Reference">
  ```dart theme={null}
  // Delete a user conversation
  await CometChat.deleteConversation(
    "UID",
    CometChatConversationType.user,
    onSuccess: (String message) => debugPrint("Deleted: $message"),
    onError: (CometChatException e) => debugPrint("Error: ${e.message}"),
  );

  // Delete a group conversation
  await CometChat.deleteConversation(
    "GUID",
    CometChatConversationType.group,
    onSuccess: (String message) => debugPrint("Deleted: $message"),
    onError: (CometChatException e) => debugPrint("Error: ${e.message}"),
  );
  ```

  **Note:** Deletes only for the logged-in user. Use [REST API](https://api-explorer.cometchat.com/reference/deletes-conversation) to delete for all participants.
</Accordion>

<Warning>
  This operation is irreversible. Deleted conversations cannot be recovered. All messages in the conversation will be removed from the user's view.
</Warning>

Use `deleteConversation()` to delete a conversation for the logged-in user.

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

This method takes two parameters: the unique id (`UID`/`GUID`) of the conversation to be deleted and 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 the [REST API documentation](https://api-explorer.cometchat.com/reference/deletes-conversation).

| Parameter          | Type     | Description                                                                                                    | Required |
| ------------------ | -------- | -------------------------------------------------------------------------------------------------------------- | -------- |
| `conversationWith` | `String` | `UID` of the user or `GUID` of the group whose conversation you want to delete.                                | Yes      |
| `conversationType` | `String` | The type of conversation to delete. Use `CometChatConversationType.user` or `CometChatConversationType.group`. | Yes      |

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

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

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

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

  | Parameter | Type   | Description                  | Sample Value                                                  |
  | --------- | ------ | ---------------------------- | ------------------------------------------------------------- |
  | `code`    | string | Error code identifier        | `"ERR_CHAT_API_FAILURE"`                                      |
  | `message` | string | Human-readable error message | `"Failed to delete the conversation."`                        |
  | `details` | string | Additional technical details | `"The specified conversation could not be found or deleted."` |
</Accordion>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Retrieve Conversations" icon="list" href="/sdk/flutter/retrieve-conversations">
    Fetch and filter conversation lists
  </Card>

  <Card title="Delete Messages" icon="trash" href="/sdk/flutter/delete-message">
    Delete individual messages from conversations
  </Card>

  <Card title="Receive Messages" icon="inbox" href="/sdk/flutter/receive-messages">
    Listen for incoming messages in real-time
  </Card>

  <Card title="Typing Indicators" icon="keyboard" href="/sdk/flutter/typing-indicators">
    Show when users are typing in conversations
  </Card>
</CardGroup>
