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

# Cancel a run

> Idempotently cancel an in-flight or queued run. The owning replica aborts the run and a terminal `cancelled` event lands on any watching SSE stream.

**Requires:** `workflows:invoke`



## OpenAPI

````yaml https://api.getmodus.com/openapi.json post /agent/v1/runs/{runId}/cancel
openapi: 3.0.3
info:
  title: Modus Public API
  version: 1.0.0
servers: []
security:
  - bearerAuth: []
tags:
  - name: Scopes
    description: Create, configure, deploy, and manage scopes.
  - name: Scopes · Conversations
    description: Read scope conversation threads.
  - name: Scopes · Supervision
    description: Scope supervision sub-resource.
  - name: Scopes · Memories
    description: Long-term memory stored per scope.
  - name: Scopes · Chat
    description: Chat with a published scope.
  - name: Scopes · Context
    description: Compose a scope’s context without an LLM call.
  - name: Modus · Chat
    description: Chat with Modus — your org-wide assistant.
  - name: Modus · Conversations
    description: Read Modus and cross-scope conversation threads.
  - name: Modus · Context
    description: Compose full-environment context without an LLM call.
  - name: Workflows
    description: Create, configure, deploy, and manage workflows.
  - name: Workflows · Runs
    description: Inspect workflow run history.
  - name: Workflows · Interfaces
    description: Slack / MCP / Teams interface management.
  - name: Connections
    description: Read connected integrations.
  - name: Tools
    description: Catalog of tools/integrations a scope can select in its toolset.
  - name: Suggestions
    description: Approved suggested questions and first-party suggestion usage events.
  - name: Context
    description: Create and manage organization context items.
  - name: Usage
    description: Organization LLM usage reporting.
  - name: Users
    description: Organization and membership management.
  - name: Runs · Streaming
    description: 'Run lifecycle: stream, poll, resume, interrupt, and cancel executions.'
  - name: Scopes · Runs
    description: Run a published or draft scope.
  - name: Modus · Runs
    description: Run the Modus home agent.
paths:
  /agent/v1/runs/{runId}/cancel:
    post:
      tags:
        - Runs · Streaming
      summary: Cancel a run
      description: >-
        Idempotently cancel an in-flight or queued run. The owning replica
        aborts the run and a terminal `cancelled` event lands on any watching
        SSE stream.


        **Requires:** `workflows:invoke`
      operationId: RunLifecycleController_cancel
      parameters:
        - name: runId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelRunDto'
      responses:
        '204':
          description: ''
      security:
        - bearerAuth: []
      servers:
        - url: https://agent.getmodus.com
components:
  schemas:
    CancelRunDto:
      type: object
      properties:
        organizationId:
          type: string
          description: >-
            Organization the run belongs to. Omit for PAT/SDK callers — falls
            back to the authenticated principal's org.
        reason:
          type: string
          description: Human-readable reason for the cancel, logged server-side only.
        lastSeenEventId:
          type: string
          description: >-
            Redis Stream id of the last SSE frame the client rendered, so the
            persisted partial message matches what the client saw. Falls back to
            the server-side accumulator when absent.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      bearerFormat: Modus PAT (modus_<orgUuid>_<prefix>_<secret>) or OAuth 2.1 access token
      type: http
      description: >-
        A Modus personal access token (`modus_<orgUuid>_<prefix>_<secret>`) or
        an OAuth 2.1 access token, sent as `Authorization: Bearer <token>`.

````