> ## Documentation Index
> Fetch the complete documentation index at: https://schedy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a task

> DELETE /tasks/{id} - soft-cancel a task, keeping it in history for auditing.

```
DELETE /tasks/{id}
```

Cancels a task. A non-terminal task is **soft-cancelled**: marked `cancelled` and kept in history (it expires via TTL), so the record survives for auditing. Already-terminal tasks are a no-op.

```bash theme={null}
curl -X DELETE http://localhost:8080/tasks/b1e2c3... -H "X-API-Key: your-secret"
```

## Responses

| Response         | Meaning                          |
| ---------------- | -------------------------------- |
| `204 No Content` | Cancelled (or already terminal). |
| `404 Not Found`  | Task doesn't exist.              |
