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

# Cancel a run

> Cancel an in-flight run. The only accepted body is `{ "status": "cancel_requested" }`.



## OpenAPI

````yaml /api-reference/openapi.json patch /migrations/{migration_id}/runs/{run_id}
openapi: 3.1.0
info:
  title: Vern Migration API
  version: 1.0.0
  description: >-
    Run Vern as a headless migration engine. Create a migration, upload a
    customer's files, run the managed agent to generate a preview, then execute
    and export clean data. See the Migration API guides for concepts and
    walkthroughs.
servers:
  - url: https://app.vern.so/api/v1
security:
  - apiKey: []
tags:
  - name: Catalog
    description: Discover the sources and templates you set up in the Vern UI.
  - name: Migrations
    description: Create a migration workspace and upload a customer's files.
  - name: Runs
    description: 'Drive the managed agent: generate, refine, execute, answer, and observe.'
  - name: Export
    description: Download a migration's validated data as CSV.
paths:
  /migrations/{migration_id}/runs/{run_id}:
    parameters:
      - $ref: '#/components/parameters/MigrationId'
      - $ref: '#/components/parameters/RunId'
    patch:
      tags:
        - Runs
      summary: Cancel a run
      description: >-
        Cancel an in-flight run. The only accepted body is `{ "status":
        "cancel_requested" }`.
      operationId: cancelRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - cancel_requested
            example:
              status: cancel_requested
      responses:
        '200':
          description: The run in its updated (canceled) shape.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Run'
              example:
                run_id: d4c3b2a1-...
                status: canceled
                created_at: '2026-06-19T15:32:11.000Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    MigrationId:
      name: migration_id
      in: path
      required: true
      description: The migration ID returned by Create a migration.
      schema:
        type: string
        format: uuid
      example: c0a8012e-4f1b-4d3a-9b2c-7e6f5a4b3c2d
    RunId:
      name: run_id
      in: path
      required: true
      description: The run ID returned by Start a run.
      schema:
        type: string
        format: uuid
      example: d4c3b2a1-9f8e-47d6-b5a4-c3d2e1f0a9b8
  schemas:
    Run:
      type: object
      description: >-
        A run's polled state. Fields beyond run_id/status/created_at depend on
        status.
      properties:
        run_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - queued
            - running
            - blocked
            - awaiting_approval
            - completed
            - failed
            - canceled
        created_at:
          type: string
          format: date-time
        answers:
          type:
            - object
            - 'null'
          description: >-
            A read-back of your last reply, present once you've answered a
            block.
        message:
          type:
            - string
            - 'null'
          description: Present while queued/running.
        blocked_reason:
          type: string
          enum:
            - question
            - credentials
          description: Present when blocked — which kind of block it is.
        questions:
          type: array
          items:
            $ref: '#/components/schemas/Question'
          description: Present when blocked for a question.
        credential_request:
          $ref: '#/components/schemas/CredentialRequest'
        report:
          $ref: '#/components/schemas/Report'
        error:
          type: string
          description: Present when failed.
    Question:
      type: object
      properties:
        id:
          type: string
        question:
          type: string
        context:
          type: string
        options:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              label:
                type: string
        allowCustom:
          type: boolean
    CredentialRequest:
      type: object
      description: >-
        Present when a run is blocked for credentials. Describes the live source
        needing secrets — render a form from `schema` and POST to
        .../credentials. Carries no secret values.
      properties:
        connection_id:
          type: string
          format: uuid
          description: The source connection the secrets belong to.
        source_key:
          type: string
        source_name:
          type: string
        reason:
          type: string
          description: Why the agent needs access. May be absent.
        guidance:
          type: object
          description: >-
            Optional help — { summary?, steps?, links? } — for where to find the
            credentials.
        schema:
          type: object
          description: The fields to collect, keyed by name.
          additionalProperties: true
    Report:
      type: object
      properties:
        inserted:
          type: integer
          description: Total rows imported across all sheets.
        perSheet:
          type: array
          items:
            type: object
            properties:
              templateName:
                type: string
              sheetId:
                type: string
              rowCount:
                type: integer
        invalidCellCount:
          type: integer
          description: Rows that still carry at least one invalid cell.
        coverage:
          type:
            - object
            - 'null'
          description: Optional per-column fill/distinct profile of sources vs. outputs.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
      required:
        - error
  responses:
    BadRequest:
      description: Malformed request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: API key missing, malformed, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The referenced resource isn't in your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit hit — back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Vern API key. Create one at Settings → API keys.

````