status: queued; the video is produced in the background and the task moves through its statuses until it reaches a terminal one.
Lifecycle
A task never leaves a terminal status.
The task object
Members that have no value are omitted, except
error. New fields may appear at any time: ignore the ones you don’t know.
Get the result
You have two ways to learn that a task finished.- Webhooks (recommended)
- Polling
Pass
webhook_url when you create the task, or set a default endpoint in the console. Five API sends a signed task.completed, task.failed or task.cancelled event with the full task object. See Webhooks.List tasks
GET /v1/tasks returns the tasks of your account, newest first, across all of its keys. Filter with status, model and created_after, and page with limit (1–100, default 20) and starting_after:
has_more is true. Requests that were rejected at creation (for example with 402) never became tasks and are not listed.
Cancel a task
queued or processing task becomes cancelled immediately and its held credits return to your balance in the same step. A task.cancelled webhook follows. If the model finishes the video after the cancel, the result is discarded and never charged.
Cancelling a task that is already cancelled answers 200 again. Cancelling a completed or failed task answers 409 task_already_terminal.
Retention
outputand the video file stay available untilexpires_at, 7 days after completion.- After that the task is still readable, but without
output, and the file URL stops working. - Download the video (and
cover_urlif you use it) as soon as the task completes, and keep your own copy.