Path Parameters
campaign_id(integer, required): The unique identifier of the campaign
Request
This endpoint acceptsmultipart/form-data with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | CSV file with contacts |
column_mappings | string | No | JSON string mapping CSV columns to fields |
CSV Format Requirements
- Required column: Phone number (auto-detected or mapped)
- Recommended: Header row with column names
- Encoding: UTF-8
- Delimiter: Comma (,)
Phone Number Validation
Phone numbers are automatically normalized to E.164 format:| Input Format | Normalized Output |
|---|---|
5551234567 | +15551234567 |
1-555-123-4567 | +15551234567 |
(555) 123-4567 | +15551234567 |
+15551234567 | +15551234567 |
Column Mapping
The system auto-detects common column names:| CSV Column Names | Maps To |
|---|---|
| phone, phone_number, mobile, cell | phone_number |
| name, full_name, contact_name | name |
| email, email_address | email |
| company, organization | company |
Example CSV
Response
Response
Response Fields
| Field | Description |
|---|---|
success | Whether import succeeded |
message | Human-readable status |
imported_count | Number of contacts imported |
total_contacts | Total contacts in campaign after import |
file_name | Original filename |
import_date | Import timestamp |
Example Code
cURL
Python
JavaScript
Behavior
- Existing contacts with same phone number are skipped (not duplicated)
- Pending/skipped contacts from previous imports are deleted before new import
- Completed/failed contacts are preserved for history
- All custom columns become template variables
Error Responses
| Status Code | Description |
|---|---|
| 400 | Invalid file format or empty file |
| 404 | Campaign not found |
| 500 | Import processing failed |
Best Practices
- Validate data before importing - check phone number formats
- Use consistent column names across imports
- Include name column for better personalization
- Remove duplicates in your source data
- Test with small file before large imports