Skip to main content
GET
/
api
/
v1
/
chatmessage
/
{id}
List Messages
curl --request GET \
  --url https://api.example.com/api/v1/chatmessage/{id}
{
  "401": {},
  "404": {},
  "412": {},
  "500": {},
  "id": "<string>",
  "role": "<string>",
  "content": "<string>",
  "chatflowid": "<string>",
  "chatId": "<string>",
  "memoryType": "<string>",
  "sessionId": "<string>",
  "createdDate": {},
  "sourceDocuments": [
    {}
  ],
  "usedTools": [
    {}
  ],
  "agentReasoning": [
    {}
  ],
  "artifacts": [
    {}
  ]
}
Retrieve all chat messages for a specific chatflow or agentflow. Supports filtering by chat session, date range, and feedback status.

Path Parameters

id
string
required
The chatflow or agentflow ID to retrieve messages for

Query Parameters

chatId
string
Filter messages by specific chat session ID
sortOrder
string
Sort order for messages. Options: ASC, DESC. Default: DESC
startDate
string
Filter messages created after this date (ISO 8601 format)
endDate
string
Filter messages created before this date (ISO 8601 format)
messageId
string
Filter by specific message ID
memoryType
string
Filter by memory type used in the conversation
sessionId
string
Filter by session ID
feedback
boolean
Filter to show only messages with feedback
feedbackType
array
Filter by feedback type: THUMBS_UP, THUMBS_DOWN
chatType
array
Filter by chat type
page
number
Page number for pagination. Default: 1
limit
number
Number of results per page. Default: 50

Response

id
string
Unique identifier for the message
role
string
Message role: user or assistant
content
string
The message content/text
chatflowid
string
ID of the chatflow/agentflow
chatId
string
Chat session identifier
memoryType
string
Type of memory used
sessionId
string
Session identifier
createdDate
timestamp
When the message was created
sourceDocuments
array
Source documents referenced in the response
usedTools
array
Tools used to generate the response
agentReasoning
array
Agent’s reasoning steps
artifacts
array
Generated artifacts

Example Request

curl -X GET \
  'https://your-flowise-instance.com/api/v1/chatmessage/abc123-def456-ghi789?chatId=session-xyz&sortOrder=DESC&limit=20' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Example Response

[
  {
    "id": "msg-001",
    "role": "user",
    "content": "What's the weather today?",
    "chatflowid": "abc123-def456-ghi789",
    "chatId": "session-xyz",
    "memoryType": "buffer",
    "sessionId": "sess-123",
    "createdDate": "2024-01-20T15:30:00Z"
  },
  {
    "id": "msg-002",
    "role": "assistant",
    "content": "It's sunny with a high of 72°F.",
    "chatflowid": "abc123-def456-ghi789",
    "chatId": "session-xyz",
    "memoryType": "buffer",
    "sessionId": "sess-123",
    "usedTools": [{"tool": "weather_api", "input": "current weather"}],
    "createdDate": "2024-01-20T15:30:05Z"
  }
]

Error Responses

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

Build docs developers (and LLMs) love