Delete chat messages for a specific chatflow or agentflow. You can delete all messages, specific chat sessions, or messages within a date range.
Path Parameters
The chatflow or agentflow ID to delete messages from
Query Parameters
Delete messages for a specific chat session. If not provided, deletes all messages matching other criteria
Filter messages by memory type before deletion
Filter messages by session ID before deletion
Filter by chat type before deletion
Delete messages created after this date (ISO 8601 format)
Delete messages created before this date (ISO 8601 format)
Delete only messages with specific feedback types: THUMBS_UP, THUMBS_DOWN
Permanently delete messages from third-party integrations. Default: false
isClearFromViewMessageDialog
Indicates if deletion is triggered from the view message dialog
Response
Number of messages deleted
Example Request - Delete All Messages
curl -X DELETE \
'https://your-flowise-instance.com/api/v1/chatmessage/abc123-def456-ghi789' \
-H 'Authorization: Bearer YOUR_API_KEY'
Example Request - Delete Specific Chat Session
curl -X DELETE \
'https://your-flowise-instance.com/api/v1/chatmessage/abc123-def456-ghi789?chatId=session-xyz&hardDelete=true' \
-H 'Authorization: Bearer YOUR_API_KEY'
Example Request - Delete Messages by Date Range
curl -X DELETE \
'https://your-flowise-instance.com/api/v1/chatmessage/abc123-def456-ghi789?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z' \
-H 'Authorization: Bearer YOUR_API_KEY'
Example Response
{
"affected": 42,
"raw": []
}
Hard Delete
When hardDelete is set to true, the endpoint will:
- Clear messages from third-party memory integrations
- Permanently remove conversation context from external services
- Delete messages from the database
This is useful when you need to completely remove conversation history including from memory stores.
Error Responses
Unauthorized - Invalid or missing API key
Not Found - Chatflow with specified ID not found or workspace not found
Precondition Failed - Missing required ID parameter
Internal Server Error - Error clearing chat messages