Skip to Content

Cancel video

Cancel an in-progress video generation task. A task can be cancelled only while it is still running — once it reaches a terminal state (completed, failed, cancelled, expired), it can no longer be cancelled.

DELETE https://api.ofox.ai/v1/videos/{id}

Cancellation depends on the upstream provider. Ofox accepts a cancel request only when the upstream provider genuinely supports interruption — it never reports a fake success by marking the task cancelled locally while the upstream keeps generating. Providers that cannot interrupt a running job return 400 cancel_not_supported.

Request

Terminal
curl -X DELETE https://api.ofox.ai/v1/videos/9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718 \ -H "Authorization: Bearer $OFOX_API_KEY"

Response

A successful cancel returns 204 No Content with an empty body.

HTTP/1.1 204 No Content

After a successful cancel the task’s status becomes cancelled. Polling GET /v1/videos/{id} then returns the cancelled terminal state, and if you registered a callback_url you also receive a video.generation.cancelled webhook.

Cancellation behavior

Whether a cancel is accepted depends on the task’s current state and on whether the upstream provider supports interruption:

Task stateBehaviorResponse
pending (not yet submitted upstream)Cancelled locally204
queued / in_progress, provider supports interruptionUpstream cancel is called, then the task is marked cancelled on success204
queued / in_progress, provider does not support interruptionRejected (no fake success)400 cancel_not_supported
Already in a terminal stateRejected400 cancel_failed
Not found / not owned by your keyUnified response (prevents existence disclosure)404 not_found

A task that does not exist and a task owned by a different API key return the same 404 not_found, so the response never reveals whether a given task id exists.

Errors

HTTPcodeMeaning
400cancel_not_supportedThe upstream provider does not support interrupting a running job
400cancel_failedThe task is already in a terminal state and cannot be cancelled
404not_foundThe task does not exist, or it is not owned by your API key

Errors use the shared error object:

{ "error": { "code": "cancel_not_supported", "message": "The upstream provider for this task does not support cancellation." } }

See the full error reference for every code. DELETE is not subject to the polling rate limit that applies to GET — see Get video status for details.

Last updated on