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

# Cancel Run

> Stops the run for good and closes out its un-dialled conversations. Terminal - there is no resume. A call already connected is left to finish; its retry is refused rather than rescheduled.

Stops a run for good.

## Terminal, unlike pause

Cancel closes out the run's un-dialled conversations and there is **no way back** — no resume, and attaching a contact to a cancelled run is a `422`. If you want to stop temporarily, [pause](/api-reference/runs/pause-run) instead.

A call that is already connected is left to finish. Its retry is refused rather than rescheduled, so the run stops growing without cutting somebody off mid-sentence.

```json theme={null}
{ "status": "CANCELLED", "affectedCalls": 30 }
```

`affectedCalls` is how many un-dialled calls were closed out.

## What survives

The conversations the run already produced. They are separate resources: their transcripts, recordings and analysis stay readable at `/conversations/{id}`, with `runId` still populated. Cancelling stops future calls; it does not erase the ones that happened.

## Cancel before you delete

A run must be inert before it can be deleted, and cancel is what makes an active run inert. See [Delete Run](/api-reference/runs/delete-run).

## Error Scenarios

* **404 Not Found**: the run does not exist, or belongs to another company
* **422 Unprocessable Entity**: the run is already cancelled or completed
* **403 Forbidden**: the API key does not hold `write:runs`

## Related Resources

<CardGroup cols={2}>
  <Card title="Pause Run" icon="pause" href="/api-reference/runs/pause-run">
    Stop reversibly instead
  </Card>

  <Card title="Delete Run" icon="trash" href="/api-reference/runs/delete-run">
    Remove it once it is inert
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /runs/{id}/cancel
openapi: 3.0.0
info:
  title: InstaView API
  description: |-
    InstaView API Documentation

    ## Authentication

    All endpoints require API key authentication using Bearer token:
    ```
    Authorization: Bearer sk_your_api_key_here
    ```

    ## API Key Management

    The API Key module provides comprehensive key management for:
    - **Direct Client Keys**: Company-scoped keys for your applications
    - **ATS Partner Keys**: Resource-scoped keys for ATS integrations

    ### Key Features
    - HMAC-SHA256 hashing for API key storage
    - Configurable rate limiting
    - Comprehensive audit logging
    - Company-level isolation
    - Resource scoping for ATS partners
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.instaview.sk
    description: Production API Gateway
security: []
tags: []
paths:
  /runs/{id}/cancel:
    post:
      tags:
        - Runs
      summary: Cancel a run
      description: >-
        Stops the run for good and closes out its un-dialled conversations.
        Terminal - there is no resume. A call already connected is left to
        finish; its retry is refused rather than rescheduled.
      operationId: PublicRunsController_cancelRun_v1
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
            format: uuid
        - name: companyId
          required: false
          in: query
          description: >-
            Required for ATS API keys to specify which company to access.
            Ignored for standard company API keys.
          schema:
            type: string
      responses:
        '201':
          description: Transition applied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicRunLifecycleDto'
        '422':
          description: >-
            Unprocessable Entity - the run is not in a status this transition is
            legal from.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer: []
components:
  schemas:
    PublicRunLifecycleDto:
      type: object
      properties:
        status:
          type: string
          description: The run's status after the transition
          enum:
            - DRAFT
            - SCHEDULED
            - RUNNING
            - PAUSED
            - COMPLETED
            - CANCELLED
          example: RUNNING
        affectedCalls:
          type: number
          description: >-
            How many of the run's calls this request moved: queued by a launch,
            withdrawn by a pause, restored by a resume, closed out by a cancel.
            Not calls placed - a 2xx means queued, not dialled.
          example: 42
      required:
        - status
        - affectedCalls
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
          example: Validation failed
        error:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: API key for authentication using Bearer scheme

````