> ## 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.

# Start multiple automations asynchronously

> Creates and enqueues multiple automation runs in a single request, returning run_ids immediately without waiting for completion. Maximum 100 runs per request.

**Atomic creation:** Run creation is all-or-nothing. Either all runs are created successfully, or none are (returns error).

**Idempotency:** This endpoint does not currently support idempotency keys. Retrying a failed request may create duplicate runs.



## OpenAPI

````yaml https://agent.tinyfish.ai/v1/openapi/main post /v1/automation/run-batch
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/automation/run-batch:
    post:
      tags:
        - Automation
      summary: Start multiple automations asynchronously
      description: >-
        Creates and enqueues multiple automation runs in a single request,
        returning run_ids immediately without waiting for completion. Maximum
        100 runs per request.


        **Atomic creation:** Run creation is all-or-nothing. Either all runs are
        created successfully, or none are (returns error).


        **Idempotency:** This endpoint does not currently support idempotency
        keys. Retrying a failed request may create duplicate runs.
      operationId: runBatch
      requestBody:
        description: Batch of automation task configurations
        content:
          application/json:
            schema:
              type: object
              properties:
                runs:
                  type: array
                  items:
                    type: object
                    properties:
                      url:
                        type: string
                        format: uri
                        description: Target website URL to automate
                        example: https://example.com
                      goal:
                        type: string
                        minLength: 1
                        description: >-
                          Natural language description of what to accomplish on
                          the website
                        example: Find the pricing page and extract all plan details
                      browser_profile:
                        type: string
                        enum:
                          - lite
                          - stealth
                        description: >-
                          Browser profile for execution. LITE uses standard
                          browser, STEALTH uses anti-detection browser.
                        example: lite
                      api_integration:
                        type: string
                        description: >-
                          Name of the integration making this API call (e.g.,
                          "dify", "zapier", "n8n"). Used for analytics.
                        example: dify
                      agent_config:
                        type: object
                        properties:
                          mode:
                            type: string
                            enum:
                              - default
                              - strict
                            description: >-
                              Agent behavior mode. "strict" enables fail-fast
                              for test automation.
                            example: strict
                          cursor_style:
                            type: string
                            enum:
                              - fish
                              - standard
                              - green-pointer
                            description: Cursor style for the browser agent.
                            example: standard
                          max_steps:
                            type: integer
                            minimum: 1
                            maximum: 500
                            description: >-
                              Maximum tool-call steps before the agent stops.
                              Defaults to 150.
                            example: 50
                          max_duration_seconds:
                            type: integer
                            minimum: 1
                            description: >-
                              Maximum wall-clock seconds before the agent stops.
                              Defaults to no limit.
                            example: 300
                        description: Agent behavior configuration
                      capture_config:
                        type: object
                        properties:
                          elements:
                            type: boolean
                          snapshots:
                            type: boolean
                          screenshots:
                            type: boolean
                          recording:
                            type: boolean
                          html:
                            type: boolean
                        description: Configure which data to capture during the run.
                      webhook_url:
                        type: string
                        format: uri
                        description: >-
                          HTTPS URL to receive webhook notifications for run
                          lifecycle events. Must use HTTPS.
                      use_vault:
                        type: boolean
                        description: >-
                          Opt-in to vault credentials for this run. When true,
                          enabled vault items are included. Defaults to false.
                        example: true
                      use_profile:
                        type: boolean
                        description: >-
                          Opt-in to the default Browser Context Profile if
                          Browser Context Profiles are enabled; legacy callers
                          are silently ignored when the profiles feature is
                          disabled. Returns 400 when enabled but no default
                          profile is set.
                        example: true
                      credential_item_ids:
                        type: array
                        items:
                          type: string
                          minLength: 1
                        minItems: 1
                        description: >-
                          Scope vault credentials to specific credential URIs.
                          Requires use_vault to be true. If omitted with
                          use_vault: true, all enabled items are used.
                        example:
                          - cred:conn-abc:Work:item-123
                          - cred:conn-def:Personal:item-456
                      proxy_config:
                        type: object
                        properties:
                          enabled:
                            type: boolean
                            description: Enable proxy for this automation run
                            example: true
                          country_code:
                            type: string
                            enum:
                              - US
                              - GB
                              - CA
                              - DE
                              - FR
                              - JP
                              - AU
                            description: Country code for proxy location.
                            example: US
                        required:
                          - enabled
                        description: Proxy configuration
                    required:
                      - url
                      - goal
                    additionalProperties: false
                  minItems: 1
                  maxItems: 100
                  description: Array of run configurations (1-100)
                profile_id:
                  type: string
                  minLength: 1
                  description: Browser Context Profile ID to use when use_profile is true.
                  example: prof_abc123def4567890
                output_schema:
                  type: object
                  properties: {}
                  additionalProperties:
                    nullable: true
                  description: >-
                    Optional provider-supported structured-output schema subset
                    applied to every run in the batch. Unsupported fields are
                    rejected before the request is accepted.
                  example:
                    type: object
                    properties:
                      title:
                        type: string
                      price:
                        type: number
                    required:
                      - title
                      - price
              required:
                - runs
      responses:
        '200':
          description: All runs created and enqueued successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  run_ids:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: Created run IDs. Null if creation failed.
                    example:
                      - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                      - b2c3d4e5-f6a7-8901-bcde-f23456789012
                  error:
                    type: object
                    nullable: true
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: INTERNAL_ERROR
                      message:
                        type: string
                        description: Error message
                        example: Internal server error
                    required:
                      - code
                      - message
                    description: Error details. Null if successful.
                required:
                  - run_ids
                  - error
                description: >-
                  Batch async run response. Run creation is atomic. Returns
                  run_ids on success, error on failure.
              example:
                run_ids:
                  - a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  - b2c3d4e5-f6a7-8901-bcde-f23456789012
                error: null
        '400':
          description: >-
            Invalid request - missing required fields, invalid format, or
            exceeds 100 runs
          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
        '403':
          description: Forbidden - Insufficient credits for the requested number of runs
          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 - Failed to create or enqueue any runs
          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.

````