Skip to main content
DELETE
Delete Chat

Delete Chat

This endpoint permanently deletes a chat session and all its associated messages. This action cannot be undone.
This action permanently deletes the chat and all its messages. This operation cannot be undone.

Authentication

string
required
Authentication header with your tenant’s API key

Path Parameters

string
required
The unique identifier (UUID) of the chat to delete

Response

boolean
Indicates if the deletion was successful
string
Confirmation message about the deletion
string
Timestamp when the chat was deleted

Error Responses

Invalid or missing API key
Chat not found or doesn’t belong to your tenant
Chat cannot be deleted (e.g., active WebSocket connections)
Server error processing the request

Example Usage

cURL

JavaScript

Python

React Hook Example

Bulk Delete Example

Best Practices

Before Deletion

  1. Confirm with User: Always show a confirmation dialog since deletion is permanent
  2. Check Active Connections: Ensure no active WebSocket connections exist for the chat
  3. Export Data: Offer users the option to export chat history before deletion

Error Handling

Notes

  • Only chats belonging to your tenant can be deleted
  • All messages associated with the chat are also permanently deleted
  • If there are active WebSocket connections to the chat, deletion may fail with a 409 status
  • Consider implementing a “soft delete” pattern in your application if you need to recover deleted chats
  • The operation is atomic - either the entire chat is deleted or the operation fails
  • After successful deletion, any cached data should be invalidated