> ## 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 Conversation

> Delete user and group conversations with the CometChat JavaScript SDK.

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">
    ```javascript theme={null}
    // Delete user conversation
    await CometChat.deleteConversation("UID", "user");

    // Delete group conversation
    await CometChat.deleteConversation("GUID", "group");

    ```

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

<Warning>
  This operation is irreversible. Deleted conversations cannot be recovered for the logged-in user.
</Warning>

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

<Tabs>
  <Tab title="Delete User Conversation (TypeScript)">
    ```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="Delete User Conversation (JavaScript)">
    ```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="Delete Group Conversation (TypeScript)">
    ```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>

  <Tab title="Delete Group Conversation (JavaScript)">
    ```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>
</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/resets-user-conversation).

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

| Parameter        | Description                               | Required |
| ---------------- | ----------------------------------------- | -------- |
| conversationWith | UID or GUID of the conversation to delete | Yes      |
| conversationType | `user` or `group`                         | Yes      |

On success, returns a confirmation message string.

***

## Next Steps

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

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

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

  <Card title="Delivery & Read Receipts" icon="check-double" href="/sdk/javascript/delivery-read-receipts">
    Track message delivery and read status
  </Card>
</CardGroup>
