> ## 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. This will re-queue all failed jobs for processing. If the batch was cancelled, it will be reactivated.



## OpenAPI

````yaml openapi-v0.json post /v0/batches/{id}/retry
openapi: 3.0.0
info:
  title: API Documentation
  description: API description
  version: '0'
  contact: {}
servers:
  - url: https://api.promptloop.com/
    description: Production API v0
security: []
tags: []
paths:
  /v0/batches/{id}/retry:
    post:
      tags:
        - Batches
      summary: Retry Failed Jobs
      description: >-
        Retries failed jobs in a batch. This will re-queue all failed jobs for
        processing. If the batch was cancelled, it will be reactivated.
      operationId: BatchesController_retryBatch
      parameters:
        - name: id
          required: true
          in: path
          description: Batch ID to retry
          schema:
            type: string
        - name: failed_only
          required: false
          in: query
          description: >-
            Only retry failed jobs (default: true). Set to false to retry all
            non-completed jobs.
          schema:
            type: boolean
      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:
          $ref: '#/components/schemas/ErrorDetailsDto'
      required:
        - status
        - data
        - message
    ErrorResponseDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: error
        data:
          type: object
        message:
          type: string
        error:
          $ref: '#/components/schemas/ErrorDetailsDto'
      required:
        - status
        - data
        - message
    BatchRetryResponseDto:
      type: object
      properties:
        batch_id:
          type: string
          example: a427201b-2340-4f06-ad68-2da8e0fdb120
          description: Batch ID
        jobs_retried:
          type: number
          example: 10
          description: Number of jobs that were re-queued
        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

````