---
title: POST /api/v1/runs/{run_guid}/cancel
description: Cancel Run
locale: en
version: 0.2.0
canonical: https://enterium-developer-docs.pages.dev/developers/api/runs/post-runs-run-guid-cancel/
---

> Documentation index: https://enterium-developer-docs.pages.dev/developers/llms.txt — every page of this portal has a Markdown twin at <route>.md; the frozen API contract is at https://enterium-developer-docs.pages.dev/developers/api/openapi.json.

:::note
Generated from the OpenAPI contract — do not edit by hand. Interactive explorer with full schemas: [https://entherium.duckdns.org:8443/reference](https://entherium.duckdns.org:8443/reference); frozen spec for this build: [openapi.json](/developers/api/openapi.json). Group: [runs](../).
:::

Cancel Run

Cancel a run. A queued run is cancelled immediately; a run that is already
executing is marked cancelled but finishes its current execution (mid-flight
interruption is not implemented). Idempotent: a terminal run answers 409.

**Auth:** `Authorization: Bearer <token>` required

## Request

```sh
curl -sS -X POST "https://entherium.duckdns.org:8443/api/v1/runs/<run_guid>/cancel" \
  -H "Authorization: Bearer <token>"
```

## Response `200`

```json
{
  "createtime": "2026-09-03T02:14:04Z",
  "current_step": "make_article_structure",
  "entity_guid": 31567,
  "entity_name": "generated_articles",
  "guid": 1842,
  "metrics": {
    "llm_calls": 11
  },
  "mode": "live",
  "pipeline_id": "generate",
  "started_at": "2026-09-03T02:14:05Z",
  "started_by": "agent@entherium.dev",
  "status": "running",
  "steps_done": 7,
  "steps_total": 18,
  "trigger": "api",
  "updatetime": "2026-09-03T02:19:40Z"
}
```

## Returns

`PipelineRunRead` — Successful Response

| Field | Type | Description |
| --- | --- | --- |
| `createtime` | `string` |  |
| `current_step` | `string \| null` (opt.) |  |
| `entity_guid` | `integer` |  |
| `entity_name` | `string` |  |
| `error` | `string \| null` (opt.) |  |
| `error_step` | `string \| null` (opt.) |  |
| `finished_at` | `string \| null` (opt.) |  |
| `guid` | `integer` |  |
| `metrics` | `object` (opt.) |  |
| `mode` | `string` |  |
| `pipeline_id` | `string` |  |
| `started_at` | `string \| null` (opt.) |  |
| `started_by` | `string \| null` (opt.) |  |
| `status` | `string` |  |
| `steps_done` | `integer` |  |
| `steps_total` | `integer` |  |
| `trigger` | `string` |  |
| `updatetime` | `string` |  |

## Parameters

| Parameter | In | Required | Type | Default | Constraints | Description |
| --- | --- | --- | --- | --- | --- | --- |
| `run_guid` | path | yes | `integer` | — | — |  |
| `Idempotency-Key` | header | no | `string` | — | uuid | Optional. |

## Errors

| Code | Meaning | Body |
| --- | --- | --- |
| `401` | Missing or invalid authentication credentials | `ErrorResponse` |
| `409` | The run is already terminal | `ErrorResponse` |
| `422` | Validation Error | `HTTPValidationError` |

Every error body is `{detail, code?, request_id, doc_url}` — `request_id` is the value to quote, `doc_url` points at the [Errors reference](../../../reference/errors/).
