Skip to main content

Delete Conversation

Deleting a conversation means that you can delete the text content of specified conversation corresponding to a unique conversation ID.

Steps to delete a conversation

  1. To delete a conversation, use the method deleteConversation() provided by the client.
  2. Pass in the required parameter conversationIds and reason.
  3. Process the response as per your requirement.
const payload: DeleteConversation = {
conversationIds: [], // Pass in the id's of the conversation you want to delete.
reason: "", // Pass in the reason to delete the conversation.
};
const response = await lmChatClient.deleteConversation(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Delete Conversation Payload

List of parameters required by the deleteConversation() method.

VariableTypeDescriptionOptional
conversationIdsarrayConversations Ids
reasonstringReason for conversation deletion

Delete Conversation Response

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure