Upload contacts file

POST https://app.speybooks.com/api/v1/contact-imports/upload

Upload a contacts CSV file. The UCI engine parses contacts, builds an identity graph using Disjoint Set Union, detects duplicates via signal vector similarity (name 0.40, email 0.35, phone 0.15, postcode 0.10), and returns a merge preview.

Hard keys (VAT number, company registration number, email domain) force identity merges. Soft similarity above threshold triggers conflict review. The preview includes up to 50 outcome groups.

Maximum file size: 5 MB. Only CSV files are accepted.

The response includes a preview array containing the DSU graph outcomes — each entry shows the resolution type (CREATE, MERGE, or CONFLICT), the participating nodes (import rows and/or ledger contacts), and the evidence that linked them. This is everything needed to render the identity resolution UI.

Response

201 CSV parsed and identity resolution preview created. Returns import ID, column mapping, detected headers, conflict stats, and up to 50 preview outcomes.
Show response fields
columnMapping object
Show child attributes
0 string
1 string
2 string
detectedHeaders array<string>
filename string
hasConflicts boolean
importId string
preview array<object>
Show child attributes
evidence array<object>
nodes array<object>
Show child attributes
contactId string nullable
email string
hardKeys array<string>
id string
isLedger boolean
name string
types array<string>
vatNumber string nullable
type string
stats object
Show child attributes
conflicts integer
creates integer
merges integer
skips integer
totalRows integer
validContacts integer

Error codes

400 No file uploaded, non-CSV file, parse error, or no valid contact rows found.
413 File exceeds 5MB limit.