Skip to content

Usage

The core workflow is: create a task, poll for events until the agent stops, then read the result.

Minimal example: create a task and poll for completion

Step 1 - Create a task

bash
curl -X POST https://api.manus.ai/v2/task.create \
  -H "Content-Type: application/json" \
  -H "x-manus-api-key: $MANUS_API_KEY" \
  -d '{"message": {"content": "Summarize the top 3 AI news stories today"}}'

Success response:

json
{
  "ok": true,
  "request_id": "req_abc123",
  "data": {
    "task_id": "task_xyz789",
    "agent_status": "running"
  }
}

Step 2 - Poll for events

bash
curl "https://api.manus.ai/v2/task.listMessages?task_id=task_xyz789" \
  -H "x-manus-api-key: $MANUS_API_KEY"

Poll until agent_status is one of:

StatusMeaning
runningAgent is working; keep polling
waitingAgent needs confirmation before continuing
stoppedTask complete; read results from assistant_message events
errorFailed; check error_message

Step 3 - Confirm an action (if waiting)

bash
curl -X POST https://api.manus.ai/v2/task.confirmAction \
  -H "x-manus-api-key: $MANUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "task_xyz789",
    "event_id": "evt_abc123",
    "input": {"accept": true}
  }'

Multi-turn conversation

Send follow-up messages to a running or stopped task:

bash
curl -X POST https://api.manus.ai/v2/task.sendMessage \
  -H "x-manus-api-key: $MANUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task_id": "task_xyz789",
    "message": {"content": "Now format those stories as a bullet list"}
  }'

Webhook alternative to polling

Register a webhook to receive push notifications instead of polling:

bash
curl -X POST https://api.manus.ai/v2/webhook.create \
  -H "x-manus-api-key: $MANUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://your-server.com/manus-hook", "events": ["task.stopped"]}'

API error response shape

All errors follow this structure:

json
{
  "ok": false,
  "request_id": "req_def456",
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Retry after 60 seconds."
  }
}

Error codes: invalid_argument, not_found, permission_denied, rate_limited.