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

# Cancel a pipeline run



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml post /pipeline-runs/{id}/cancel
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /pipeline-runs/{id}/cancel:
    post:
      tags:
        - PipelineRuns
      summary: Cancel a pipeline run
      operationId: CancelPipelineRun
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - description: >-
            When true, force cancellation: interrupt the runner and bound
            cleanup time
          in: query
          name: force
          schema:
            nullable: true
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/PipelineRun'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    PipelineRun:
      additionalProperties: false
      properties:
        attachedEntityId:
          description: ID of the entity (e.g. Stack) that this run is associated with
          type: string
        completedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
        createdAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
        createdById:
          readOnly: true
          type: string
        description:
          description: User-provided description of this pipeline run.
          minLength: 1
          type: string
        error:
          allOf:
            - $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: User-facing error data, formatted from raw ErrorData stored in DB
          readOnly: true
        id:
          readOnly: true
          type: string
        input:
          additionalProperties: {}
          description: |-
            Manual pipeline input values keyed by input definition key.
            Example: {"image_tag": "v1.2.3", "enable_debug": true}.
          type: object
        isCancellable:
          readOnly: true
          type: boolean
        organizationId:
          readOnly: true
          type: string
        pipelineId:
          type: string
        pipelineVersionId:
          type: string
        queueConditionKey:
          description: >-
            Condition key currently blocking this run, when queued on an
            external condition.
          nullable: true
          readOnly: true
          type: string
        queueReason:
          description: Human-readable reason shown while this run is queued.
          nullable: true
          readOnly: true
          type: string
        queueState:
          allOf:
            - $ref: '#/components/schemas/PipelineRun.QueueState'
          description: Typed queue display state for frontend rendering and linking.
          nullable: true
          readOnly: true
          type: object
        startedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/PipelineRun.Status'
          readOnly: true
        temporalRunId:
          readOnly: true
          type: string
        temporalWorkflowId:
          readOnly: true
          type: string
        triggerMetadata:
          allOf:
            - $ref: '#/components/schemas/Pipeline.TriggerMetadata'
          description: Metadata about the trigger that started this run
          readOnly: true
        updatedAt:
          allOf:
            - $ref: '#/components/schemas/UtcDateTime'
          readOnly: true
        variantId:
          description: ID of the variant to execute.
          type: string
        variantName:
          readOnly: true
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - organizationId
        - status
        - isCancellable
        - pipelineId
        - pipelineVersionId
        - description
        - variantId
        - variantName
        - queueReason
        - queueConditionKey
        - queueState
        - temporalWorkflowId
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    UtcDateTime:
      description: UTC RFC3339 timestamp with a required Z suffix
      format: date-time
      pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$
      type: string
      x-go-type: apitypes.UTCDateTime
      x-go-type-import:
        name: apitypes
        path: ravion/api-go/pkg/apitypes
    PipelineRun.QueueState:
      additionalProperties: false
      properties:
        blockingEntityId:
          description: ID of the entity currently blocking this run.
          type: string
        blockingEntityType:
          allOf:
            - $ref: '#/components/schemas/PipelineRun.QueueBlockingEntityType'
          description: Type of entity currently blocking this run.
        blockingModuleInstanceId:
          description: Blocking module instance ID for stack-output condition queues.
          type: string
        blockingModuleName:
          description: Blocking module display name for stack-output condition queues.
          type: string
        conditionKey:
          description: >-
            Condition key currently blocking this run, when queued on an
            external condition.
          type: string
        conditionKind:
          allOf:
            - $ref: '#/components/schemas/PipelineRun.QueueConditionKind'
          description: >-
            Condition kind currently blocking this run, such as
            STACK_RUN_SUCCEEDED.
        environmentId:
          description: Environment context for constructing frontend links.
          type: string
        preflightBlockedByAdmissionCondition:
          description: >-
            Whether stack-run preflight is currently blocked by an admission
            condition.
          type: boolean
        projectId:
          description: Project context for constructing frontend links.
          type: string
        reason:
          description: Human-readable reason shown while this run is queued.
          type: string
        reasonKey:
          allOf:
            - $ref: '#/components/schemas/PipelineRun.QueueReasonKey'
          description: >-
            Stable machine-readable queue reason key, when persisted in queue
            metadata.
        stackRunPreflightPending:
          description: >-
            Whether final stack config and input resolution is deferred until
            stack-run preflight.
          type: boolean
      required:
        - reason
        - stackRunPreflightPending
        - preflightBlockedByAdmissionCondition
      type: object
    PipelineRun.Status:
      enum:
        - QUEUED
        - IN_PROGRESS
        - PENDING_APPROVAL
        - CANCELLING
        - SUCCESS
        - ERROR
        - CANCELLED
        - TIMEOUT
      type: string
    Pipeline.TriggerMetadata:
      additionalProperties: false
      description: Metadata about the pipeline trigger and webhook event
      properties:
        trigger_given_id:
          description: |-
            User-defined trigger ID from config
            Example:
            trigger_given_id: deploy-on-push
            Optional
          type: string
        trigger_source:
          allOf:
            - $ref: '#/components/schemas/Pipeline.TriggerSource'
          description: |-
            Source of the trigger — webhook, api, dashboard, or stack:destroy
            Example:
            trigger_source: webhook:github
            Required
        webhook_event:
          description: |-
            Webhook event type — push, pull_request, merge_request, etc
            Example:
            webhook_event: push
            Optional
          type: string
        webhook_payload:
          additionalProperties: {}
          description: |-
            Raw webhook payload JSON for webhook-triggered runs
            Optional
          type: object
      required:
        - trigger_source
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    PipelineRun.QueueBlockingEntityType:
      enum:
        - STACK
      type: string
    PipelineRun.QueueConditionKind:
      enum:
        - STACK_OUTPUT_UPDATED
        - STACK_RUN_SUCCEEDED
      type: string
    PipelineRun.QueueReasonKey:
      enum:
        - PIPELINE_WORKFLOW_STARTING
        - STACK_RUN_PREPARING
        - STACK_PIPELINE_WORKFLOW_STARTING
        - CHILD_PIPELINE_WORKFLOW_STARTING
        - RETRY_WORKFLOW_STARTING
        - STACK_OUTPUT_UPDATE
        - STACK_RUN_SUCCESS
        - CONDITION_QUEUE_WAIT
      type: string
    Pipeline.TriggerSource:
      description: All possible trigger sources (user-facing webhooks + system-generated)
      enum:
        - webhook:github
        - webhook:gitlab
        - webhook
        - api
        - dashboard
        - config:change
        - project-config:change
        - stack:destroy
      type: string
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````