> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aurous-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel or delete a task

> DELETE /v1/contents/generations/tasks/{id} — cancel a queued task for a full refund, or hide a finished one.

`DELETE /v1/contents/generations/tasks/{id}` is the native Seedance cancel/delete verb. What it does depends on the task's current state — Aurous mirrors the provider's state machine.

* **Scope:** `write`
* **Auth:** `X-Api-Key: al_live_…` or `Authorization: Bearer al_live_…`

```bash cURL theme={null}
curl -X DELETE https://api.aurous-labs.com/v1/contents/generations/tasks/vid_01J9Z3K7Q0XY2ABCDEFGHJKMNP \
  -H "X-Api-Key: al_live_…"
# → HTTP 200  {}
```

A successful cancel or delete returns **HTTP 200** with an empty object `{}`.

## State machine

| Task state                                        | What `DELETE` does                                                                                                | Response              |
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------- |
| **Queued** (not yet running)                      | Cancels the task and **releases the credit hold in full** — you are charged 0. A `video.cancelled` webhook fires. | `{}` (200)            |
| **Running**                                       | **Cannot be cancelled.** The provider refuses; Aurous forwards its refusal (status + body) verbatim.              | provider-shaped error |
| **Terminal** (`succeeded` / `failed` / `expired`) | **Hides the record** from retrieve and list. Money and audit rows are never hard-deleted.                         | `{}` (200)            |
| **Already cancelled**                             | Refused (provider parity) — a cancelled task cannot be cancelled again.                                           | provider-shaped error |

<Note>
  **Cancelling while queued is your lever to free pinned credits.** A task's hold
  can pin credits until it runs (or until `execution_expires_after`). If you no
  longer need a queued task, delete it — the hold releases immediately and
  the charge is 0. Once the task is **running** it can no longer be cancelled, and
  it will settle normally on success.
</Note>

## Errors

| Code                                               | HTTP | When                                                                                     |
| -------------------------------------------------- | ---- | ---------------------------------------------------------------------------------------- |
| [`resource_not_found`](/errors#resource_not_found) | 404  | Unknown id, another team's task, or an already-hidden task. Indistinguishable by design. |
| [`insufficient_scope`](/errors#insufficient_scope) | 403  | The API key lacks the `write` scope.                                                     |

A refusal on a **running** or already-**cancelled** task is returned in the provider's own error shape, not remapped — that is the raw contract. See [Errors](/errors) for the envelope and support workflow.
