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

# Cancel a queued or running batch

> Cancel all queued or running runs in a prior group-run batch. Finished runs are left unchanged, making the endpoint idempotent when the batch has already completed.



## OpenAPI

````yaml /openapi.json post /v1/batches/{batchId}/cancel
openapi: 3.0.0
info:
  title: TestArmy API
  version: 1.0.0
  description: >-
    AI-powered browser automation API for QA testing. Automate web testing
    workflows using natural language prompts.
servers:
  - url: https://tester.army/api
    description: Production API server
security: []
paths:
  /v1/batches/{batchId}/cancel:
    post:
      tags:
        - Test Runs
      summary: Cancel a queued or running batch
      description: >-
        Cancel all queued or running runs in a prior group-run batch. Finished
        runs are left unchanged, making the endpoint idempotent when the batch
        has already completed.
      parameters:
        - schema:
            type: string
            format: uuid
            description: Batch ID
          required: true
          description: Batch ID
          name: batchId
          in: path
      responses:
        '200':
          description: Batch cancellation summary
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    format: uuid
                  cancelled:
                    type: integer
                    minimum: 0
                  alreadyFinished:
                    type: integer
                    minimum: 0
                  cancelledRunIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                  alreadyFinishedRunIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                required:
                  - batchId
                  - cancelled
                  - alreadyFinished
                  - cancelledRunIds
                  - alreadyFinishedRunIds
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '404':
          description: Batch not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '409':
          description: Conflict - Some runs could not be cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                  batchId:
                    type: string
                    format: uuid
                  cancelled:
                    type: integer
                    minimum: 0
                  alreadyFinished:
                    type: integer
                    minimum: 0
                  cancelledRunIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                  alreadyFinishedRunIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                  failedRunIds:
                    type: array
                    items:
                      type: string
                      format: uuid
                required:
                  - error
                  - message
                  - batchId
                  - cancelled
                  - alreadyFinished
                  - cancelledRunIds
                  - alreadyFinishedRunIds
                  - failedRunIds
        '429':
          description: Too Many Requests - Usage limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '504':
          description: Gateway Timeout - Test execution exceeded time limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token format

````