Browse SDKs · WASM
SDKsWASM

Delete a conversation and its messages

Delete a selected conversation and all of its messages with the WASM SDK.

Copy

When the product action means “Delete this chat,” use deleteConversationAndDeleteAllMsg() to delete both the conversation record and the current account's messages in that conversation.

await openimsdk.deleteConversationAndDeleteAllMsg(conversationID);

After the Promise succeeds, you can immediately clear the current message list and conversation-list item. Success does not mean that SdkEvent.OnConversationChanged has arrived. When a later event arrives, use conversationID to update the matching conversation. If no event arrives, query again and use the latest result. This operation does not delete a friendship, leave a group, or affect another user's data.