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

# Cancel Workflow Run

> Cancel a running workflow execution.

## Authentication

Requires a JWT token or API key in the `Authorization` header.

```bash theme={"dark"}
Authorization: Bearer YOUR_TOKEN
```

## Request

<ParamField path="id" type="string" required>
  The run ID to cancel.
</ParamField>

### Example request

```bash theme={"dark"}
curl -X POST "https://encrata.com/api/workflows/runs/run_def456/cancel" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Response

```json theme={"dark"}
{
  "success": true,
  "message": "Run cancelled",
  "id": "run_def456",
  "status": "cancelled"
}
```

<Note>
  Only runs with status `queued` or `running` can be cancelled. Already completed or failed runs cannot be cancelled.
</Note>
