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

# Cancel pipeline run

> Cancel a pipeline run that is still in progress.

Use the `runId` returned by the [trigger pipeline run API](https://docs.prophecy.ai/api-reference/pipelines/trigger-pipeline-run.md).

The `status` field in the response is one of:

* `cancelling`: Prophecy is stopping the run.
* `cancelled`: The run was stopped.
* `already_finished`: The run had already completed.

`descendantsCancelled` counts runs of other pipelines that this run had started.

A `404` response with `run_not_found` means the run ID is unknown or belongs to a different fabric.


## OpenAPI

````yaml post /api/trigger/pipeline/{runId}/cancel
openapi: 3.0.3
info:
  title: Prophecy API - Pipeline Runs
  description: API for triggering and monitoring pipeline runs
  version: 1.0.0
servers: []
security: []
paths:
  /api/trigger/pipeline/{runId}/cancel:
    parameters:
      - name: runId
        in: path
        description: >-
          ID of the pipeline run to stop, as returned by the trigger pipeline
          run API.
        required: true
        schema:
          type: string
      - name: X-AUTH-TOKEN
        in: header
        description: Prophecy access token
        required: true
        schema:
          type: string
    post:
      tags:
        - Pipeline Runs
      summary: Cancel pipeline run
      description: Cancel a pipeline run that is still in progress.
      operationId: cancelPipelineRun
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - fabricId
              properties:
                fabricId:
                  type: integer
                  format: int64
                  description: >-
                    ID of the fabric the run is on. Send it as a number, without
                    quotes.
            example:
              fabricId: 3
      responses:
        '200':
          description: Cancellation request accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  runId:
                    type: string
                    description: Unique identifier of the pipeline run.
                  status:
                    type: string
                    enum:
                      - cancelling
                      - cancelled
                      - already_finished
                    description: Outcome of the cancellation request.
                  runStatus:
                    type: string
                    description: >-
                      Execution status of the pipeline run at the time of the
                      request.
                  descendantsCancelled:
                    type: integer
                    description: >-
                      Number of runs of other pipelines that this run had
                      started and that were cancelled.
                  message:
                    type: string
                    description: Message that explains the outcome of the request.
              example:
                runId: MDAw-xZGYzYzc3LTYzdsSdfx--LTQ3NTQ1ZYjI2Mw==
                status: cancelling
                runStatus: RUNNING
                descendantsCancelled: 0
                message: <MESSAGE>
        '404':
          description: >-
            `run_not_found`: the run ID is unknown or belongs to a different
            fabric.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.