Cancel the current run
curl --request POST \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/cancel \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/jobs/{job_id}/cancel';
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://async.api.zenrows.com/v1/jobs/{job_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://async.api.zenrows.com/v1/jobs/{job_id}/cancel")
.header("X-API-Key", "<api-key>")
.asString();{
"run_id": "01M4E06YS7VZPY4G25DV6FR3B8",
"job_id": "01M4E06YS7BDRECVN5QRHJA6HR",
"run_sequence": 1,
"status": "stopped",
"trigger": "manual",
"last_batch_received": false,
"stats": {
"total": 3,
"completed": 1,
"successful": 1,
"failed": 0,
"spend": {
"credits": 1,
"cost": 0.00009
}
},
"created_at": "2026-10-08T14:55:52Z",
"updated_at": "2026-10-08T14:56:06Z"
}{
"code": "invalid_argument",
"detail": "Validation failed.",
"instance": "/v1",
"status": 400,
"title": "Validation failed (invalid_argument)",
"type": "https://docs.zenrows.com/api-error-codes#invalid_argument"
}{
"code": "unauthenticated",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Unauthenticated (unauthenticated)",
"type": "https://docs.zenrows.com/api-error-codes#unauthenticated"
}{
"code": "payment_required",
"detail": "No credits available.",
"instance": "/v1",
"status": 402,
"title": "No credits available (payment_required)",
"type": "https://docs.zenrows.com/api-error-codes#payment_required"
}{
"code": "not_found",
"detail": "Job not found.",
"instance": "/v1",
"status": 404,
"title": "Job not found (not_found)",
"type": "https://docs.zenrows.com/api-error-codes#not_found"
}{
"code": "conflict",
"detail": "The run already completed.",
"instance": "/v1",
"status": 409,
"title": "The run already completed (conflict)",
"type": "https://docs.zenrows.com/api-error-codes#conflict"
}{
"code": "quota_exceeded",
"detail": "Too many active jobs.",
"instance": "/v1",
"status": 429,
"title": "Too many active jobs (quota_exceeded)",
"type": "https://docs.zenrows.com/api-error-codes#quota_exceeded"
}{
"code": "internal",
"detail": "Temporary failure, retry with backoff.",
"instance": "/v1",
"status": 503,
"title": "Temporary failure, retry with backoff (internal)",
"type": "https://docs.zenrows.com/api-error-codes#internal"
}Batch
Cancel the current run
An alias of stopBatchRun.
POST
/
jobs
/
{job_id}
/
cancel
Cancel the current run
curl --request POST \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/cancel \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://async.api.zenrows.com/v1/jobs/{job_id}/cancel';
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://async.api.zenrows.com/v1/jobs/{job_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://async.api.zenrows.com/v1/jobs/{job_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://async.api.zenrows.com/v1/jobs/{job_id}/cancel")
.header("X-API-Key", "<api-key>")
.asString();{
"run_id": "01M4E06YS7VZPY4G25DV6FR3B8",
"job_id": "01M4E06YS7BDRECVN5QRHJA6HR",
"run_sequence": 1,
"status": "stopped",
"trigger": "manual",
"last_batch_received": false,
"stats": {
"total": 3,
"completed": 1,
"successful": 1,
"failed": 0,
"spend": {
"credits": 1,
"cost": 0.00009
}
},
"created_at": "2026-10-08T14:55:52Z",
"updated_at": "2026-10-08T14:56:06Z"
}{
"code": "invalid_argument",
"detail": "Validation failed.",
"instance": "/v1",
"status": 400,
"title": "Validation failed (invalid_argument)",
"type": "https://docs.zenrows.com/api-error-codes#invalid_argument"
}{
"code": "unauthenticated",
"detail": "Invalid API key.",
"instance": "/v1",
"status": 401,
"title": "Unauthenticated (unauthenticated)",
"type": "https://docs.zenrows.com/api-error-codes#unauthenticated"
}{
"code": "payment_required",
"detail": "No credits available.",
"instance": "/v1",
"status": 402,
"title": "No credits available (payment_required)",
"type": "https://docs.zenrows.com/api-error-codes#payment_required"
}{
"code": "not_found",
"detail": "Job not found.",
"instance": "/v1",
"status": 404,
"title": "Job not found (not_found)",
"type": "https://docs.zenrows.com/api-error-codes#not_found"
}{
"code": "conflict",
"detail": "The run already completed.",
"instance": "/v1",
"status": 409,
"title": "The run already completed (conflict)",
"type": "https://docs.zenrows.com/api-error-codes#conflict"
}{
"code": "quota_exceeded",
"detail": "Too many active jobs.",
"instance": "/v1",
"status": 429,
"title": "Too many active jobs (quota_exceeded)",
"type": "https://docs.zenrows.com/api-error-codes#quota_exceeded"
}{
"code": "internal",
"detail": "Temporary failure, retry with backoff.",
"instance": "/v1",
"status": 503,
"title": "Temporary failure, retry with backoff (internal)",
"type": "https://docs.zenrows.com/api-error-codes#internal"
}Authorizations
Batch, Crawl, the Extract endpoints and the account endpoint read the same key from the X-API-Key header.
Path Parameters
Identifier returned when the job was created.
Response
The run, stopped.
One run of a job.
1 for the first run, then one more per rerun or scheduled fire.
completed, failed, stopped and deleted are terminal.
Available options:
pending, running, completed, failed, stopped, deleted paused after pauseBatchRun; status does not change.
Available options:
active, paused What started the run.
Available options:
manual, scheduled Open jobs: whether the final addBatchTasks call arrived.
Task counters. completed is successful plus failed.
Show child attributes
Show child attributes
Only when the whole run failed. Open set; new values may appear.
Examples:
"insufficient_credits"
"subscription_inactive"
"api_key_cap_reached"
What happened, for example which cap and when it resets.
Was this page helpful?