Rename Batch Jobs
curl --request PATCH \
--url https://api.tornadoapi.io/batch/{id}/jobs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"renames": [
{}
],
"renames[].job_id": "<string>",
"renames[].filename": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/batch/{id}/jobs"
payload = {
"renames": [{}],
"renames[].job_id": "<string>",
"renames[].filename": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
renames: [{}],
'renames[].job_id': '<string>',
'renames[].filename': '<string>'
})
};
fetch('https://api.tornadoapi.io/batch/{id}/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tornadoapi.io/batch/{id}/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'renames' => [
[
]
],
'renames[].job_id' => '<string>',
'renames[].filename' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/batch/{id}/jobs"
payload := strings.NewReader("{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tornadoapi.io/batch/{id}/jobs")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/batch/{id}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "Batch is not paused. Only paused batches can be renamed."
}
{
"error": "Batch does not belong to this API key"
}
{
"error": "Batch not found"
}
Batch Operations
Rename Batch Jobs
Rename episode filenames in a paused batch before starting downloads
PATCH
/
batch
/
{id}
/
jobs
Rename Batch Jobs
curl --request PATCH \
--url https://api.tornadoapi.io/batch/{id}/jobs \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"renames": [
{}
],
"renames[].job_id": "<string>",
"renames[].filename": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/batch/{id}/jobs"
payload = {
"renames": [{}],
"renames[].job_id": "<string>",
"renames[].filename": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
renames: [{}],
'renames[].job_id': '<string>',
'renames[].filename': '<string>'
})
};
fetch('https://api.tornadoapi.io/batch/{id}/jobs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tornadoapi.io/batch/{id}/jobs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'renames' => [
[
]
],
'renames[].job_id' => '<string>',
'renames[].filename' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/batch/{id}/jobs"
payload := strings.NewReader("{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.tornadoapi.io/batch/{id}/jobs")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/batch/{id}/jobs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"renames\": [\n {}\n ],\n \"renames[].job_id\": \"<string>\",\n \"renames[].filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"error": "Batch is not paused. Only paused batches can be renamed."
}
{
"error": "Batch does not belong to this API key"
}
{
"error": "Batch not found"
}
Overview
Rename episode filenames in a paused batch. The batch must be inpaused status (created with paused: true).
Header Parameters
string
required
Your API key for authentication
Path Parameters
string
required
The batch UUID returned from
POST /jobsRequest Body
array
required
List of rename operations
string
required
The job UUID to rename (must belong to this batch)
string
required
New filename (without extension). Sanitization transliterates to ASCII alphanumerics, replaces punctuation/whitespace with underscores and rejects an empty result.
Response
integer
Number of jobs successfully renamed
array
List of error messages for failed renames
Example
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"}
]
}'
{
"updated": 3,
"errors": []
}
{
"updated": 2,
"errors": ["Job xyz does not belong to this batch"]
}
200 can contain errors and partial updates. Marketplace batch access is refused with 403; storage/queue failures can return 500.
Error Responses
{
"error": "Batch is not paused. Only paused batches can be renamed."
}
{
"error": "Batch does not belong to this API key"
}
{
"error": "Batch not found"
}
Was this page helpful?