---
title: "Cancel a pending or running task"
method: POST
path: "/tasks/{task_id}/cancel"
tags: ["Tasks"]
---

# Cancel a pending or running task

`POST /tasks/{task_id}/cancel`

## Request

- Base URL: `https://api-docs.jackhamr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.jackhamr.ai/tasks/{task_id}/cancel`
- Auth: none declared

Cancel a pending, running, or paused task. 409 otherwise.

## Path parameters

- `task_id` string, required

## Response `200`

Successful Response

- TaskActionResponse: Lifecycle action acknowledgment (pause/resume/cancel/retry).
  - `task_id` string, required
  - `action` string, required
  - `status` string, required
  - `message` string, required
  - `timestamp` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jackhamr/apis/jackhamr-api.md) · [All operations](https://skmtc.dev/jackhamr/apis/jackhamr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/jackhamr/apis/jackhamr-api/revisions/f75d221481d8?raw)
