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

# Retry Failed Jobs

> Retries failed jobs in a batch. Only jobs currently marked as failed are eligible.



## OpenAPI

````yaml /openapi-v0.1.json post /v0.1/batches/{batch_id}/retry
openapi: 3.0.0
info:
  title: PromptLoop API
  version: 0.1.0
  description: >-
    Run PromptLoop research tasks, manage asynchronous batches, and create
    company-list exports.
  contact:
    name: PromptLoop Support
    email: help@promptloop.com
    url: https://promptloop.com
servers:
  - url: https://api.promptloop.com
    description: Production
security: []
tags:
  - name: Tasks
    description: Create, inspect, test, and run research tasks.
  - name: Batches
    description: Run and manage asynchronous JSONL workloads.
  - name: Company Lists
    description: Search for companies and create downloadable dataset exports.
  - name: Team
    description: Inspect team usage and plan limits.
paths:
  /v0.1/batches/{batch_id}/retry:
    post:
      tags:
        - Batches
      summary: Retry Failed Jobs
      description: >-
        Retries failed jobs in a batch. Only jobs currently marked as failed are
        eligible.
      operationId: retryBatch
      parameters:
        - name: batch_id
          required: true
          in: path
          description: Batch ID to retry
          schema:
            type: string
      responses:
        '200':
          description: Failed jobs successfully re-queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryBatchResponseDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - x-api-key: []
components:
  schemas:
    RetryBatchResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: success
        data:
          $ref: '#/components/schemas/BatchRetryResponseDto'
        message:
          type: string
        error:
          allOf:
            - $ref: '#/components/schemas/ErrorDetailsDto'
          nullable: true
        request_id:
          type: string
          description: Correlation identifier for support and request tracing.
      required:
        - status
        - data
        - message
    ErrorResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: error
        data:
          type: object
          nullable: true
        message:
          type: string
        error:
          allOf:
            - $ref: '#/components/schemas/ErrorDetailsDto'
          nullable: true
        request_id:
          type: string
          description: Correlation identifier for support and request tracing.
      required:
        - status
        - data
        - message
    BatchRetryResponseDto:
      type: object
      properties:
        batch_id:
          type: string
          example: a427201b-2340-4f06-ad68-2da8e0fdb120
          description: Batch ID
        jobs_retried:
          type: integer
          example: 10
          description: Number of jobs that were re-queued
          format: int32
        batch_reactivated:
          type: boolean
          example: false
          description: Whether the batch was reset from cancelled state
      required:
        - batch_id
        - jobs_retried
        - batch_reactivated
    ErrorDetailsDto:
      type: object
      properties:
        code:
          type: number
        details:
          type: string
      required:
        - code
        - details
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````