Cancel Job
curl --request DELETE \
--url https://api.tornadoapi.io/jobs/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.tornadoapi.io/jobs/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.tornadoapi.io/jobs/{id}', 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/jobs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/jobs/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.tornadoapi.io/jobs/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/jobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"message": "Job cancelled successfully",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelled"
}
{
"message": "Cancellation requested: the worker aborts at its next checkpoint. A file already delivered is not recalled — the job then completes and is billed.",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelling"
}
Jobs
Cancel Job
Cancel a queued or in-flight job
DELETE
/
jobs
/
{id}
Cancel Job
curl --request DELETE \
--url https://api.tornadoapi.io/jobs/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.tornadoapi.io/jobs/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.tornadoapi.io/jobs/{id}', 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/jobs/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/jobs/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.tornadoapi.io/jobs/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/jobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"message": "Job cancelled successfully",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelled"
}
{
"message": "Cancellation requested: the worker aborts at its next checkpoint. A file already delivered is not recalled — the job then completes and is billed.",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelling"
}
Overview
Cancel a job that is still waiting in the queue or already being processed.- Queued — the job is dropped immediately and will never run.
- In flight — the worker stops at its next checkpoint: within a few seconds during the download, right after the download, right after the mux, and at any point during the upload. Nothing is delivered and nothing is billed.
- Already delivered — a file that has already reached your storage is not recalled. If the cancellation lands in the last moments before the job is finalized, the job completes normally and is billed. While the worker is aborting, a poll may briefly show
Cancelled; the final status is what counts.
Completed, Failed, Warning, Skipped, Cancelled, CancelledByAdmin) cannot be cancelled.
This endpoint cancels work; it does not delete the job record or its stored file. A job in Warning has already stopped, so cancelling it returns 400. Use Delete Job File to remove a delivered file.
Header Parameters
string
required
Your API key for authentication
Path Parameters
uuid
required
The job UUID to cancel
Response
string
Human-readable outcome
string
The job ID
string
cancelled — the job was still queued and is gone. cancelling — the job was in flight; the worker aborts at its next checkpoint (poll the job to see the final status).Examples
curl -X DELETE "https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: sk_your_api_key"
const response = await fetch(
'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000',
{
method: 'DELETE',
headers: {
'x-api-key': 'sk_your_api_key'
}
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.delete(
'https://api.tornadoapi.io/jobs/550e8400-e29b-41d4-a716-446655440000',
headers={'x-api-key': 'sk_your_api_key'}
)
print(response.json())
Success Response
{
"message": "Job cancelled successfully",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelled"
}
{
"message": "Cancellation requested: the worker aborts at its next checkpoint. A file already delivered is not recalled — the job then completes and is billed.",
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "cancelling"
}
Error Responses
{
"error": "Job cannot be cancelled (already finished)"
}
{
"error": "Missing x-api-key header"
}
{
"error": "Invalid API Key"
}
{
"error": "Job not found"
}
{
"error": "Failed to cancel job"
}
Notes
- Cancelled jobs end with status
Cancelledand the error message “Job cancelled by user”; they are never billed. - Cancellation can interrupt an in-flight pipeline. If completion won the race, the job is already terminal. An interrupted multipart upload may leave incomplete parts; cleanup depends on the storage provider and lifecycle configuration.
- A job whose file was already delivered when the cancellation arrived completes and is billed — check the final status with
GET /jobs/{id}. - Cancellation is atomic on our side: a job reported as
cancelledwill not be picked up by a worker.
Was this page helpful?