Attach a completed lead-search payload to an existing list — dedupe, link companies, auto-create profile columns, and dispatch enrichment.
POST /api/leads/search completes (asynchronously, via Trigger.dev — see GET /api/leads/search/{id} for polling), call this endpoint to commit those results into a list. The server:
lead_searches row by searchId, verifies the caller owns both the search and the target list, and checks the search is in the completed state with at least one result.skipCrossListDedup: true — against every other list owned by the caller (four-tier cascade).list_company_rows, and sets company_row_id on each person.GET /api/leads/search/{id} reports status: "completed". The lead-search task can auto-add results to a list when given a listId up front (see the leads-search API), so you only need this endpoint when you created the list after the search started.Body. { searchId: "<uuid>" } is the minimum. Pass skipCrossListDedup: true only for deliberate re-imports into a dedicated list.Error handling.Search is not completed — poll again later; the search is still running.Search has no results — the search returned zero leads. Stop.Search not found / List not found — the caller doesn’t own the resource. Surface to the user.GET /api/lists/{id} (core route) to observe the new row count and enrichment status. The response counters (inserted, skipped, companiesCreated) are the single source of truth for “did we actually add anything” — don’t infer from HTTP status alone.Service-role caveat. Internally this route uses the Supabase service role to bypass RLS for fan-out writes. Ownership is enforced in application code before any write — if this endpoint ever returns 200, the caller owns the resulting rows.Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
List UUID
^([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)$JSON body. searchId is required.
lead_searches.id — the completed search run whose results should be added. Typically the id returned from POST /api/leads/search.
1Default false. When true, rows already present in other lists owned by the caller are still inserted (the per-list linkedin_url uniqueness check still applies). Use this for targeted re-imports.
Results added. Returns per-category counters.
Shape of the addSearchResultsToList() result. Additional counters (e.g. columns created, enrichment tasks triggered) may be present — treat the response as extensible.
New list_rows created from the search payload.
0 <= x <= 9007199254740991Rows skipped due to duplicates (within-list linkedin_url uniqueness, optional cross-list dedup, or blocked companies).
0 <= x <= 9007199254740991New list_company_rows extracted from the search payload.
0 <= x <= 9007199254740991