Skip to main content
DELETE
/
api
/
v1
/
chatmessage
/
{id}
Delete Messages
curl --request DELETE \
  --url https://api.example.com/api/v1/chatmessage/{id}
{
  "401": {},
  "404": {},
  "412": {},
  "500": {},
  "affected": 123,
  "raw": [
    {}
  ]
}
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

id
string
required
The chatflow or agentflow ID to delete messages from

Query Parameters

chatId
string
Delete messages for a specific chat session. If not provided, deletes all messages matching other criteria
memoryType
string
Filter messages by memory type before deletion
sessionId
string
Filter messages by session ID before deletion
chatType
array
Filter by chat type before deletion
startDate
string
Delete messages created after this date (ISO 8601 format)
endDate
string
Delete messages created before this date (ISO 8601 format)
feedbackType
array
Delete only messages with specific feedback types: THUMBS_UP, THUMBS_DOWN
hardDelete
boolean
Permanently delete messages from third-party integrations. Default: false
isClearFromViewMessageDialog
boolean
Indicates if deletion is triggered from the view message dialog

Response

affected
number
Number of messages deleted
raw
array
Raw database response

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

401
error
Unauthorized - Invalid or missing API key
404
error
Not Found - Chatflow with specified ID not found or workspace not found
412
error
Precondition Failed - Missing required ID parameter
500
error
Internal Server Error - Error clearing chat messages

Build docs developers (and LLMs) love