Skip to content

Cancel a Task

POST https://maxaeo.ai/geoapi/geodata/developer/task/cancel

Cancels a task that is still waiting in the queue. A canceled task has status canceled, isn’t charged, and its reserved credits are released.

Parameter Type Required Description
task_id string Yes The task ID returned by Submit a task or List tasks, up to 64 characters

The body has task_id only; any extra field returns 1001.

Which tasks you can act on: the same as Retrieve a task — every task the same user submitted in their personal account, no matter which API key was used or whether it was submitted from the Playground in the Developer Console.

Terminal window
curl -X POST "https://maxaeo.ai/geoapi/geodata/developer/task/cancel" \
-H "Authorization: Bearer $MAXAEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task_id": "task_3f6c1d2e-8a4b-4c1f-9e2d-7b5a0c9d1e23"}'

data.ent is the task object, the same structure as Retrieve a task. Read status to see what happened:

status Meaning Credits
canceled The cancel worked Not charged; reserved credits are released
running The task had already started, so it was not canceled and finishes as usual Charged as usual if it succeeds
succeeded / failed The task had already finished, so nothing was canceled As per the task’s own result
  • A queued or pending task can be canceled.
  • A dispatching task (being handed over) may not be cancelable for a moment; it is returned unchanged, so call again shortly. In rare cases a pending task behaves the same way. Any status other than canceled means the task wasn’t canceled.
  • A cancel that doesn’t take effect isn’t an error — ret is still 1, so always check status.
  • Repeated calls don’t error; it’s safe to call again.

Example response for a successful cancel:

{
"ret": 1,
"data": {
"ent": {
"thinking": false,
"task_id": "task_3f6c1d2e-8a4b-4c1f-9e2d-7b5a0c9d1e23",
"platform": "doubao",
"query": "适合程序员的机械键盘推荐",
"status": "canceled",
"answer": "",
"result_json": "",
"share_link": "",
"error_code": "crawl_canceled",
"error_message": "任务已取消",
"started_at": 0,
"finished_at": 1793018460,
"created_at": 1793018425,
"updated_at": 1793018460,
"monitor_date": "2026-10-26",
"priority": 2,
"country": "",
"credits": 0
}
}
}

A canceled task has error_code crawl_canceled, a plain-text error_message (任务已取消, Chinese for “task canceled”), and credits of 0.

A canceled task can’t be retried — calling retry on it returns it unchanged, still canceled. To run it again, submit a new task, which gets a new task_id (task IDs are generated by the server and can’t be chosen).

ret Cause
1001 task_id is missing or longer than 64 characters, or the body contains undefined fields
1030 API key missing or invalid
1031 The task doesn’t exist or doesn’t belong to the current user
-1 Service temporarily unavailable — the task is left unchanged, so you can call again