Delete a run
curl --request DELETE \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}', 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}/runs/{run_id}';
const options = {method: 'DELETE', 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}/runs/{run_id}"
req, _ := http.NewRequest("DELETE", 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}/runs/{run_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: <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}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.delete("https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}")
.header("X-API-Key", "<api-key>")
.asString();{
"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": "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
Delete a run
Remove a run’s stored results. The job and its other runs are kept. Idempotent.
DELETE
/
jobs
/
{job_id}
/
runs
/
{run_id}
Delete a run
curl --request DELETE \
--url https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}', 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}/runs/{run_id}';
const options = {method: 'DELETE', 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}/runs/{run_id}"
req, _ := http.NewRequest("DELETE", 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}/runs/{run_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: <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}/runs/{run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.delete("https://async.api.zenrows.com/v1/jobs/{job_id}/runs/{run_id}")
.header("X-API-Key", "<api-key>")
.asString();{
"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": "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.
Identifier of one run of the job.
Response
The run was deleted.
Was this page helpful?