Cancel one or more in-flight Google Maps scrape jobs. Any leads already scraped remain preserved in your Business Lists and stay retrievable via GET /get-scrape-results. Only jobs still pending, queued, running, processing, or interrupted are cancellable — jobs already done, failed, or cancelled are returned in already_terminal untouched.
#Request
# Cancel one job
curl -X POST "https://uunrlffonnvmbsstkpze.supabase.co/functions/v1/cancel-scrape-job" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"task_id": "uuid-here"}'
# Cancel many at once (up to 500 per call)
curl -X POST "https://uunrlffonnvmbsstkpze.supabase.co/functions/v1/cancel-scrape-job" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"task_ids": ["uuid-a", "uuid-b", "uuid-c"]}'#Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
| task_id | string | Either this or task_ids |
Single task_id returned by /maps-search. |
| task_ids | string[] | Either this or task_id |
Up to 500 task_ids to cancel in one call. |
#Response (200 OK)
{
"success": true,
"cancelled": ["uuid-a", "uuid-b"],
"already_terminal": [{ "task_id": "uuid-c", "status": "done" }],
"not_found": [],
"message": "Cancelled 2 scrape jobs. Partial results already scraped are preserved in your Business Lists and remain retrievable via GET /get-scrape-results."
}Notes:
- Cancellation is asynchronous — the finalizer runs in the background to persist partial results and flip any child work-tiles to
cancelled. You can immediately re-pollGET /get-scrape-results?task_id=...to fetch what was scraped up to the cancel point. - API keys can only cancel jobs owned by their user (workspace-member keys can cancel jobs they created; unknown/foreign IDs come back in
not_found). - Safe to call twice on the same
task_id— the second call returns it inalready_terminalwithstatus: "cancelled".