Skip to main content
Questions or issues? Contact us at api-support@manus.ai. After creating a task with task.create, the agent runs asynchronously. Use task.listMessages to poll for events and track progress. Also read task.detail before treating a stopped Agent run as complete, because background work can continue independently. For push delivery, set up Webhooks.

Task status

Look for status_update events in the response. The agent_status field tells you what to do next: has_running_background_jobs in task.detail is optional and independent of agent_status:
  • true — the current execution still has non-blocking background work in pending, queued, or running state. Poll until your application deadline, then report the completion state as unknown.
  • false — no such active background Job is known. Read the results.
  • Omitted — the value is unknown, typically an older task or a transient read failure; a later poll may fill it in. Do not treat omission as false. Poll until your application deadline, then report the completion state as unknown.
A later user message, schedule, or external trigger can start the same Task again even after the current execution has no active background work.

Handling waiting status

Read status_detail.waiting_for_event_type. It falls into one of three cases: Sending any ordinary message while an action is pending skips that action; the agent continues from your message. No schema-specific input is needed. Unlisted configuration and OAuth targets need the Manus UI or an external authorization flow. They are not tool_used events; fetching them with verbose=true&start_event_id=<waiting_for_event_id> returns Event not found.

Answer an agent question

When the agent supplies choices, the corresponding assistant_message includes a question_expectation object:
To answer:
  1. Collect the user’s selection or free text.
  2. Send a non-empty answer as ordinary message.content through task.sendMessage. For multiple choices, combine the selected text into one readable message. There is no required delimiter, option-ID array, or structured submission format.
  3. Do not submit an empty answer when nothing is selected; ask the user for text instead.
Example answer:
Edge cases:
  • A question with no choices has no question_expectation in task.listMessages. Use the question text and the waiting event type to request a free-text answer. Webhooks may describe the same question with options: [].
  • If a client encounters an unknown response_method, stop automatic dispatch and check the current API documentation rather than falling back to action confirmation.
  • Neither question ID is required by task.sendMessage, and it is not a send-message idempotency key.

Confirm an action

When an action needs confirmation, the waiting status_detail gives its target event ID and the expected input schema:
The waiting event tells you how to respond. The event identified by waiting_for_event_id tells you what the user is approving. If that event is not in the current response window, fetch it explicitly:
The referenced Gmail event contains the structured tool input:
Use R0ayNknItM38cc6a2DbB4W as task.confirmAction.event_id. X0SCXV59huUdjxubJrOYyx is the tool action ID and may also identify a rollback projection. Do not use it instead of waiting_for_event_id. What the target event exposes:
  • Connector confirmations (Gmail, Google Calendar, Outlook Mail, Outlook Calendar, Shopify delete operations, Instagram publishing, Meta Marketing account and mode selection) expose the original structured params. Result-driven confirmations may also expose a structured result.
  • Connector creation, update, deletion, configuration suggestions, and Agent configuration cards require the Manus UI when the API does not expose enough structured context to build the schema input safely.
  • Expired OAuth events require the account to complete the external authorization flow before the pending operation can continue.
Fetching the target event:
  • tool_used events normally require verbose=true.
  • A waiting status does not force its target event into the current page. Use verbose=true with start_event_id=waiting_for_event_id when the target is outside the current response window.
  • Profile Agent connector confirmations that exist only in a Cascade sub-lane are not exposed through the main task event timeline.

Using task.confirmAction

The input format varies by waiting_for_event_type. Build it according to confirm_input_schema. Use the referenced tool params and result to explain the operation and populate schema fields when applicable. The table below provides common examples. The absence of a schema does not turn an action confirmation into an agent question.
Only submit input that matches confirm_input_schema or is explicitly documented for the event type. Some events support { "accept": false } as a real cancellation, while others do not consume it and remain waiting. Do not invent a generic cancel input. If the input is valid but the event does not consume it, task.confirmAction returns confirmed: false and the task remains waiting. To skip the action without a schema-specific input, send an ordinary message through task.sendMessage; the agent continues from your message.

Using My Browser

You can let the agent use your local browser. When the agent needs a browser during execution, it will trigger a needConnectMyBrowser waiting event. Use browser.onlineList to get available clients, then select one via task.confirmAction:
If browser.onlineList returns an empty list, no browser clients are online. Install and enable the Manus Browser Extension first.

Complete flow

Structured Output: If you need the result in a specific JSON format, pass structured_output_schema when creating the task. See the Structured Output guide.