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

> Cancel a running execution (cooperative).


## OpenAPI

```yaml openapi.json post /v1/executions/{id}/cancel
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.3.1
servers:
  - url: https://api.plungeai.com
paths:
  /v1/executions/{id}/cancel:
    post:
      operationId: post-v1-executions-id-cancel
      tags:
        - Executions
      summary: Cancel a running execution (cooperative)
      description: "The same route as POST /v1/workflows/executions/{id}/cancel: writes the cancel marker the engine and agent loops poll at their next turn or tool boundary and stamps the row cancelled."
      security:
        - ozkBearer: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Execution id (the x-execution-id of the run, or its engine id `exec-…`)
      responses:
        "200":
          description: Cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  cancelled:
                    type: string
                  markers:
                    type: array
                    items:
                      type: string
        "401":
          description: unauthorized — missing, invalid or revoked ozk_ key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "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"
        "502":
          description: upstream_error — a store failed; no detail is returned, retry shortly
          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
            connect:
              type: object
              description: "On a 424 connection_required / credential_required: where the missing connection is made."
              properties:
                provider:
                  type: string
                method:
                  type: string
                  enum:
                    - oauth
                    - api_key
                    - wallet
                link:
                  type: string
                  example: POST /v1/connections/stripe/link
          required:
            - code
            - message
          additionalProperties: true
      required:
        - error
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
```
