Cancel job
curl --request PATCH \
--url https://api.nexrender.com/api/v2/jobs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nexrender.com/api/v2/jobs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nexrender.com/api/v2/jobs/{id}/cancel', 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.nexrender.com/api/v2/jobs/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.nexrender.com/api/v2/jobs/{id}/cancel"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.nexrender.com/api/v2/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexrender.com/api/v2/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"templateId": "<string>",
"status": "<string>",
"progress": 123,
"stats": {
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"errorAt": "2023-11-07T05:31:56Z",
"totalAssets": 123,
"renderDuration": 123,
"error": "<string>"
},
"outputUrl": "<string>"
}
]{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Rendering Jobs
Cancelling Jobs
Cancel a single job, multiple jobs at once, or an entire batch
PATCH
/
jobs
/
{id}
/
cancel
Cancel job
curl --request PATCH \
--url https://api.nexrender.com/api/v2/jobs/{id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.nexrender.com/api/v2/jobs/{id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nexrender.com/api/v2/jobs/{id}/cancel', 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.nexrender.com/api/v2/jobs/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.nexrender.com/api/v2/jobs/{id}/cancel"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.nexrender.com/api/v2/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexrender.com/api/v2/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "<string>",
"templateId": "<string>",
"status": "<string>",
"progress": 123,
"stats": {
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"errorAt": "2023-11-07T05:31:56Z",
"totalAssets": 123,
"renderDuration": 123,
"error": "<string>"
},
"outputUrl": "<string>"
}
]{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}You can cancel jobs at any point while they are still in a cancellable state -
The response is an array of all jobs cancelled by the request - including any parent, child, or sibling jobs that were cascaded as a result.
You can include up to 1,000 job IDs in a single request. Each ID must be unique. If any of the requested jobs are not found, the API returns a 404.
All cancelled jobs - both the ones you explicitly requested and any cascaded relatives - are returned in the response array.
queued or pending. Jobs that are actively rendering (render:dorender) or already in a terminal state (finished, error, manually_cancelled) cannot be cancelled.
Cancellation cascades automatically - if you cancel a parent job, its child jobs are cancelled too. If you cancel a child job, the parent and any sibling jobs that were waiting on it are also cancelled.
Cancel a Single Job
curl -X PATCH https://api.nexrender.com/api/v2/jobs/01JTRDF7HCR8QAHYW8GPCP4S9Y/cancel \
-H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": "01JTRDF7HCR8QAHYW8GPCP4S9Y",
"status": "manually_cancelled",
"outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job.mp4"
}
]
Cancel Multiple Jobs
To cancel several jobs in one call, usePOST /jobs/cancel with a list of job IDs.
curl -X POST https://api.nexrender.com/api/v2/jobs/cancel \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jobs": [
"01JTRDF7HCR8QAHYW8GPCP4S9Y",
"01JTRGF9KDR4MAHZW9HPCP5T0Z"
]
}'
[
{
"id": "01JTRDF7HCR8QAHYW8GPCP4S9Y",
"status": "manually_cancelled",
"outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job-a.mp4"
},
{
"id": "01JTRGF9KDR4MAHZW9HPCP5T0Z",
"status": "manually_cancelled",
"outputUrl": "https://nx1-outputs-eu.nexrender.com/.../job-b.mp4"
}
]
Cancel an Entire Batch
To cancel all remaining jobs in a batch, usePOST /batches/:id/cancel. See the Batch Jobs page for details.
Cancellation Cascade
When a job is cancelled, Nexrender automatically cancels related jobs on a best-effort basis:| Cancelled job | What else gets cancelled |
|---|---|
| Parent job | All child jobs that are still queued or pending |
| Child job | The parent job (now unresolvable) and any sibling child jobs waiting alongside it |
| Batch job | Child jobs belonging to that batch job |
Cancellable States
Only jobs in the following states can be cancelled:| Status | Cancellable |
|---|---|
queued | Yes |
pending | Yes |
render:dorender | No - actively rendering |
finished | No - already complete |
error | No - already failed |
manually_cancelled | No - already cancelled |
Authorizations
Bearer token authentication using API tokens for team-based access control.
You can generate your own API token at: https://app.nexrender.com/settings/api-tokens
Response
Successfully cancelled the job and any related jobs that were also cancellable.
Was this page helpful?

