Stage 1 of the 2-step company CSV/XLSX import. Parses the file and returns an auto-detected column mapping for confirmation.
| Step | Method | What it does |
|---|---|---|
| 1 | POST /api/lists/{id}/companies/import | Upload the file, parse it, auto-detect a column mapping, return a preview. No rows written. |
| 2 | PUT /api/lists/{id}/companies/import | Re-send the parsed csv_text plus the final mapping; server upserts by domain. |
updateListCompanyImport for step 2.
multipart/form-data with a single file field:
.csv — parsed with a quote-aware CSV reader that handles multiline quoted fields and Windows line endings..xlsx / .xls — parsed with SheetJS. Only the first sheet is read; it is also converted to CSV so step 2 can be CSV-only.domain, name, linkedin_url, industry, employee_count, founded_year, funding_stage, location, city, state, country, website, description) are matched against a hand-curated synonym list. Exact (lowercased) hits win.csvColumnMapping) with the unmatched headers plus 3 sample rows. Used only when OPENROUTER_API_KEY is set.column:<name> (if it matches an existing company-subject column on the list) or new:<name> (to be created at confirm time).auto_mapping is a flat target → source map — edit it client-side before calling step 2.
csv_text round-trip. The csv_text returned by step 1 must be passed back verbatim to step 2. XLSX files are normalized to CSV in step 1 so the PUT handler never needs to touch a binary.Mapping edits. The mapping returned here is advisory. You can drop built-in field keys, swap source columns, or change new: → column: before the confirm. Unknown fields in the mapping object are ignored by step 2.Blocklist applies at step 2, not here. skipExistingCustomers is a PUT-only flag. Expect the preview row count to be higher than the eventual imported + updated count.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)$Import preview with detected column mapping.
Column-mapping preview for a CSV/XLSX company import.
Header names extracted from the uploaded file.
Detected mapping from target company field → source column name. Keys include the 13 built-in fields (domain, name, linkedin_url, industry, employee_count, founded_year, funding_stage, location, city, state, country, website, description), plus custom-column keys prefixed with new: (new column to create) or column: (match to an existing custom column). Unmapped fields are null.
First five rows of the parsed file for preview.
Number of non-empty data rows detected in the file.
0 <= x <= 9007199254740991Normalized CSV string. XLSX/XLS uploads are converted here so the PUT confirm step can be CSV-only.
Names of existing company-subject columns already on this list, used by the confirm step to dedupe custom-column creation.