Base path:
/contact/ingestionOverview
The contact ingestion API allows bulk importing contacts from CSV or Excel files. The flow is:- Upload - Parse file, specify if header row exists, create session
- Validate - Apply column mappings and validate all rows
- Paginate - Fetch validation results page by page
- Execute - Import valid rows, get failed rows CSV
Types
Type Definitions
Type Definitions
Mappable Fields
Standard Contact Fields
Custom Attributes
Map to custom attributes using thecustom. prefix:
text- String valuenumber- Numeric valueboolean- true/false (accepts: true, false, 1, 0, yes, no)date- ISO date stringphone_number- Valid phone formatemail- Valid email formaturl- Valid URL format
Phone Normalization (Morocco)
Phone numbers are validated and normalized to the Morocco international format (+212XXXXXXXXX).
Accepted input formats:
Validation rules:
- Must be a valid Morocco phone number
- After normalization, must match:
+212[5|6|7|8]XXXXXXXX - The digit after
212must be5,6,7, or8(Morocco phone prefixes)
+1234567890- Non-Morocco country code+212312345678- Invalid prefix (3 is not a valid prefix)12345- Too short
International numbers will be supported in a future update.
Upload a CSV or Excel file to start ingestion
Limits:- Maximum 100,000 rows per file
- Maximum 100 preview rows
- Supported formats: CSV, XLSX, XLS
- When
hasHeaderRow=false: Columns are named “Column 0”, “Column 1”, etc. Preview includes all rows. - When
hasHeaderRow=true: Columns use actual header values from row 0. Preview excludes the header row.
- If
audienceIdis provided, the audience is validated immediately (fail-fast) - If the audience doesn’t exist, the upload fails with
404error - The audience ID is stored in the session and used during execute phase
Validate data with column mappings
Get paginated validation results after validation is comp…
Query Parameters:Execute the import of valid contacts
Behavior:- Only valid rows are imported
- Existing contacts (matched by phone) are updated
- New contacts are created
- Invalid rows are included in the failed CSV
- Session is marked as
executingduring import to prevent concurrent requests - Session is marked as
executedafter completion (cannot be executed again) - If
audienceIdwas provided at upload, contacts are linked to the audience after import - Audience linking is non-fatal: if linking fails, the import still succeeds (contacts are created/updated)
Failed Rows CSV Format
When import has failures, a CSV file is generated with:- All original columns (same order as uploaded file)
- Additional
_errorcolumn at the end with failure reason