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

# Create Batch Sessions

> Creates multiple browser sessions in a single batch operation. This endpoint allows you to
create up to 5,000 browser sessions simultaneously with the same configuration.

The batch will be processed asynchronously, and you can monitor progress using the batch status endpoint.




## OpenAPI

````yaml /openapi.yaml post /v1/batch-sessions
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/batch-sessions:
    post:
      tags:
        - Batch Sessions
      summary: Create Batch Sessions
      description: >
        Creates multiple browser sessions in a single batch operation. This
        endpoint allows you to

        create up to 5,000 browser sessions simultaneously with the same
        configuration.


        The batch will be processed asynchronously, and you can monitor progress
        using the batch status endpoint.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchSessionRequestSchema'
            examples:
              small_batch:
                summary: Small batch example
                value:
                  count: 10
                  configuration:
                    browser:
                      headless:
                        active: true
                      viewport:
                        width: 1440
                        height: 900
                    session:
                      timeout:
                        idle_timeout: 10
                        max_duration: 300
                  metadata:
                    project: web-scraping
                    environment: production
              large_batch:
                summary: Large batch example (from test snippet)
                value:
                  count: 2500
                  configuration:
                    browser:
                      headless:
                        active: true
                      viewport:
                        width: 1440
                        height: 900
                      recording:
                        active: true
                    session:
                      timeout:
                        idle_timeout: 10
                        max_duration: 300
                      tags:
                        - batch-test-comprehensive
                  metadata:
                    test: true
                    description: Comprehensive batch test with 3 sessions
      responses:
        '200':
          description: Batch created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BatchSessionResponseSchema'
        '400':
          description: Invalid request parameters or configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_count:
                  summary: Invalid session count
                  value:
                    error:
                      code: 400
                      message: Session count must be between 1 and 1000
                invalid_config:
                  summary: Invalid configuration
                  value:
                    error:
                      code: 400
                      message: CAPTCHA solver requires proxy to be active
        '402':
          description: Payment Required - Insufficient credits for batch creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    BatchSessionRequestSchema:
      type: object
      required:
        - count
      properties:
        count:
          type: integer
          minimum: 1
          maximum: 1000
          description: Number of sessions to create in the batch (1-1000)
        configuration:
          $ref: '#/components/schemas/SessionCreateRequestSchema'
          description: Configuration that applies to all sessions in the batch
        metadata:
          type: object
          additionalProperties: true
          description: Optional batch-level metadata for identification and organization
    BatchSessionResponseSchema:
      type: object
      properties:
        batch_id:
          type: string
          format: uuid
          description: Unique identifier for the batch
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
            - cancelled
          description: Current status of the batch
        total_requests:
          type: integer
          description: Total number of sessions requested in the batch
        created_at:
          type: string
          format: date-time
          description: Timestamp when the batch was created
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    SessionCreateRequestSchema:
      type: object
      properties:
        session:
          $ref: '#/components/schemas/SessionConfig'
        browser:
          $ref: '#/components/schemas/BrowserConfig'
        integrations:
          type: array
          description: >-
            Array of integrations to load in the browser session. Integrations
            must be previously created using the Integrations API.
          items:
            $ref: '#/components/schemas/Integration'
          example:
            - id: 550e8400-e29b-41d4-a716-446655440000
              type: 1PASSWORD
              configuration:
                load_mode: all
        identities:
          description: |
            Activates an authenticated session.
          type: array
          items:
            type: object
            description: >-
              Previously configured identity to be used for the authenticated
              session.
            properties:
              id:
                type: string
                description: The identity ID to use for the browser session.
          example:
            - id: 123e4567-e89b-12d3-a456-426614174000
    SessionConfig:
      type: object
      description: Session-related configurations.
      properties:
        initial_url:
          type: string
          format: uri
          description: >-
            The URL to navigate to when the browser session starts. If not
            provided, the browser will load an empty page.
        tags:
          type: array
          items:
            type: string
          description: >-
            Custom labels to categorize and identify browser sessions. Useful
            for filtering, organizing, and tracking sessions across your
            workflows.
          example:
            - production
            - scraping
            - customer-123
        recording:
          type: object
          description: Configuration for session recording.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable video recording of the browser session.
                Defaults to `true`.
        proxy:
          $ref: '#/components/schemas/ProxyConfig'
        timeout:
          type: object
          description: Timeout configurations for the browser session.
          properties:
            max_duration:
              type: integer
              description: >-
                Maximum time (in minutes) the session can run before
                automatically terminating. Defaults to `20`. Set to `-1` to
                disable this limit.
            idle_timeout:
              type: integer
              description: >-
                Time (in minutes) the session waits for new connections after
                all others are closed before stopping. Defaults to `5`. Set to
                `-1` to disable this limit.
        live_view:
          type: object
          description: Configuration for live viewing the browser session.
          properties:
            read_only:
              type: boolean
              description: >-
                Enable or disable read-only mode for live viewing. Defaults to
                `false`.
            one_time_url:
              type: boolean
              description: >-
                Generate a single-use live view URL. After the first viewer
                connects, the link becomes invalid. Requires a headful browser.
                Defaults to `false`.
    BrowserConfig:
      type: object
      description: Browser-specific configurations.
      properties:
        profile:
          type: object
          description: Options for managing and persisting browser session profiles.
          properties:
            name:
              type: string
              description: The name of the profile to be used during the browser session.
            persist:
              type: boolean
              description: >-
                Indicates whether the browser session profile data should be
                saved when the browser session ends. Defaults to `false`.
        adblock:
          type: object
          description: Configuration for ad-blocking.
          properties:
            active:
              type: boolean
              description: Enable or disable ad-blocking. Defaults to `true`.
        popup_blocker:
          type: object
          description: Configuration for popup blocking.
          properties:
            active:
              type: boolean
              description: >-
                Blocks popups, including ads and CAPTCHA consent banners.
                Requires adblock to be active. Defaults to `true`.
        captcha_solver:
          type: object
          description: Configuration for captcha-solving.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable captcha-solving. Requires proxy to be active.
                Defaults to `false`.
        headless:
          type: object
          description: Configuration for headless mode.
          properties:
            active:
              type: boolean
              description: >-
                Whether browser should be headless or headful. Defaults to
                `false`.
        viewport:
          type: object
          description: Configuration for the browser's viewport size.
          properties:
            width:
              type: integer
              description: Width of the viewport in pixels. Defaults to `1440`.
            height:
              type: integer
              description: Height of the viewport in pixels. Defaults to `900`.
        fullscreen:
          type: object
          description: Configuration for fullscreen mode.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable fullscreen mode. When enabled, the browser
                will start in fullscreen mode. Defaults to `false`.
        pdf_viewer:
          type: object
          description: Configuration for PDF viewer mode.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable PDF viewer mode. When disabled, the browser
                will download PDFs instead of viewing them. Defaults to `true`.
        p2p_download:
          type: object
          description: Configuration for peer-to-peer download capture functionality.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable P2P downloads. When enabled, the browser will
                capture downloads for direct data extraction, instead of
                uploading them on Anchor's storage. Defaults to `false`.
        extensions:
          type: array
          description: >-
            Array of extension IDs to load in the browser session. Extensions
            must be previously uploaded using the Extensions API.
          items:
            type: string
            format: uuid
        disable_web_security:
          type: object
          description: Configuration for disabling web security features.
          properties:
            active:
              type: boolean
              description: >-
                Whether to disable web security features (CORS, same-origin
                policy, etc.). Allows accessing iframes and resources from
                different origins. Defaults to `false`.
        extra_stealth:
          type: object
          description: >-
            Enables our dedicated patched Chromium build, designed to avoid bot
            detection and blocking. Works with Anchor Proxy enabled only.
          properties:
            active:
              type: boolean
              description: Enable or disable extra stealth mode.
        force_popups_as_tabs:
          type: object
          description: >-
            Configuration for forcing popups to open as tabs instead of popup
            windows.
          properties:
            active:
              type: boolean
              description: Enable or disable forcing popups as tabs. Defaults to `false`.
        web_bot_auth:
          type: object
          description: >-
            Configuration for Cloudflare Web Bot Auth HTTP message signing.
            Enables authentication with websites that require Cloudflare's web
            bot authentication.
          properties:
            active:
              type: boolean
              description: Enable or disable web bot auth. Defaults to `false`.
        disable_dialogs:
          type: object
          description: >-
            Suppresses native browser dialogs (window.alert, window.confirm,
            window.prompt). Useful for automated workflows where dialogs would
            block execution.
          properties:
            active:
              type: boolean
              description: >-
                Enable or disable suppression of native browser dialogs.
                Defaults to `false`.
        tracing:
          type: object
          description: Configuration for browser tracing and debugging capabilities.
          properties:
            active:
              type: boolean
              description: Enable or disable tracing. Defaults to `true`.
            snapshots:
              type: boolean
              description: >-
                Enable or disable snapshot capture in traces. Defaults to
                `false`.
            sources:
              type: boolean
              description: >-
                Enable or disable source code capture in traces. Defaults to
                `true`.
        sensitive_data_mask:
          type: object
          description: >-
            Automatically detects and masks sensitive data (passwords, emails,
            phone numbers, credit card fields, tokens) in web pages. Supports
            custom CSS selectors globally or per site, and custom regex
            patterns.
          properties:
            active:
              type: boolean
              description: Enable or disable sensitive data masking. Defaults to `false`.
            custom_selectors:
              type: array
              items:
                type: string
              description: >-
                Additional CSS selectors to mask globally across all sites.
                Matched elements will be blurred.
            site_selectors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              description: >-
                Per-site CSS selectors. Keys are hostnames (supports wildcard
                prefix like `*.bank.com`), values are arrays of CSS selectors.
                Matched elements will be blurred.
            custom_patterns:
              type: array
              items:
                type: object
                properties:
                  regex:
                    type: string
                    description: Regular expression pattern to match sensitive data.
                  mask:
                    type: string
                    description: Replacement string for matched text. Defaults to `****`.
              description: >-
                Custom regex patterns to detect and mask additional sensitive
                data types.
    Integration:
      oneOf:
        - $ref: '#/components/schemas/OnePasswordIntegration'
      discriminator:
        propertyName: type
    ProxyConfig:
      description: |
        Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
      type: object
      oneOf:
        - $ref: '#/components/schemas/AnchorProxy'
        - $ref: '#/components/schemas/CustomProxy'
    OnePasswordIntegration:
      type: object
      required:
        - id
        - type
        - configuration
      properties:
        id:
          type: string
          format: uuid
          description: Unique integration ID
          example: 550e8400-e29b-41d4-a716-446655440000
        type:
          type: string
          enum:
            - 1PASSWORD
          description: Integration type
        configuration:
          $ref: '#/components/schemas/OnePasswordConfig'
    AnchorProxy:
      title: Anchor Proxy
      type: object
      properties:
        active:
          type: boolean
        type:
          type: string
          enum:
            - anchor_proxy
          description: >-
            Create a session with a proxy to access websites as if you're
            browsing from a computer in that country.
          title: anchor_proxy
        country_code:
          $ref: '#/components/schemas/AnchorProxyCountryCode'
          description: |
            Supported country codes ISO 2 lowercase
        region:
          type: string
          description: |
            Region code for more specific geographic targeting.
            The city parameter can only be used when region is also provided.
        city:
          type: string
          description: >
            City name for precise geographic targeting. Supported for
            anchor_proxy only.

            Can only be used when region is also provided.
      required:
        - active
    CustomProxy:
      title: Custom Proxy
      type: object
      properties:
        type:
          type: string
          enum:
            - custom
        server:
          type: string
          description: >-
            Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
            https://proxy.example.com:443). See [proxy
            page](/advanced/proxy#custom-proxy).
        username:
          type: string
          description: Proxy username
        password:
          type: string
          description: Proxy password
        active:
          type: boolean
      required:
        - type
        - server
        - username
        - password
        - active
    OnePasswordConfig:
      oneOf:
        - $ref: '#/components/schemas/OnePasswordAllSecretsConfig'
        - $ref: '#/components/schemas/OnePasswordSpecificSecretsConfig'
    AnchorProxyCountryCode:
      type: string
      title: anchor_proxy
      enum:
        - af
        - al
        - dz
        - ad
        - ao
        - as
        - ag
        - ar
        - am
        - aw
        - au
        - at
        - az
        - bs
        - bh
        - bb
        - by
        - be
        - bz
        - bj
        - bm
        - bo
        - ba
        - br
        - bg
        - bf
        - cm
        - ca
        - cv
        - td
        - cl
        - co
        - cg
        - cr
        - ci
        - hr
        - cu
        - cy
        - cz
        - dk
        - dm
        - do
        - ec
        - eg
        - sv
        - ee
        - et
        - fo
        - fi
        - fr
        - gf
        - pf
        - ga
        - gm
        - ge
        - de
        - gh
        - gi
        - gr
        - gd
        - gp
        - gt
        - gg
        - gn
        - gw
        - gy
        - ht
        - hn
        - hu
        - is
        - in
        - ir
        - iq
        - ie
        - il
        - it
        - jm
        - jp
        - jo
        - kz
        - kw
        - kg
        - lv
        - lb
        - ly
        - li
        - lt
        - lu
        - mk
        - ml
        - mt
        - mq
        - mr
        - mx
        - md
        - mc
        - me
        - ma
        - nl
        - nz
        - ni
        - ng
        - 'no'
        - pk
        - pa
        - py
        - pe
        - ph
        - pl
        - pt
        - pr
        - qa
        - ro
        - lc
        - sm
        - sa
        - sn
        - rs
        - sc
        - sl
        - sk
        - si
        - so
        - za
        - kr
        - es
        - sr
        - se
        - ch
        - sy
        - st
        - tw
        - tj
        - tg
        - tt
        - tn
        - tr
        - tc
        - ua
        - ae
        - us
        - uy
        - uz
        - ve
        - ye
      default: us
    OnePasswordAllSecretsConfig:
      type: object
      required:
        - load_mode
      properties:
        load_mode:
          type: string
          enum:
            - all
          description: Load all secrets from 1Password
    OnePasswordSpecificSecretsConfig:
      type: object
      required:
        - load_mode
        - secrets
      properties:
        load_mode:
          type: string
          enum:
            - specific
          description: Load specific secrets from 1Password
        secrets:
          type: array
          items:
            type: string
          minItems: 1
          description: Array of secret references to load
          example:
            - op://vault/item/field
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````