GET/messages

List Conversation Messages

Available for: Chatflow, Agent, Chatbot, Legacy Agent apps.

Returns a conversation's message history, newest first. Pass first_id to page backward into older messages.

4 parameters
conversation_idstringrequired
ID of the conversation to read. Get conversation IDs from [List Conversations](/en/api-reference/conversations/list-conversations).
userstringoptional
End-user identifier, defined by your app and unique within it. See [End User Identity](/en/api-reference/guides/end-user-identity).
first_idstringoptional
Pagination cursor: the `id` of the first message on the current page. Pass it to fetch the previous (older) page; omit to fetch the latest messages.
limitintegeroptional
Number of chat history messages to return per request.
Default:20

3 status codes
200Successfully retrieved conversation history.
dataarray<object>optional
List of messages.
has_morebooleanoptional
Whether there are more messages.
limitintegeroptional
Number of items per page.
400`not_chat_app` : App mode does not match the API route.

One documented failure

  • not_chat_app

    Please check if your app mode matches the right API route.

    not_chat_app

404- `not_found` : Conversation does not exist. - `not_found` : First message does not exist (invalid `first_id`).

One documented failure

  • not_found

    Conversation Not Exists.

    not_found

Error handling

A 400 is returned: not_chat_app : App mode does not match the API route. A 404 is returned: - not_found : Conversation does not exist.

  • not_found : First message does not exist (invalid first_id).