API v1

Cancel a video task

POST/v1/video/tasks/{task_id}/cancel

Requires service.use permission and Idempotency-Key.

View Markdown
  • Put your API key after Authorization: Bearer; send no request body.
  • Send an Idempotency-Key; the same key replays the original response.
  • Before generation starts, cancellation takes effect at once: the task becomes cancelled and the whole reservation is released.
  • After generation starts, the answer is not_effective; the task continues and is settled as usual.

Headers

#AuthorizationstringRequired

Bearer, a space and your API key. A missing or invalid key returns 401 authentication_failed.

#X-Request-IDstring

Your own request identifier. An invalid or repeated value is replaced; the value used comes back in the X-Request-ID response header.

#Idempotency-KeystringRequired

Generate a new value for every new request and save it; it starts with a letter or digit. When the outcome is unknown, retry with the same key and the original body to get the original response; the same key with a different body returns 409 idempotency_conflict. Keys belong to your team, not to one API key.

Length8–128CharactersA–Z a–z 0–9 . _ : -

Path parameters

#task_idstringRequired

ID of the video task to retrieve

ReturnsHTTP 202

A permanent snapshot of the cancellation operation. effective means Cancelled; not_effective means Not cancelled. Continue checking the task and its billing.

#task_idstringRequired

Video Task ID belonging to your team.

Length4–128CharactersA–Z a–z 0–9 _ -
#cancel_operation_idstringRequired

Stable Cancellation ID. New idempotency keys for the same task refer to this same ID.

Length4–128CharactersA–Z a–z 0–9 _ -
#cancel_statusstringRequired

Cancellation status. Reports Cancelled or Not cancelled immediately.

requestedRequested
effectiveCancelled
not_effectiveNot cancelled
failedFailed
#task_status_at_responsestringRequired

Task status saved when this idempotency key first receives a response. Replays keep this saved status.

queuedQueued
processingProcessing
succeededSucceeded
failedFailed
cancelledCancelled
#reason_codestringRequiredNullable

Null when cancellation takes effect; generation_already_started when generation has already started and the task is not cancelled.

Length1–96Charactersa–z 0–9 _

Response headers

#X-Request-IDstringRequired

The identifier of this request: the valid value you sent, or its replacement.

#LocationstringRequired

Canonical relative lookup path for the accepted object.

Status codes

Each error.code and what to do about it is on Error codes.

StatusMeaning and error.code
202A permanent snapshot of the cancellation operation.
Response headersLocation
400The submitted request is not valid.
401The API key is missing or invalid.
Response headersWWW-Authenticate
404No task with this ID is visible to your team.
409The idempotency key belongs to a different request, or the finished task has no cancellation operation to refer to.
429The request rate limit blocks this read operation.
Response headersRetry-After
500Internal error.
503The service is temporarily unavailable.