Delete Task
curl --request DELETE \
--url https://api.lobstr.io/v1/tasks/{task_hash} \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/tasks/{task_hash}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/tasks/{task_hash}', 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.lobstr.io/v1/tasks/{task_hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.lobstr.io/v1/tasks/{task_hash}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.lobstr.io/v1/tasks/{task_hash}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/tasks/{task_hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"deleted": true
}Task
Delete Task
Permanently delete a specific task from a squid
DELETE
/
v1
/
tasks
/
{task_hash}
Delete Task
curl --request DELETE \
--url https://api.lobstr.io/v1/tasks/{task_hash} \
--header 'Authorization: <authorization>'import requests
url = "https://api.lobstr.io/v1/tasks/{task_hash}"
headers = {"Authorization": "<authorization>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<authorization>'}};
fetch('https://api.lobstr.io/v1/tasks/{task_hash}', 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.lobstr.io/v1/tasks/{task_hash}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$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.lobstr.io/v1/tasks/{task_hash}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<authorization>")
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.lobstr.io/v1/tasks/{task_hash}")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/tasks/{task_hash}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"deleted": true
}This endpoint permanently deletes a specific task using its hash ID. The task and its associated data will be removed from the system.
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYQuery Parameters
string
required
The unique identifier (hash) of the task to delete. Example:
c5e29d2aba8b77cdc56391e7405302deResponse Field Explanations
string
The deleted task’s identifier. Example:
"c5e29d2aba8b77cdc56391e7405302de"string
Always “task”. Example:
"task"boolean
Confirmation of deletion (true on success). Example:
trueThis action is permanent and cannot be undone. Task data and results will be lost.
Use Get Task first to verify you’re deleting the correct task.
Deleting a task does not affect results that have already been exported or delivered.
To remove all tasks from a squid, use the Empty Squid endpoint instead of deleting tasks one by one.
Code Examples
curl -X DELETE "https://api.lobstr.io/v1/tasks/c5e29d2aba8b77cdc56391e7405302de" \
-H "Authorization: Token YOUR_API_KEY"
import requests
task_hash = "c5e29d2aba8b77cdc56391e7405302de"
url = f"https://api.lobstr.io/v1/tasks/{task_hash}"
headers = {
"Authorization": "Token YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
result = response.json()
if result['deleted']:
print(f"Task {result['id']} deleted successfully")
else:
print("Failed to delete task")
Response
200
{
"id": "c5e29d2aba8b77cdc56391e7405302de",
"object": "task",
"deleted": true
}
404
{
"error": {
"message": "Task not found",
"type": "not_found_error",
"param": "task_hash"
}
}
⌘I