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

# Delete A Conversation

> Learn how to delete user and group conversations for the logged-in user using the CometChat React Native SDK.

<Info>
  **Quick Reference**

  ```javascript theme={null}
  // Delete a user conversation
  CometChat.deleteConversation("UID", "user");

  // Delete a group conversation
  CometChat.deleteConversation("GUID", "group");
  ```
</Info>

<Note>
  **Available via:** [SDK](/sdk/react-native/delete-conversation) | [REST API](/rest-api/conversations/reset-user-conversation) | [UI Kits](/ui-kit/react-native/overview)
</Note>

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, and the type (`user`/`group`) of conversation to be deleted.

<Warning>
  Deleting a conversation is an irreversible operation for the logged-in user. Once deleted, the conversation and its associated data cannot be recovered for that user.
</Warning>

<Tabs>
  <Tab title="To User">
    ```javascript theme={null}
    let UID = "UID";
    let type = "user";
    CometChat.deleteConversation(UID, type).then(
      deletedConversation => {
          console.log(deletedConversation);
      }, error => {
          console.log('error while deleting a conversation', error);
      }
    );
    ```
  </Tab>

  <Tab title="To Group">
    ```javascript theme={null}
    let GUID = "GUID";
    let type = "group";
    CometChat.deleteConversation(GUID, type).then(
      deletedConversation => {
          console.log(deletedConversation);
      }, error => {
          console.log('error while deleting a conversation', error);
      }
    );
    ```
  </Tab>

  <Tab title="TypeScript (User)">
    ```typescript theme={null}
    let UID: string = "UID";
    let type: string = "user";
    CometChat.deleteConversation(UID, type).then(
      (deletedConversation: string) => {
          console.log(deletedConversation);
      }, (error: CometChat.CometChatException) => {
          console.log('error while deleting a conversation', error);
      }
    );
    ```
  </Tab>

  <Tab title="TypeScript (Group)">
    ```typescript theme={null}
    let GUID: string = "GUID";
    let type: string = "group";
    CometChat.deleteConversation(GUID, type).then(
      (deletedConversation: string) => {
          console.log(deletedConversation);
      }, (error: CometChat.CometChatException) => {
          console.log('error while deleting a conversation', error);
      }
    );
    ```
  </Tab>
</Tabs>

<Accordion title="Response">
  **On Success** — `deleteConversation()` returns a success message:

  | Parameter | Type   | Description          | Sample Value                           |
  | --------- | ------ | -------------------- | -------------------------------------- |
  | `message` | string | Confirmation message | `"Conversation deleted successfully."` |
</Accordion>

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      |

<AccordionGroup>
  <Accordion title="Best Practices">
    * Always confirm with the user before deleting a conversation, as this action is irreversible for the logged-in user.
    * Handle the error callback gracefully to inform users if the deletion fails (e.g., due to network issues or invalid IDs).
    * After a successful deletion, update your local conversation list by refreshing it using `ConversationsRequest`.
  </Accordion>

  <Accordion title="Troubleshooting">
    * **Conversation not found**: Ensure the `UID` or `GUID` you are passing is correct and that a conversation with that user or group exists.
    * **Permission denied**: Verify that the logged-in user has the appropriate permissions and that the SDK is initialized and the user is logged in.
    * **Type mismatch**: Make sure the `conversationType` parameter matches the ID you are passing — use `"user"` with a `UID` and `"group"` with a `GUID`.
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Retrieve Conversations" href="/sdk/react-native/retrieve-conversations">
    Fetch and display the list of conversations for the logged-in user.
  </Card>

  <Card title="Delete a Message" href="/sdk/react-native/delete-message">
    Remove individual messages from a conversation.
  </Card>

  <Card title="Receive Messages" href="/sdk/react-native/receive-messages">
    Listen for and handle incoming real-time messages.
  </Card>

  <Card title="Messaging Overview" href="/sdk/react-native/messaging-overview">
    Explore the full set of messaging capabilities available in the SDK.
  </Card>
</CardGroup>
