---
title: "List Conversation Messages"
method: GET
path: "/messages"
tags: ["Conversations"]
---

# List Conversation Messages

`GET /messages`

**Available for**: Chatflow, New Agent, Chatbot, Agent apps.

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

## Query parameters

- `conversation_id` string, required
- `user` string
- `first_id` string
- `limit` integer

## Response `200`

Successfully retrieved conversation history.

- ConversationHistoryResponse
  - `limit` integer — Number of items per page.
  - `has_more` boolean — Whether there are more messages.
  - `data` ConversationMessageItem[] — List of messages.
    - `id` string, uuid — Message ID.
    - `conversation_id` string, uuid — Conversation ID.
    - `parent_message_id` string, uuid, nullable — Parent message ID for threaded conversations.
    - `inputs` object — Input variables for this message.
    - `query` string — User query text.
    - `answer` string — Assistant answer text.
    - `status` string — Message status. `normal` for successful messages, `error` when generation failed.
    - `error` string, nullable — Error message if `status` is `error`.
    - `message_files` MessageFileItem[] — Files attached to this message.
      - `id` string, uuid — File ID.
      - `filename` string — Original filename.
      - `type` string — File type, e.g., `image`.
      - `url` string, url, nullable — Preview URL for the file.
      - `mime_type` string, nullable — MIME type of the file.
      - `size` integer, nullable — File size in bytes.
      - `transfer_method` string — Transfer method used. `remote_url` for URL-based files, `local_file` for uploaded files, `tool_file` for tool-generated files.
      - `belongs_to` string, nullable — Who this file belongs to. `user` for user-uploaded files, `assistant` for assistant-generated files.
      - `upload_file_id` string, uuid, nullable — Upload file ID if transferred via `local_file`.
    - `feedback` object, nullable — User feedback for this message.
      - `rating` string — Feedback rating. `like` for positive, `dislike` for negative.
    - `retriever_resources` RetrieverResource[] — Retriever resources used for this message.
      - `id` string, uuid — Unique ID of the retriever resource.
      - `message_id` string, uuid — ID of the message this resource belongs to.
      - `position` integer — Position of the resource in the list.
      - `dataset_id` string, uuid — ID of the knowledge base.
      - `dataset_name` string — Name of the knowledge base.
      - `document_id` string, uuid — ID of the document.
      - `document_name` string — Name of the document.
      - `data_source_type` string — Type of the data source.
      - `segment_id` string, uuid — ID of the specific chunk within the document.
      - `score` number, float — Similarity score of the resource.
      - `hit_count` integer — Number of times this chunk was hit.
      - `word_count` integer — Word count of the chunk.
      - `segment_position` integer — Position of the chunk within the document.
      - `index_node_hash` string — Hash of the index node.
      - `content` string — Content snippet from the resource.
      - `summary` string, nullable — Summary of the chunk content.
      - `created_at` integer — Creation timestamp (Unix epoch seconds).
    - `agent_thoughts` AgentThoughtItem[] — Agent thoughts for this message.
      - `id` string, uuid — Agent thought ID.
      - `chain_id` string, nullable — Chain ID for this thought.
      - `message_id` string, uuid — Unique message ID this thought belongs to.
      - `position` integer — Position of this thought.
      - `thought` string — What LLM is thinking.
      - `tool` string — Tools called, split by `;`.
      - `tool_labels` object, nullable — Labels for tools used.
      - `tool_input` string — Input of tools in JSON format.
      - `observation` string — Response from tool calls.
      - `files` string[] — File IDs related to this thought.
      - `created_at` integer — Creation timestamp.
    - `created_at` integer — Creation timestamp (Unix epoch seconds).
    - `extra_contents` HumanInputContent[] — Additional execution content associated with this message, such as human input form data from Human Input nodes in Chatflow workflows.
      - `workflow_run_id` string — ID of the workflow run this content belongs to.
      - `submitted` boolean — Whether the human input form has been submitted.
      - `type` string — `human_input` for human input content.
      - `form_definition` HumanInputFormDefinition — Definition of a human input form rendered by a Human Input node.
        - `form_id` string — Unique form identifier.
        - `node_id` string — ID of the Human Input node that generated this form.
        - `node_title` string — Title of the Human Input node.
        - `form_content` string — Markdown or text content displayed with the form.
        - `inputs` FormInput[] — Input fields in the form.
          - `type` string — Form input control type. Available values: `paragraph` (multi-line text input), `select` (single-choice from a list), `file` (single file upload), and `file-list` (multiple file uploads).
          - `output_variable_name` string — Variable name where the input value is stored.
          - `default` FormInputDefault — Default value configuration for a form input.
            - `type` string — `variable` for dynamic values from workflow variables, `constant` for static values.
            - `selector` string[] — Variable selector path when `type` is `variable`.
            - `value` string — Static value when `type` is `constant`.
        - `actions` UserAction[] — Action buttons available on the form.
          - `id` string — Unique action identifier.
          - `title` string — Button display text.
          - `button_style` string — `primary`, `default`, `accent`, or `ghost`.
        - `display_in_ui` boolean — Whether the form should be displayed in the UI.
        - `form_token` string, nullable — Token for form submission authentication.
        - `resolved_default_values` object — Resolved default values for form inputs, keyed by output variable name.
        - `expiration_time` integer — Unix timestamp when the form expires.
      - `form_submission_data` HumanInputFormSubmissionData — Data from a submitted human input form.
        - `node_id` string — ID of the Human Input node.
        - `node_title` string — Title of the Human Input node.
        - `rendered_content` string — Rendered content of the form submission.
        - `action_id` string — ID of the action button that was clicked.
        - `action_text` string — Display text of the action button that was clicked.
    - `message_tokens` integer — Number of tokens in the input message.
    - `answer_tokens` integer — Number of tokens in the generated answer.
    - `total_tokens` integer — Total tokens used, the sum of `message_tokens` and `answer_tokens`.
    - `provider_response_latency` number, double — Model provider response latency in seconds.
    - `total_price` string, decimal, nullable — Total price for the tokens used, or `null` when pricing is unavailable.
    - `currency` string, nullable — Currency for `total_price` (for example, `USD`), or `null` when pricing is unavailable.

## Other responses

- `400` — `not_chat_app` : App mode does not match the API route.
- `404` — - `not_found` : Conversation does not exist. - `not_found` : First message does not exist (invalid `first_id`).

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/revisions/e49b3db72bad/schema)
