> ## Documentation Index
> Fetch the complete documentation index at: https://open.manus.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# task.listMessages

> Lists event messages for a task with cursor-based pagination. Use this to poll for progress after [task.create](https://open.manus.ai/docs/v2/task.create) or [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage). See the [Task Lifecycle](https://open.manus.ai/docs/v2/task-lifecycle) guide for how to handle each status.

<sup>Questions or issues? Contact us at [api-support@manus.ai](mailto:api-support@manus.ai).</sup>

> [!TIP]
>
> **Auth:**
>
> * **API Key:** Full access.
> * **Standard OAuth client:** Requires `create_task` or `manage_all_tasks`. With `create_task`, only tasks created by the same client; see [Task visibility](https://open.manus.ai/docs/v2/open-app.md#task-visibility).
> * **Trusted client:** Full access.
>
> **Handle status:** Read `status_update` events and respond as described in [Task Lifecycle](https://open.manus.ai/docs/v2/task-lifecycle). Answer agent questions with [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage.md); confirm actions with [task.confirmAction](https://open.manus.ai/docs/v2/task.confirmAction.md).
>
> **Render output:** Resolve file paths and `manus-webdev://` links in assistant content as described in [Attachments](https://open.manus.ai/docs/v2/attachments.md).


## OpenAPI

````yaml GET /v2/task.listMessages
openapi: 3.1.0
info:
  title: Manus OpenAPI v2
  description: >-
    API for integrating Manus into your workflow. All responses are wrapped with
    {"ok": true, "request_id": "...", ...} for success and {"ok": false,
    "request_id": "...", "error": {"code": "...", "message": "..."}} for errors.
  version: 2.0.0
servers:
  - url: https://api.manus.ai
security:
  - ApiKeyAuth: []
paths:
  /v2/task.listMessages:
    get:
      summary: ListMessages
      description: >-
        Lists event messages for a task with cursor-based pagination. Use this
        to poll for progress after
        [task.create](https://open.manus.ai/docs/v2/task.create) or
        [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage). See
        the [Task Lifecycle](https://open.manus.ai/docs/v2/task-lifecycle) guide
        for how to handle each status.
      operationId: openapi.v2.OpenapiV2Service.ListMessages
      parameters:
        - name: x-manus-api-key
          in: header
          required: false
          schema:
            type: string
          description: >-
            API key for direct authentication. Provide either this or
            `Authorization`, not both. See
            [Authentication](https://open.manus.ai/docs/v2/authentication).
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
            example: Bearer {access_token}
          description: >-
            OAuth2 access token in `Bearer {token}` format. An OAuth client
            requires the `create_task` or `manage_all_tasks` scope unless it is
            a `Trusted team client` or `Trusted public client`. Provide either
            this or `x-manus-api-key`, not both. See the [Open
            App](https://open.manus.ai/docs/v2/open-app) guide.
        - name: task_id
          in: query
          required: true
          schema:
            type: string
          description: >-
            The unique identifier of the task to list messages for. Supports the
            shortcut `agent-default-main_task` for the IM agent's main task.
        - name: limit
          in: query
          schema:
            type: integer
            description: 'Number of messages to return per page. Default: 50, Range: 1-200.'
        - name: cursor
          in: query
          schema:
            type: string
            description: >-
              Pagination cursor from the previous response's next_cursor field.
              Omit for the first page.
        - name: start_event_id
          in: query
          schema:
            type: string
            description: >-
              Start at this event, inclusive. Use a value from `messages[].id`.
              Cannot be combined with `cursor`. The response may still include
              `next_cursor` for following pages. If the ID appears only in
              `verbose=true` responses, use `verbose=true` or the event is not
              found.
        - name: order
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            description: |-
              Sort direction by timestamp.

              - `desc` (default) — newest first.
              - `asc` — oldest first.
        - name: verbose
          in: query
          schema:
            type: boolean
            description: >-
              Include detailed events.


              - `false` (default) — `user_message`, `assistant_message`,
              `error_message`, `status_update`, and `user_stop` only.

              - `true` — also `tool_used` (tools the agent invoked),
              `plan_update` (plan snapshots), `new_plan_step` (step additions),
              and `explanation` (agent reasoning).
        - name: slides_format
          in: query
          schema:
            type: string
            enum:
              - html
              - pptx
            description: |-
              Format of slides attachments in the response.

              - `html` (default) — raw HTML slides.
              - `pptx` — slides converted to PowerPoint.
        - name: markdown_format
          in: query
          schema:
            type: string
            enum:
              - markdown
              - pdf
              - docx
            description: >-
              Format of Markdown attachments in `assistant_message.attachments`.
              An attachment is treated as Markdown when its filename ends in
              `.md` or `.markdown`, or its `content_type` contains `markdown`.


              - `markdown` (default) — the original Markdown file.

              - `pdf` — Markdown converted to PDF.

              - `docx` — Markdown converted to Word.


              Only `url` changes: `filename`, `content_type`, `file_uid`, and
              `version_uid` still describe the source Markdown file. If
              conversion fails, `url` remains the original Markdown download.


              Conversion runs before the response is returned, so response time
              grows with the number and size of Markdown attachments on the
              page. Pair it with `start_event_id` and `limit=1` to convert only
              the message you need; do not use it for routine polling or
              full-page reads.
        - name: include_cover
          in: query
          schema:
            type: boolean
            description: >-
              Include cover images for `assistant_message.attachments`.


              - `false` (default) — attachments carry no cover fields.

              - `true` — each attachment carries `cover_image_status`, and
              `cover_image` when the cover is ready. Both are omitted when the
              cover lookup fails for a response.


              Covers exist for Manus Slides (first slide), PDF (first page), and
              spreadsheets `xls`, `xlsx`, `csv`, `ods` (first sheet). They are
              generated when the file is produced, so most are `ready` on the
              first request. A `pending` PDF or spreadsheet starts generating on
              this request; call again with `include_cover=true` after 10 to 15
              seconds. Images and all other types normally report `unsupported`;
              always follow `cover_image_status` rather than the file type. Send
              this parameter only when rendering covers; routine polling does
              not need it. See [Cover
              images](https://open.manus.ai/docs/v2/attachments#cover-images).
      responses:
        '200':
          description: Messages retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                    description: Whether the request was successful.
                  request_id:
                    type: string
                    description: Unique identifier for this API request.
                  task_id:
                    type: string
                    description: The task ID these messages belong to.
                  messages:
                    type: array
                    items:
                      $ref: '#/components/schemas/TaskEvent'
                    description: >-
                      Array of task event objects representing the conversation
                      and agent activity.
                  has_more:
                    type: boolean
                    description: Whether there are more messages beyond this page.
                  next_cursor:
                    type: string
                    description: >-
                      Cursor for fetching the next page. Only present when
                      has_more is true.
        4XX:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10' \
              --header 'x-manus-api-key: <api-key>'
        - lang: python
          label: Python
          source: |-
            import requests

            url = "https://api.manus.ai/v2/task.listMessages"

            headers = {
                "x-manus-api-key": "<api-key>"
            }

            response = requests.get(url, headers=headers, params={
                "task_id": "<string>",
                "order": "desc",
                "limit": "10"
            })

            print(response.text)
        - lang: javascript
          label: JavaScript
          source: >-
            const options = {
              method: 'GET',
              headers: {'x-manus-api-key': '<api-key>'}
            };


            fetch('https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10',
            options)
              .then(res => res.json())
              .then(res => console.log(res))
              .catch(err => console.error(err));
        - lang: php
          label: PHP
          source: |-
            <?php

            $curl = curl_init();

            curl_setopt_array($curl, [
              CURLOPT_URL => "https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10",
              CURLOPT_RETURNTRANSFER => true,
              CURLOPT_ENCODING => "",
              CURLOPT_MAXREDIRS => 10,
              CURLOPT_TIMEOUT => 30,
              CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
              CURLOPT_CUSTOMREQUEST => "GET",
              CURLOPT_HTTPHEADER => [
                "x-manus-api-key: <api-key>"
              ],
            ]);

            $response = curl_exec($curl);
            $err = curl_error($curl);

            curl_close($curl);

            if ($err) {
              echo "cURL Error #:" . $err;
            } else {
              echo $response;
            }
        - lang: go
          label: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io\"\n)\n\nfunc main() {\n\n\turl := \"https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10\"\n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"x-manus-api-key\", \"<api-key>\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := io.ReadAll(res.Body)\n\n\tfmt.Println(string(body))\n\n}"
        - lang: java
          label: Java
          source: >-
            HttpResponse<String> response =
            Unirest.get("https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10")
              .header("x-manus-api-key", "<api-key>")
              .asString();
        - lang: ruby
          label: Ruby
          source: >-
            require 'uri'

            require 'net/http'


            url =
            URI("https://api.manus.ai/v2/task.listMessages?task_id=<string>&order=desc&limit=10")


            http = Net::HTTP.new(url.host, url.port)

            http.use_ssl = true


            request = Net::HTTP::Get.new(url)

            request["x-manus-api-key"] = '<api-key>'


            response = http.request(request)

            puts response.read_body
components:
  schemas:
    TaskEvent:
      type: object
      description: >-
        A task event representing a message, status change, or agent activity.
        Only one payload field (user_message, assistant_message, etc.) will be
        present, determined by the type field.
      properties:
        id:
          type: string
          description: Unique identifier for this event.
        type:
          type: string
          enum:
            - user_message
            - assistant_message
            - error_message
            - status_update
            - tool_used
            - plan_update
            - new_plan_step
            - explanation
            - user_stop
            - structured_output_result
          description: >-
            Event type. Determines which payload field is present. tool_used,
            plan_update, new_plan_step, and explanation are only included when
            verbose=true. structured_output_result appears after task completion
            when a structured_output_schema was provided.
        timestamp:
          type: integer
          format: int64
          description: Unix timestamp in milliseconds when this event occurred.
        user_message:
          type: object
          description: >-
            Present when type="user_message". Contains a message sent by the
            user.
          properties:
            content:
              type: string
              description: The text content of the user's message.
            message_type:
              type: string
              enum:
                - text
                - voice
              description: >-
                How the message was sent. "text" for typed input, "voice" for
                voice input.
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/TaskAttachment'
              description: Files or images the user attached to their message.
            hidden_content:
              type: array
              items:
                type: string
              description: >-
                Most integrations can ignore this field. A `Trusted public
                client` receives additional application context here when
                `verbose=true`. See [Hidden application
                context](https://open.manus.ai/docs/v2/hidden-application-context).
            sender:
              type: object
              description: >-
                The user who sent this message. In a shared task, use `user_id`
                to tell collaborators apart. Omitted for older events and for
                messages that Manus generates instead of a user, such as
                scheduled-task runs or meeting records.
              properties:
                user_id:
                  type: string
                  description: Manus user ID of the sender.
                name:
                  type: string
                  description: >-
                    Display name of the sender. Returned only for API Key or
                    Trusted client; other OAuth clients receive only `user_id`.
                    Omitted when the user has no display name.
                avatar_url:
                  type: string
                  description: >-
                    URL of the sender's avatar image. Returned only for API Key
                    or Trusted client. The URL can expire; list the messages
                    again for a fresh link. Omitted when the user has no avatar.
              required:
                - user_id
            source_task:
              type: object
              description: >-
                Present only when another task sent this message, for example
                with
                [task.sendMessage](https://open.manus.ai/docs/v2/task.sendMessage)
                from inside a Manus task. Replies forwarded from this task's own
                side chat do not include it. Returned only for API Key or
                Trusted client; other OAuth clients do not receive it. `sender`
                is still the user on whose behalf the message was sent.
              properties:
                task_id:
                  type: string
                  description: ID of the task that sent the message.
                title:
                  type: string
                  description: >-
                    Display name of the source at the time the message was sent:
                    the agent's name when an agent sent it, otherwise the source
                    task's title. Omitted when empty.
                agent_id:
                  type: string
                  description: >-
                    ID of the agent that sent the message. Present only when an
                    agent sent it.
              required:
                - task_id
        assistant_message:
          type: object
          description: >-
            Present when type="assistant_message". Contains a response from the
            agent.
          properties:
            content:
              type: string
              description: The text content of the agent's response.
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/TaskAttachment'
              description: Files, images, or slides the agent generated as output.
            question_expectation:
              type: object
              description: >-
                Present only for agent questions with non-empty choices. Reply
                with task.sendMessage, not task.confirmAction. Use the enclosing
                message id to identify this message; nested event_id is
                webhook-only and is not required for replies.
              properties:
                options:
                  type: array
                  minItems: 1
                  description: >-
                    Candidate display text, not option IDs or mandatory
                    exact-match answers. Free-text replies are allowed. Send a
                    non-empty answer in message.content; when there are no
                    choices, listMessages omits question_expectation (webhooks
                    may instead use options: []).
                  items:
                    type: string
                selection_mode:
                  type: string
                  description: >-
                    UI selection hint: single for one candidate or multiple for
                    several. Combine multiple selections into one readable
                    message.content (for example, 'Please export PDF and
                    DOCX.'); no delimiter or structured option-ID array is
                    required. Empty or unknown upstream values normalize to
                    single.
                  enum:
                    - single
                    - multiple
                response_method:
                  type: string
                  description: >-
                    Fixed to send_message for ordinary questions, including when
                    the upstream value is absent. This does not invoke
                    task.confirmAction. If an unknown value is encountered, stop
                    automatic dispatch and consult the current documentation; do
                    not fall back to action confirmation.
                  enum:
                    - send_message
            delivery_kind:
              type: string
              example: progress
              description: >-
                Optional display recommendation. `opening` and `progress` are
                primarily useful during execution and may be collapsed after the
                step completes. `result` is more important and should remain
                visible. If the value is absent or unrecognized, keep the
                message visible rather than hiding it.
        error_message:
          type: object
          description: >-
            Present when type="error_message". Indicates the task encountered an
            error.
          properties:
            error_type:
              type: string
              description: Category of the error.
            content:
              type: string
              description: Human-readable error description.
        status_update:
          type: object
          description: >-
            Present when type="status_update". Indicates a change in the agent's
            processing state.
          properties:
            agent_status:
              type: string
              enum:
                - running
                - stopped
                - waiting
                - error
              description: >-
                The agent's current state. waiting means it needs a question
                answered or an action confirmed; inspect
                status_detail.waiting_for_event_type to choose the response
                endpoint.
            status_detail:
              type: object
              description: >-
                Additional details when agent_status is waiting. For action
                confirmations, use waiting_for_event_id with task.confirmAction.
                Agent questions use task.sendMessage instead.
              properties:
                waiting_for_event_id:
                  type: string
                  description: >-
                    Identifies the waiting event. For action confirmations, pass
                    it as event_id to task.confirmAction; question replies use
                    task.sendMessage without this parameter.
                waiting_for_event_type:
                  type: string
                  description: >-
                    Waiting event type: messageAskUser / cascadeAskUser are
                    questions answered with task.sendMessage; supported action
                    types such as gmailSendAction use task.confirmAction, even
                    without confirm_input_schema. Do not automatically confirm
                    unrecognized types.
                waiting_description:
                  type: string
                  description: Human-readable description of what the agent is waiting for.
                confirm_input_schema:
                  type: object
                  description: >-
                    JSON Schema defining the expected input format for the
                    confirmation, if additional input is needed.
            brief:
              type: string
              description: Short summary of the current agent activity.
            description:
              type: string
              description: Detailed description of what the agent is doing.
        tool_used:
          type: object
          description: >-
            Present when type="tool_used". Tool events normally require
            verbose=true. A confirmation target can be fetched with verbose=true
            and start_event_id=waiting_for_event_id only when the target
            projects to tool_used. Configuration and OAuth targets do not;
            attempting this lookup for them returns Event not found.
          properties:
            tool:
              type: string
              description: >-
                Name of the tool that was used (e.g., "browser",
                "code_executor").
            action_id:
              type: string
              description: Unique identifier for this tool action.
            status:
              type: string
              enum:
                - success
                - error
                - rollback
                - pending_confirmation
              description: >-
                Tool projection status. pending_confirmation means the operation
                has not executed and is waiting for task.confirmAction, but some
                confirmation targets such as Gmail and Calendar retain success
                while waiting. Determine confirmation state from
                agent_status=waiting and waiting_for_event_id, not from this
                field alone.
            brief:
              type: string
              description: Short summary of the tool action.
            description:
              type: string
              description: Detailed description of what the tool did.
            message:
              type: object
              description: >-
                Human-readable display summary for the tool invocation. This is
                not the structured tool input.
              properties:
                action:
                  type: string
                  description: >-
                    Human-readable label describing the tool action. The action
                    may still be awaiting confirmation.
                param:
                  type: string
                  description: >-
                    Optional human-readable detail shown with the action. This
                    is not the structured tool input; use tool_used.params for
                    structured parameters.
            params:
              type: object
              description: >-
                Structured parameters supplied to the tool. Returned when the
                confirmation target is fetched with verbose=true and
                start_event_id=waiting_for_event_id, or when that target and its
                waiting status are returned on the same page. Use them to review
                the proposed operation; do not submit them directly as
                task.confirmAction input.
            result:
              type: object
              description: >-
                Optional structured tool result used as confirmation context for
                result-driven operations, such as selecting an account or
                publishing prepared media. Returned under the same conditions as
                params.
        plan_update:
          type: object
          description: >-
            Present when type="plan_update" (verbose=true only). A full snapshot
            of the agent's current execution plan.
          properties:
            steps:
              type: array
              description: All steps in the current plan with their statuses.
              items:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - todo
                      - doing
                      - done
                      - failed
                    description: Current status of this plan step.
                  title:
                    type: string
                    description: Description of this plan step.
                  started_at:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    description: >-
                      Unix timestamp when this step started. Null if not yet
                      started.
                  end_at:
                    type:
                      - integer
                      - 'null'
                    format: int64
                    description: >-
                      Unix timestamp when this step finished. Null if not yet
                      completed.
        new_plan_step:
          type: object
          description: >-
            Present when type="new_plan_step" (verbose=true only). A new step
            was added to the plan.
          properties:
            step_id:
              type: string
              description: Unique identifier for the new plan step.
            title:
              type: string
              description: Description of the new plan step.
        explanation:
          type: object
          description: >-
            Present when type="explanation" (verbose=true only). The agent's
            internal reasoning or thought process.
          properties:
            content:
              type: string
              description: The agent's explanation of its reasoning or approach.
        structured_output_result:
          type: object
          description: >-
            Present when type="structured_output_result". Contains the extracted
            structured data. Appears after the status_update (stopped) event
            when the task was created with a structured_output_schema.
          properties:
            success:
              type: boolean
              description: >-
                Whether the agent produced a meaningful result. When false,
                value contains schema-conforming defaults and error explains
                what happened.
            value:
              type: object
              description: >-
                The extracted value conforming to the schema provided in
                structured_output_schema. Always present and valid, even when
                success is false — see [zero-value
                rules](https://open.manus.ai/docs/v2/structured-output#when-success-is-false).
            error:
              type:
                - string
                - 'null'
              description: >-
                Error description when success is false. Null when success is
                true.
    ErrorResponse:
      type: object
      description: Standard error response format returned when a request fails.
      properties:
        ok:
          type: boolean
          example: false
          description: Always false for error responses.
        request_id:
          type: string
          description: >-
            Unique identifier for this API request, useful for debugging with
            support.
        error:
          type: object
          description: Error details.
          properties:
            code:
              type: string
              description: >-
                Machine-readable error code (e.g., "invalid_argument",
                "not_found", "permission_denied", "rate_limited").
            message:
              type: string
              description: Human-readable error description explaining what went wrong.
    TaskAttachment:
      type: object
      description: A file or media attachment in a task message.
      properties:
        type:
          type: string
          enum:
            - image
            - file
            - voice
            - slides
          description: |-
            Type of attachment.

            - `image` — image.
            - `file` — document.
            - `voice` — audio recording.
            - `slides` — presentation slides.
        filename:
          type: string
          description: Display name of the attachment file.
        url:
          type: string
          description: URL to download the attachment content.
        path:
          type: string
          description: >-
            Optional execution-environment path referenced by the message body.
            Match it to a Markdown link or image destination, then use url to
            download the attachment. This path is not itself downloadable.
        content_type:
          type: string
          description: MIME type of the attachment (e.g., "application/pdf", "image/png").
        file_uid:
          type: string
          description: >-
            Stable identifier of the backing output file. Present with
            `version_uid` when the attachment has a download URL and file
            identity. See
            [Attachments](https://open.manus.ai/docs/v2/attachments#file-paths).
        version_uid:
          type: string
          description: >-
            Stable identifier of the backing output file version. Present with
            `file_uid`. See
            [Attachments](https://open.manus.ai/docs/v2/attachments#file-paths).
        cover_image:
          type: string
          description: >-
            Signed URL of the attachment cover image. Present only on
            `assistant_message.attachments` when `include_cover=true` and
            `cover_image_status` is `ready`; never present on
            `user_message.attachments`. Each URL is valid for 48 hours and is
            re-signed on every response; read a fresh URL from the next response
            instead of storing one. See [Cover
            images](https://open.manus.ai/docs/v2/attachments#cover-images).
        cover_image_status:
          type: string
          enum:
            - ready
            - pending
            - unsupported
          description: >-
            Cover image state. Present only on `assistant_message.attachments`
            when `include_cover=true`; never present on
            `user_message.attachments`. Omitted together with `cover_image` when
            the cover lookup fails for a response.


            - `ready` — `cover_image` holds the cover URL.

            - `pending` — a cover is supported but not available yet; request
            again later.

            - `unsupported` — this attachment has no cover.


            See [Cover
            images](https://open.manus.ai/docs/v2/attachments#cover-images).
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-manus-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.