Endpoint
Description
Cancels a queued or running task. Returns202 Accepted when the cancellation is accepted for processing. If the task has already reached a terminal state, returns 409 Conflict.
Authentication
Required: Yes Include API key in header:Request
Headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | API authentication key |
Content-Type | No | application/json if body provided |
traceparent | No | W3C trace context |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Task ID (Temporal workflow ID) |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
reason | string | No | Optional human-readable reason |
Request Body Schema
Response
202 Accepted
409 Conflict
404 Not Found
401 / 403
Examples
curl
Python (httpx)
JavaScript (axios)
Notes
- Idempotent: repeated calls return
202or409depending on current state. - Cancellation is propagated to child workflows (graceful via
REQUEST_CANCEL).