Skip to main content
PUT
/
api
/
lists
/
{id}
/
companies
/
import
Confirm a staged company import
curl --request PUT \
  --url https://app.puffle.ai/api/lists/{id}/companies/import \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "csv_text": "<string>",
  "mapping": {},
  "skipExistingCustomers": true
}
'
{ "imported": 4503599627370495, "updated": 4503599627370495, "skipped": 4503599627370495, "blockedSkipped": 4503599627370495, "total": 4503599627370495 }

Overview

Stage 2 of the 2-step import. Re-parses the CSV, normalizes domains (strips protocol and www.), consults the caller’s blocklist (unless disabled), upserts against existing rows by domain, and inserts new rows tagged source: "import". Returns per-bucket counts. Partial update errors are swallowed (failed updates just don’t increment updated); an outright insert failure returns 500.
This operation shares the URL path /api/lists/{id}/companies/import with other verbs. See the sibling page for related operations on the same resource.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

List UUID

Pattern: ^([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)$

Body

application/json

Confirm a staged CSV company import. Domain uniqueness is used for upsert — existing rows in the same list are updated; new ones are inserted.

csv_text
string
required

The normalized CSV text returned by the preview step. Re-parsed here so the client doesn't have to pass the file again.

mapping
object
required

Mapping from target field → source column name. Use the shape returned by the POST preview, optionally edited by the caller. Keys can include built-in fields, new:<name> (create new custom column), and column:<name> (reuse existing custom column).

skipExistingCustomers
boolean

When true (default), rows matching the caller's blocked_companies list are skipped. Counted separately in blockedSkipped.

Response

Import completed. See counters for per-row outcomes.

Per-status counters for the confirm step. imported + updated + skipped + blockedSkipped may be less than total if parser-level errors dropped rows.

imported
integer
required

Count of new company rows inserted.

Required range: 0 <= x <= 9007199254740991
updated
integer
required

Count of existing company rows updated (matched on lowercased domain).

Required range: 0 <= x <= 9007199254740991
skipped
integer
required

Count of rows with neither a name nor a domain.

Required range: 0 <= x <= 9007199254740991
blockedSkipped
integer
required

Count of rows skipped because they matched the caller's blocklist. Always 0 when skipExistingCustomers was false.

Required range: 0 <= x <= 9007199254740991
total
integer
required

Total non-empty data rows considered.

Required range: 0 <= x <= 9007199254740991