Skip to main content
POST
/
api
/
v1
/
task
/
{taskId}
/
cancel
curl --request POST \
  --url https://api.maxapi.io/api/v1/task/9db7d1ed-d1e5-4d11-9f3a-61f653b905ad/cancel \
  --header 'Authorization: Bearer <token>'
{
  "code": 0,
  "msg": "ok"
}
{
  "code": 400,
  "msg": "task is already being processed"
}
{
  "code": 400,
  "msg": "task already in terminal state"
}
{
  "code": 404,
  "msg": "task not found"
}
Cancel a task that is still queued. A task can only be cancelled when its status is PENDING. Once a task enters PROCESSING or SUBMITTED, it can no longer be cancelled.
taskId
string
required
The ID of the task to cancel.
curl --request POST \
  --url https://api.maxapi.io/api/v1/task/9db7d1ed-d1e5-4d11-9f3a-61f653b905ad/cancel \
  --header 'Authorization: Bearer <token>'
{
  "code": 0,
  "msg": "ok"
}
{
  "code": 400,
  "msg": "task is already being processed"
}
{
  "code": 400,
  "msg": "task already in terminal state"
}
{
  "code": 404,
  "msg": "task not found"
}