API
Automations (scheduled searches)
Schedule a search to re-run on a cadence and export itself — over the API, not just in the app.
An automation re-runs a search on a schedule and sends the results wherever you want, with no one at a keyboard. Anything you can set up on the Automations page you can also do here — and both read the same records, so a schedule created over the API shows up in the dashboard immediately.
Every run spends leads — one per result, same as a manual search. Pause an automation to stop it spending.
GET/api/v1/schedules
Lists your automations with their cadence, destination, next run and last result.
POST/api/v1/schedules
| keyword | Required. The niche to search, e.g. "roofing contractor". |
| locations | Required. Cities as plain strings — ["Austin, TX"] — or {location_code, location_name} objects. Max 25. |
| cadence | Required. once | daily | weekly | monthly | yearly. |
| destination | Where each run's leads go. Omit to just save them to your library. |
| start_at | ISO timestamp of the first run. Defaults to now — the next tick runs it, within 15 minutes. |
curl -X POST https://leadmarina.com/api/v1/schedules \
-H "Authorization: Bearer lm_live_xxxx" \
-H "Content-Type: application/json" \
-d '{
"keyword": "roofing contractor",
"locations": ["Austin, TX", "Dallas, TX"],
"cadence": "weekly",
"destination": { "provider": "email", "format": "csv" }
}'The response echoes the cities it resolved, so you can confirm you got the places you meant:
{
"id": "9f2c...81a",
"locations": [
{ "location_code": 200635, "location_name": "Austin, TX, Texas, United States" },
{ "location_code": 1026339, "location_name": "Dallas, Texas, United States" }
]
}A close, ghl or google_sheets destination is checked when you create the schedule, not at 3am on the first run — if the integration isn’t connected (or Close has no saved field mapping yet) you get a 400 right away instead of a schedule that fails silently every week.
PATCH/api/v1/schedules/:id
Pause or resume: { "active": false }. Pausing keeps the automation but stops it running and spending.
DELETE/api/v1/schedules/:id
Deletes the schedule. Leads collected by past runs are kept. A schedule that isn’t yours returns 404 — up to 20 automations per account.
