Finalize a previewed CSV import — insert rows, merge duplicates, link companies, and dispatch AI-column enrichment.
POST /api/lists/{id}/import — upload the CSV/XLSX, parse it, and get back an auto-detected mapping plus the normalized csv_text. No rows are written.PUT /api/lists/{id}/import (this endpoint) — replay csv_text with a confirmed mapping to actually insert + merge rows.list_company_rows as needed. Rows whose company matches the caller’s blocked_companies list are skipped.
After row writes, the server dispatches sheet-ai-enrich Trigger.dev runs for every AI-powered column on the list. Custom columns created during this import enrich every row in the list; pre-existing AI columns enrich only the freshly affected rows.
POST /api/lists/{id}/import (multipart/form-data with file) to preview.mapping.PUT /api/lists/{id}/import with csv_text, the final mapping, and skipExistingCustomers (default true).linkedin_url, first_name, last_name, full_name, headline, company, location, domain. Custom columns use column:<Name> (map into an existing custom column) or new:<Name> (create a new column at import time — the server infers source and response_type via LLM heuristics).Credit model. This endpoint does not check or deduct credits — that’s done by confirmCreateWithImport. Free to call on an existing list.Counter semantics. imported counts new rows; updated counts merged duplicates; skipped is the union of all skip reasons; crossListSkipped and blockedSkipped break skipped down. rowIds contains every affected row id (insert + update) — use this as the seed for any follow-up operations (e.g. triggering a specific enrichment).AI column enrichment. enrichmentTriggered is the count of sheet-ai-enrich Trigger.dev runs dispatched. Poll the column’s cells (GET /api/lists/{id}/columns/{colId}/preview-cells or listen via Supabase Realtime) to observe completion.Warnings are non-fatal. If warnings is present, inspect it — the import still succeeded for all rows the server could process, but individual columns or enrichment dispatches failed.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 for the confirm step. This DOES accept JSON (the preview step was multipart).
The exact csv_text returned by previewListImport. The server re-parses it; do not alter whitespace or quoting.
1Finalized column mapping. Built-in field keys: linkedin_url, first_name, last_name, full_name, headline, company, location, domain. Custom columns use column:<Name> (map into an existing custom column) or new:<Name> (create a new custom column at import time). Values are the CSV column name, or null to skip.
Default true. When on, rows already present in any of the caller's other lists (cross-list dedup) and rows matching the blocked_companies list are skipped.
Import completed. See imported / updated / skipped.
Number of new list_rows inserted.
0 <= x <= 9007199254740991Number of existing rows merged with incoming data (dedup matched on LinkedIn URL → name+company → name+location → name).
0 <= x <= 9007199254740991Total rows skipped — union of cross-list dedup and other skip reasons.
0 <= x <= 9007199254740991Rows skipped because the person is already in another list.
0 <= x <= 9007199254740991Total rows in the parsed CSV.
0 <= x <= 9007199254740991All list_rows affected (inserted + updated).
^([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)$New company rows created and attached to this list.
0 <= x <= 9007199254740991Rows that were successfully linked to a company.
0 <= x <= 9007199254740991Rows skipped because the associated company is on the user's blocked_companies list.
0 <= x <= 9007199254740991Number of sheet-ai-enrich Trigger.dev runs dispatched for AI columns.
0 <= x <= 9007199254740991Non-fatal issues (column creation errors, enrichment dispatch failures). Present only when there is at least one.