> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete A Conversation

> Delete A Conversation — CometChat documentation.

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.

> [tab] Delete User Conversation
>
> ```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] Delete Group Conversation
>
> ```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] 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] 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);
>   }
> );
> ```

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://www.cometchat.com/docs/rest-api/chat-apis.md).

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 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.