---
title: "Cancel Execution"
method: POST
path: "/api/workflows/{team_key}/executions/{execution_key}/cancel"
tags: ["workflows"]
---

# Cancel Execution

`POST /api/workflows/{team_key}/executions/{execution_key}/cancel`

## Request

- Base URL: `https://api.superit.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.superit.ai/api/workflows/{team_key}/executions/{execution_key}/cancel`
- Auth: HTTP bearer

## Path parameters

- `execution_key` string, required
- `team_key` string, required

## Response `200`

Successful Response

- ExecutionDetail
  - `key` string, required
  - `slug` string, nullable, required
  - `actionKey` string, required
  - `actionName` string, required
  - `status` 'pending' | 'waiting_for_approval' | 'approved' | 'not_approved' | 'running' | 'error' | 'complete' | 'cancelled', required
  - `mode` 'normal' | 'test'
  - `script` string, required
  - `runtime` 'powershell' | 'python' | 'playwright', required
  - `inputsSchema` InputField[], nullable
    - `name` string, required
    - `type` 'string' | 'email' | 'boolean' | 'date' | 'enum' | 'string[]' | 'textarea', required
    - `label` string, required
    - `required` boolean
    - `choices` string[], nullable
    - `default` string, nullable
  - `approvalSchema` InputField[], nullable
    - `name` string, required
    - `type` 'string' | 'email' | 'boolean' | 'date' | 'enum' | 'string[]' | 'textarea', required
    - `label` string, required
    - `required` boolean
    - `choices` string[], nullable
    - `default` string, nullable
  - `requesterUserKey` string, required
  - `requesterName` string, nullable, required
  - `targetUserKey` string, nullable, required
  - `targetDeviceKey` string, nullable
  - `targetDeviceHostname` string, nullable
  - `targetDeviceAgentKey` string, nullable
  - `ticketKey` string, nullable
  - `triggerSource` 'manual' | 'sparky_chat' | 'schedule' | 'ticket_recommendation': What initiated an execution. Set server-side per callsite, never from a request body — provenance on an audit record must not be forgeable. Rows created before this field existed are NULL ("unknown"); there is no data from which to recover their origin.
  - `chatKey` string, nullable
  - `recommendedActionKey` string, nullable
  - `origin` ExecutionOrigin: Human-readable labels resolved for the linked ticket/chat/recommendation. The raw keys live on ``ExecutionDetail`` (they are columns and always present); this carries only what needs a cross-domain lookup. Every field degrades to None — the ticket, chat, or recommendation may have been deleted since the run, and the execution must still render.
    - `ticketNumber` string, nullable
    - `ticketSubject` string, nullable
    - `chatSummary` string, nullable
    - `chatCreatedAt` string, date-time, nullable
    - `recommendedActionKind` string, nullable
    - `recommendedActionLabel` string, nullable
    - `agentRunKey` string, nullable
  - `approvedByUserKey` string, nullable, required
  - `approvedByName` string, nullable, required
  - `approvedAt` string, date-time, nullable, required
  - `approvalNote` string, nullable
  - `inputs` object, required
  - `approvalInputs` object, nullable, required
  - `stdout` string, required
  - `stderr` string, required
  - `resultJson` object, nullable, required
  - `errorMessage` string, nullable, required
  - `diagnosticLog` string, required
  - `startedAt` string, date-time, nullable, required
  - `completedAt` string, date-time, nullable, required
  - `createdAt` string, date-time, required
  - `totalDurationMs` integer, nullable
  - `scriptDurationMs` integer, nullable
  - `scriptTimeoutSeconds` integer, nullable

## Other responses

- `400`: Invalid input
- `401`: Not authenticated
- `403`: Forbidden
- `404`: Not found
- `405`: Method not allowed
- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/superit/apis/super-it-api.md) - [All operations](https://skmtc.dev/superit/apis/super-it-api/llms.txt) - [OpenAPI document](https://skmtc.dev/superit/apis/super-it-api/revisions/4944d556c2bb?raw)
