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

# Cancel Execution

Use this API to cancel a running execution. Terminal executions are a no-op.

# Endpoint

`POST https://api.velt.dev/v2/workflow/executions/cancel`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="executionId" type="string" required>
      The execution to cancel.
    </ParamField>

    <ParamField body="reason" type="string">
      ≤ 500 chars. Surfaced on the `execution.cancelled` event.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Cancel an execution

```JSON theme={null}
{
  "data": {
    "executionId": "exec_1777374504255_xzy43k9q",
    "reason": "Campaign postponed"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "cancelled": true,
    "executionId": "exec_1777374504255_xzy43k9q"
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "NOT_FOUND"
  }
}
```

**Errors:** `NOT_FOUND` / `INVALID_ARGUMENT`.

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "cancelled": true,
      "executionId": "exec_1777374504255_xzy43k9q"
    }
  }
  ```
</ResponseExample>
