cURL
curl -X POST https://api.scrapio.dev/v1/jobs/job_abc123/cancel \
-H "Authorization: Bearer $SCRAPIO_API_KEY"import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/jobs/job_abc123/cancel",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
)
print(resp.json()["status"])const resp = await fetch("https://api.scrapio.dev/v1/jobs/job_abc123/cancel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}` },
}).then(r => r.json());
console.log(resp.status);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/jobs/{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 => [
"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.scrapio.dev/v1/jobs/{id}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.scrapio.dev/v1/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"job_id": "<string>",
"job_type": "<string>",
"status": "queued",
"mode": "async"
}{
"request_id": "<string>",
"job_id": "<string>",
"job_type": "<string>",
"status": "queued",
"mode": "async"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}Jobs
Cancel a job
Cancel an async job that hasn’t finished yet.
POST
/
v1
/
jobs
/
{id}
/
cancel
cURL
curl -X POST https://api.scrapio.dev/v1/jobs/job_abc123/cancel \
-H "Authorization: Bearer $SCRAPIO_API_KEY"import os, requests
resp = requests.post(
"https://api.scrapio.dev/v1/jobs/job_abc123/cancel",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
)
print(resp.json()["status"])const resp = await fetch("https://api.scrapio.dev/v1/jobs/job_abc123/cancel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}` },
}).then(r => r.json());
console.log(resp.status);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/jobs/{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 => [
"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.scrapio.dev/v1/jobs/{id}/cancel"
req, _ := http.NewRequest("POST", 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.post("https://api.scrapio.dev/v1/jobs/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/jobs/{id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"job_id": "<string>",
"job_type": "<string>",
"status": "queued",
"mode": "async"
}{
"request_id": "<string>",
"job_id": "<string>",
"job_type": "<string>",
"status": "queued",
"mode": "async"
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The job identifier returned when the job was created.
Example:
"job_abc123"
Response
The job was already in a terminal state; its current status is returned unchanged.