Kick off a new lead search — or reset an existing one — against the Apify leads-finder actor. Runs asynchronously.
search_id is supplied) and dispatches the lead-search Trigger.dev task against the Apify leads-finder actor.
The flow is asynchronous: the response returns a search row with status: "pending". Poll GET /api/leads/search/{id} until status === "completed", then fold results into a list via POST /api/leads/search/{id}/add-to-list (or POST /api/lists/{id}/add-search-results to merge into an existing list).
Fetches up to 2500 rows per run (the server clamps fetch_count to that ceiling). Typical Apify run time is 30 seconds to 5 minutes.
listId binds the search to a list so results auto-fold in on completion. Only one active search per list — a second concurrent POST returns 409.
/api/leads/search with the list verb. See List lead searches to enumerate the caller’s recent searches.POST /api/leads/parse-filters — convert the human’s natural-language prompt into a structured filter object.POST /api/leads/search — pass those filters plus the original nl_query so the title reads well.GET /api/leads/search/:id — poll every 5 to 10 s until status === "completed".POST /api/leads/search/:id/add-to-list — turn results into a new List (or POST /api/lists/:id/add-search-results for an existing one).fetch_count is clamped at 2500 — do not bother asking for more.100K to 10B); sending min_revenue > max_revenue is silently swapped server-side."actively hiring", "seeking pipeline", etc.) are not supported. Use parseLeadFilters to validate intent before submission and surface the unsupported string back to the human.status is pending or running. Most runs finish within 2 minutes; give up at 10 minutes and escalate with the correlationId.On 409: another search is active for the list. Wait for it to complete, or DELETE it first.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Filters merge with the top-level fields — the server extracts search_id, nl_query, and listId, then treats the rest as structured filters.
Apollo-style seniority bucket.
founder, owner, c_suite, partner, vp, head, director, senior, manager, entry Company headcount bands, e.g. 1-10, 11-20, 21-50.
Annual revenue band (ordered). Server swaps min_revenue and max_revenue automatically if they arrive out of order.
100K, 500K, 1M, 5M, 10M, 25M, 50M, 100M, 500M, 1B, 5B, 10B Annual revenue band (ordered). Server swaps min_revenue and max_revenue automatically if they arrive out of order.
100K, 500K, 1M, 5M, 10M, 25M, 50M, 100M, 500M, 1B, 5B, 10B Maximum rows to fetch from the Apify actor. Server-clamped to [1, 2500]; defaults to 2500 when omitted.
0 < x <= 2500Set to re-run an existing search with fresh filters. Previous lead_search_results rows are hard-deleted before the new Apify run dispatches. Ownership is enforced.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Original natural-language query (e.g. "VPs of Sales at SaaS companies in Austin"). Feeds the title generator so the resulting search title matches the user's intent; also helpful for observability.
Bind this search to a List. On completion the Trigger task auto-folds results via addSearchResultsToList(). Only one active search per list — a second concurrent call returns 409.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Existing search reset and re-dispatched (body included search_id).
Search created (or reset, for re-runs). Status is pending; the Trigger.dev lead-search task owns execution from here. Poll GET /api/leads/search/{id} for progress.
Canonical lead search entity.