Delete Chat
Chats
Delete Chat
DELETE
Delete Chat
Delete Chat
This endpoint permanently deletes a chat session and all its associated messages. This action 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
404: Not Found
404: Not Found
Chat not found or doesn’t belong to your tenant
409: Conflict
409: Conflict
Chat cannot be deleted (e.g., active WebSocket connections)
500: Internal Server Error
500: Internal Server Error
Server error processing the request
Example Usage
cURL
JavaScript
Python
React Hook Example
Bulk Delete Example
Best Practices
Before Deletion
- Confirm with User: Always show a confirmation dialog since deletion is permanent
- Check Active Connections: Ensure no active WebSocket connections exist for the chat
- 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