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

# Retry Job

> Retry a failed job with the same parameters

## Overview

Re-queue a failed or warning job with the same parameters. Creates a new job with a new ID while preserving the original job's configuration. Jobs with status `Failed` or `Warning` can be retried.

## Header Parameters

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication
</ParamField>

## Path Parameters

<ParamField path="id" type="uuid" required>
  The failed job UUID to retry
</ParamField>

## Response

<ResponseField name="job_id" type="string">
  UUID of the new retry job
</ResponseField>

<ResponseField name="original_job_id" type="string">
  UUID of the original failed job
</ResponseField>

<ResponseField name="message" type="string">
  Success message
</ResponseField>

## Examples

<CodeGroup>
  ```bash Retry a Failed Job theme={null}
  curl -X POST "https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/retry" \
    -H "x-api-key: sk_your_api_key"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/retry',
    {
      method: 'POST',
      headers: {
        'x-api-key': 'sk_your_api_key'
      }
    }
  );

  const data = await response.json();
  console.log(`New job ID: ${data.job_id}`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000/retry',
      headers={'x-api-key': 'sk_your_api_key'}
  )

  data = response.json()
  print(f"New job ID: {data['job_id']}")
  ```
</CodeGroup>

## Success Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "job_id": "660f9511-f30c-52e5-b827-557766551111",
    "original_job_id": "550e8400-e29b-41d4-a716-446655440000",
    "message": "Job re-queued successfully"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "Only failed or warning jobs can be retried"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Missing x-api-key header"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Invalid API Key"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Job not found"
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": "Failed to queue retry job"
  }
  ```
</ResponseExample>

## Notes

* Jobs with status `Failed` or `Warning` can be retried
* A new job is created with a new UUID
* The original failed job remains unchanged (for audit purposes)
* All original parameters are preserved (URL, format, codecs, webhook, etc.)
* The new job uses your current S3 configuration (in case you updated it)
* Usage/billing is counted for the new job
