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

# Rename Batch Jobs

> Rename episode filenames in a paused batch before starting downloads

## Overview

Rename episode filenames in a paused batch. The batch must be in `paused` status (created with `paused: true`).

## Header Parameters

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

## Path Parameters

<ParamField path="id" type="string" required>
  The batch UUID returned from `POST /jobs`
</ParamField>

## Request Body

<ParamField body="renames" type="array" required>
  List of rename operations
</ParamField>

Each rename item contains:

<ParamField body="renames[].job_id" type="string" required>
  The job UUID to rename (must belong to this batch)
</ParamField>

<ParamField body="renames[].filename" type="string" required>
  New filename (without extension). Will be sanitized for safe S3/filesystem usage.
</ParamField>

## Response

<ResponseField name="updated" type="integer">
  Number of jobs successfully renamed
</ResponseField>

<ResponseField name="errors" type="array">
  List of error messages for failed renames
</ResponseField>

## Example

<CodeGroup>
  ```bash Request theme={null}
  curl -X PATCH "https://api.tornadoapi.io/batch/550e8400-e29b-41d4-a716-446655440001/jobs" \
    -H "x-api-key: sk_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "renames": [
        {"job_id": "uuid-1", "filename": "01 - Introduction"},
        {"job_id": "uuid-2", "filename": "02 - Getting Started"},
        {"job_id": "uuid-3", "filename": "03 - Deep Dive"}
      ]
    }'
  ```

  ```json 200 OK theme={null}
  {
    "updated": 3,
    "errors": []
  }
  ```

  ```json 200 OK (Partial Success) theme={null}
  {
    "updated": 2,
    "errors": ["Job xyz does not belong to this batch"]
  }
  ```
</CodeGroup>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request theme={null}
  {
    "error": "Batch is not paused. Only paused batches can be renamed."
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Batch does not belong to this API key"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Batch not found"
  }
  ```
</ResponseExample>
