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

# Retry Failed Batch Sessions

> Retries failed sessions in a batch by creating new browser pods for each
failed session. The batch status will be set back to 'processing'.




## OpenAPI

````yaml /openapi.yaml post /v1/batch-sessions/{batch_id}/retry
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/{batch_id}/retry:
    post:
      tags:
        - Batch Sessions
      summary: Retry Failed Batch Sessions
      description: |
        Retries failed sessions in a batch by creating new browser pods for each
        failed session. The batch status will be set back to 'processing'.
      parameters:
        - name: batch_id
          in: path
          required: true
          description: The unique identifier of the batch
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchSessionRetryRequestSchema'
            examples:
              retry_defaults:
                summary: Retry with default settings
                value:
                  retry_failed_only: true
                  max_retries: 1
              retry_multiple:
                summary: Retry with multiple attempts
                value:
                  retry_failed_only: true
                  max_retries: 3
      responses:
        '200':
          description: Retry initiated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/BatchSessionRetryResponseSchema'
        '400':
          description: No failed sessions to retry
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Batch not found
          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:
    BatchSessionRetryRequestSchema:
      type: object
      properties:
        retry_failed_only:
          type: boolean
          default: true
          description: Whether to only retry failed sessions
        max_retries:
          type: integer
          minimum: 1
          maximum: 3
          default: 1
          description: >-
            Maximum number of attempts per failed session. Each session is
            retried up to this many times, stopping on first success.
    BatchSessionRetryResponseSchema:
      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 after retry
        retried_sessions:
          type: integer
          description: Number of sessions that were retried
        message:
          type: string
          description: Summary message
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````