> ## 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 Step

Use this API to admin-cancel a specific step. The step transitions to `cancelled`, no downstream edges fire from it, and a `step.cancelled` event is emitted.

# Endpoint

`POST https://api.velt.dev/v2/workflow/steps/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 containing the step.
    </ParamField>

    <ParamField body="stepId" type="string" required>
      The step to cancel.
    </ParamField>

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

    <ParamField body="actorId" type="string" required>
      1–256 chars. Identifier of the administrator initiating the cancellation. Recorded on the `step.cancelled` audit event.
    </ParamField>
  </Expandable>
</ParamField>

<Note>
  **Workspace-admin RBAC is post-GA.** Today this endpoint gates on the standard `x-velt-auth-token` only. Until role-based access lands, restrict who can call `/steps/cancel` inside your own application.
</Note>

## **Example Requests**

#### Admin-cancel a step

```JSON theme={null}
{
  "data": {
    "executionId": "exec_1777374504255_xzy43k9q",
    "stepId": "step_agent-draft_..._lwofay__to__human-brand",
    "reason": "Reviewer unavailable",
    "actorId": "admin_jane"
  }
}
```

# Response

#### Success Response

```JSON theme={null}
{
  "result": {
    "cancelled": true,
    "executionId": "exec_1777374504255_xzy43k9q",
    "stepId": "step_agent-draft_..._lwofay__to__human-brand"
  }
}
```

#### Failure Response

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

**Errors:** `INVALID_ARGUMENT` (schema validation) / `FAILED_PRECONDITION` (step already terminal) / `NOT_FOUND`.

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "cancelled": true,
      "executionId": "exec_1777374504255_xzy43k9q",
      "stepId": "step_agent-draft_..._lwofay__to__human-brand"
    }
  }
  ```
</ResponseExample>
