Skip to main content
POST
Bulk import contacts from a CSV file into a campaign. The endpoint validates phone numbers, detects duplicates, and maps columns to contact fields.

Path Parameters

  • campaign_id (integer, required): The unique identifier of the campaign

Request

This endpoint accepts multipart/form-data with the following 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:

Column Mapping

The system auto-detects common column names: For custom mappings, provide a JSON object:

Example CSV

Response

Response

Response Fields

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

Best Practices

  1. Validate data before importing - check phone number formats
  2. Use consistent column names across imports
  3. Include name column for better personalization
  4. Remove duplicates in your source data
  5. Test with small file before large imports

Authorizations

Authorization
string
header
required

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

Path Parameters

campaign_id
integer
required

Body

multipart/form-data
file
file
required
column_mappings
string
default:{}

Response

Successful Response