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

# Cancel multiple runs by IDs

> Cancel multiple runs by their IDs in a single request. Returns per-run results including cancelled runs, already-terminal runs, and not-found IDs. Maximum 100 IDs per request. Idempotent: calling twice returns consistent results.



## OpenAPI

````yaml https://agent.tinyfish.ai/v1/openapi/main post /v1/runs/batch/cancel
openapi: 3.0.0
info:
  title: TinyFish Web Agent Automation API
  version: 1.0.0
  description: >-
    REST API for running AI-powered browser automations. Execute tasks on any
    website using natural language instructions.
  contact:
    name: TinyFish Support
    email: support@tinyfish.ai
servers:
  - url: https://agent.tinyfish.ai
    description: Production
security: []
tags:
  - name: Automation
    description: Browser automation endpoints for executing tasks on websites
  - name: Runs
    description: Endpoints for retrieving automation run data
  - name: Browser
    description: Remote browser session endpoints
  - name: Fetch
    description: Fetch URLs and extract clean page content
  - name: Search
    description: Web search endpoints
  - name: Browser Context Profiles
    description: >-
      Saved browser context endpoints for managing reusable login state,
      cookies, storage, and profile setup sessions
  - name: Vault
    description: >-
      Vault credential management endpoints for connecting password managers and
      managing stored credentials
paths:
  /v1/runs/batch/cancel:
    post:
      tags:
        - Runs
      summary: Cancel multiple runs by IDs
      description: >-
        Cancel multiple runs by their IDs in a single request. Returns per-run
        results including cancelled runs, already-terminal runs, and not-found
        IDs. Maximum 100 IDs per request. Idempotent: calling twice returns
        consistent results.
      operationId: batchCancelRuns
      requestBody:
        description: Array of run IDs to cancel
        content:
          application/json:
            schema:
              type: object
              properties:
                run_ids:
                  type: array
                  items:
                    type: string
                  minItems: 1
                  maxItems: 100
                  description: Array of run IDs (1-100)
                  example:
                    - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    - b2c3d4e5-f6a7-8901-bcde-f23456789012
              required:
                - run_ids
              description: Batch runs request
      responses:
        '200':
          description: >-
            Request succeeded. Returns per-run results in `results` and any
            missing IDs in `not_found`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      type: object
                      properties:
                        run_id:
                          type: string
                          description: The unique identifier of the run
                          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                        status:
                          type: string
                          enum:
                            - CANCELLED
                            - COMPLETED
                            - FAILED
                          description: >-
                            The current status of the run. Returns actual status
                            for idempotent responses (e.g., COMPLETED if run
                            already finished)
                          example: CANCELLED
                        cancelled_at:
                          type: string
                          nullable: true
                          description: >-
                            ISO 8601 timestamp when the run was cancelled, or
                            null if not cancelled
                          example: '2026-01-14T10:30:55Z'
                        message:
                          type: string
                          nullable: true
                          description: >-
                            Additional context about the cancellation result
                            (e.g., "Run already cancelled", "Run already
                            finished")
                          example: Run already cancelled
                      required:
                        - run_id
                        - status
                        - cancelled_at
                        - message
                      description: Response from cancel run endpoint
                    description: >-
                      Results for runs that were found and processed (cancelled
                      or already terminal)
                  not_found:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: >-
                      Run IDs that were not found or not owned. Null if all
                      found.
                required:
                  - results
                  - not_found
                description: Batch cancel runs response
              example:
                results:
                  - run_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    status: CANCELLED
                    cancelled_at: '2024-01-01T00:00:30Z'
                    message: null
                  - run_id: c3d4e5f6-a7b8-9012-cdef-345678901234
                    status: COMPLETED
                    cancelled_at: null
                    message: Run already finished
                not_found:
                  - b2c3d4e5-f6a7-8901-bcde-f23456789012
        '400':
          description: Invalid request - empty array, exceeds 100 IDs, or malformed input
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Get your key from the API Keys page.

````