Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Use DELETE /v1/tasks/{id} to cancel an asynchronous task that has not started running yet. Use the same task ID from the create response or the returned poll_url.

Supported Tasks

Cancellation is currently supported for queued Volcengine Seedance video tasks using seedance-1.5-pro, seedance-2.0, or seedance-2.0-fast. Tasks that are already processing/running cannot be cancelled. Completed, failed, expired, or unsupported tasks are kept queryable for status and billing reconciliation instead of deleting upstream records.

Path Parameters

id
string
required
The async task ID returned by the create request or embedded in poll_url.

Response

id
string
Canonical async task identifier.
task_id
string
Async task identifier alias.
poll_url
string
Preferred polling URL for the task. It remains valid after cancellation.
status
string
Task status. A successfully cancelled task is returned as failed with cancelled: true for compatibility with existing status values.
cancelled
boolean
true when the task was cancelled before execution.
cancellation_status
string
Cancellation marker. The value is cancelled when cancellation succeeds.
error
string
Cancellation reason or task failure message.

Error Behavior

400 unsupported_task_cancel means the task type, provider, or model does not support cancellation. 409 task_not_cancellable means the task is already processing, terminal, or otherwise no longer cancellable. 403 means the API key cannot access the task.

Example

curl -X DELETE "https://api.lemondata.cc/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" \
  -H "Authorization: Bearer sk-your-api-key"
Response
{
  "id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "task_id": "ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "poll_url": "/v1/tasks/ldtask_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "status": "failed",
  "cancelled": true,
  "cancellation_status": "cancelled",
  "error": "Task cancelled before execution"
}