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

# Cancel a test run

> Cancel a test run. The run must be in QUEUED or RUNNING status. If the run has a container, the container will be stopped.



## OpenAPI

````yaml https://api.stably.ai/openapi.json post /v1/projects/{projectId}/runs/cancel
openapi: 3.1.1
info:
  title: Stably Public API
  description: Interact with your Stably tests from anywhere
  version: 1.0.0
servers:
  - url: https://api.stably.ai
    description: Production Server
security: []
paths:
  /v1/projects/{projectId}/runs/cancel:
    post:
      tags:
        - runner
      summary: Cancel a test run
      description: >-
        Cancel a test run. The run must be in QUEUED or RUNNING status. If the
        run has a container, the container will be stopped.
      parameters:
        - schema:
            type: string
          in: path
          name: projectId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                where:
                  type: object
                  properties:
                    runId:
                      type: string
                      description: ID of the run to cancel
                  required:
                    - runId
              required:
                - where
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  cancelled:
                    type: array
                    items:
                      type: object
                      properties:
                        runId:
                          type: string
                          description: ID of the cancelled run
                      required:
                        - runId
                      additionalProperties: false
                    description: List of cancelled runs
                required:
                  - cancelled
                additionalProperties: false
                description: Run was cancelled
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Bad request
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
                description: Unauthorized
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````