Empty Squid
curl --request POST \
--url https://api.lobstr.io/v1/squids/{squid_hash}/empty \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/squids/{squid_hash}/empty"
payload = { "type": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({type: '<string>'})
};
fetch('https://api.lobstr.io/v1/squids/{squid_hash}/empty', 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/squids/{squid_hash}/empty",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/squids/{squid_hash}/empty"
payload := strings.NewReader("{\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lobstr.io/v1/squids/{squid_hash}/empty")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/squids/{squid_hash}/empty")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"emptied": true,
"deleted_count": 123
}Squid
Empty Squid
Remove all tasks and results from a squid while keeping its configuration intact
POST
/
v1
/
squids
/
{squid_hash}
/
empty
Empty Squid
curl --request POST \
--url https://api.lobstr.io/v1/squids/{squid_hash}/empty \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"type": "<string>"
}
'import requests
url = "https://api.lobstr.io/v1/squids/{squid_hash}/empty"
payload = { "type": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({type: '<string>'})
};
fetch('https://api.lobstr.io/v1/squids/{squid_hash}/empty', 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/squids/{squid_hash}/empty",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.lobstr.io/v1/squids/{squid_hash}/empty"
payload := strings.NewReader("{\n \"type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lobstr.io/v1/squids/{squid_hash}/empty")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lobstr.io/v1/squids/{squid_hash}/empty")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"emptied": true,
"deleted_count": 123
}This endpoint removes all tasks and their associated results from a specified squid, returning the number of deleted items while keeping the squid’s configuration intact.
What Gets Deleted
Depending on thetype parameter:
- url: Removes all URL-based tasks and their results
- params: Removes all parameter-based tasks and their results
- Clear old tasks before adding new ones
- Reset a squid without losing its configuration
- Remove tasks that are no longer needed
Headers
string
required
Your API authentication token. Value:
Token YOUR_API_KEYstring
required
Must be application/json. Value:
application/jsonPath Parameters
string
required
The unique identifier (hash) of the squid to empty. Example:
388d6d5e98134294ac612ec9f99dc5b1Request Body
string
required
Type of tasks to remove: ‘url’ for URL-based tasks or ‘params’ for parameter-based tasks. Example:
"url"Response Field Explanations
string
Squid identifier. Example:
"388d6d5e98134294ac612ec9f99dc5b1"string
Always “squid”. Example:
"squid"boolean
Boolean indicating success. Example:
trueinteger
Number of tasks deleted. Example:
150This action is irreversible. All tasks and results of the specified type will be permanently deleted.
Use this before re-importing tasks to avoid duplicates. Empty the squid, then add fresh tasks.
The squid’s configuration (parameters, integrations, schedule) is preserved. Only tasks and results are removed.
Check the ‘deleted_count’ in the response to verify how many tasks were removed.
If a run is currently active, stop it before emptying the squid to avoid conflicts.
Code Examples
curl -X POST "https://api.lobstr.io/v1/squids/388d6d5e98134294ac612ec9f99dc5b1/empty" \
-H "Authorization: Token YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "url"
}'
import requests
squid_id = "388d6d5e98134294ac612ec9f99dc5b1"
url = f"https://api.lobstr.io/v1/squids/{squid_id}/empty"
headers = {
"Authorization": "Token YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"type": "url" # or "params" for parameter-based tasks
}
response = requests.post(url, headers=headers, json=payload)
result = response.json()
print(f"Squid emptied: {result['emptied']}")
print(f"Tasks deleted: {result['deleted_count']}")
print(f"Squid ID: {result['id']}")
Response
200
{
"id": "388d6d5e98134294ac612ec9f99dc5b1",
"object": "squid",
"emptied": true,
"deleted_count": 1
}