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

# Cancel an execution

> Ask a running execution of yours to stop. Cancellation is cooperative.


## OpenAPI

```yaml openapi.json post /v1/workflows/executions/{id}/cancel
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.1.0
servers:
  - url: https://api.plungeai.com
paths:
  /v1/workflows/executions/{id}/cancel:
    post:
      summary: Cancel a running workflow execution (cooperative)
      description: Writes the SharedMemory cancel marker the engine and agent loops poll at their next turn/tool boundary, and stamps the row cancelled. Wrong owner → 404 (no existence leak); not running → 409. Since /v1/workflows/execute is synchronous, pass your own x-trace-id on the execute call and use it as {id} here.
      security:
        - ozkBearer: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  cancelled:
                    type: string
                    description: The execution id
                  markers:
                    type: array
                    items:
                      type: string
                    description: Run ids the cancel marker was written under (row id + engine cln id)
        "404":
          description: not_found — no such execution for this key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: not_running — the execution already finished or was cancelled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    Error:
      type: object
      description: Standard error envelope. Every error response also carries an `X-Error-Code` response header equal to error.code, so a client branches on the header regardless of the negotiated body format (json | yaml | markdown | text). When the request created an execution, the `X-Execution-Id` response header is also set. Errors follow the negotiated format like success bodies.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
          additionalProperties: true
      required:
        - error
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
```
