---
title: "Cancel a task"
method: DELETE
path: "/api/v1/tasks/{id}"
tags: ["Tasks"]
---

# Cancel a task

`DELETE /api/v1/tasks/{id}`

## Request

- Base URL: `https://www.zen-mode.io`
- URL: `https://www.zen-mode.io/api/v1/tasks/{id}`
- Auth: HTTP bearer

Only a task that has not started can be cancelled.

## Path parameters

- `id` string, required

## Response `200`

Cancelled.

- object
  - `task` object
    - `id` string: Task id, e.g. `task_mb3k2x1c_q8z0v7ke`.
    - `status` string

## Other responses

- `401`: Missing, malformed or invalid Authorization header, or an unknown API key.
- `403`: The key is valid but the account's plan does not include API access.
- `404`: Task not found for this account.
- `429`: Rate limit exceeded (100 requests/minute). Carries `Retry-After`.

---

[API](https://skmtc.dev/zen-mode/apis/zenmode-api.md) · [All operations](https://skmtc.dev/zen-mode/apis/zenmode-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zen-mode/apis/zenmode-api/revisions/2769372f1e3f?raw)
