Skip to main content
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>"
}
'
{
  "id": "<string>",
  "object": "<string>",
  "emptied": true,
  "deleted_count": 123
}

Documentation Index

Fetch the complete documentation index at: https://docs.lobstr.io/llms.txt

Use this file to discover all available pages before exploring further.

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 the type parameter:
  • url: Removes all URL-based tasks and their results
  • params: Removes all parameter-based tasks and their results
The squid itself remains with all its settings (name, parameters, integrations, schedule) preserved. This is useful when you want to:
  • Clear old tasks before adding new ones
  • Reset a squid without losing its configuration
  • Remove tasks that are no longer needed

Headers

Authorization
string
required
Your API authentication token. Value: Token YOUR_API_KEY
Content-Type
string
required
Must be application/json. Value: application/json

Query Parameters

squid_hash
string
required
The unique identifier (hash) of the squid to empty. Example: 388d6d5e98134294ac612ec9f99dc5b1

Request Body

type
string
required
Type of tasks to remove: ‘url’ for URL-based tasks or ‘params’ for parameter-based tasks. Example: "url"

Response Field Explanations

id
string
Squid identifier. Example: "388d6d5e98134294ac612ec9f99dc5b1"
object
string
Always “squid”. Example: "squid"
emptied
boolean
Boolean indicating success. Example: true
deleted_count
integer
Number of tasks deleted. Example: 150
This 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"
  }'

Response

200
{
  "id": "388d6d5e98134294ac612ec9f99dc5b1",
  "object": "squid",
  "emptied": true,
  "deleted_count": 1
}