Contacts

Create Contact Import

Changed on

Import contacts from a CSV, sent either as an uploaded file (multipart) or as CSV text in a JSON body (csvContent). The CSV is stored and processed in the background; poll GET /v1/contacts/imports/{id} for status and counts. Requires API key with audience:write.

post/v1/contacts/imports

Request

  • Base URL
    https://api.migma.ai
  • URL
    https://api.migma.ai/v1/contacts/imports
  • Auth
    API key in header Authorization

Request body

csvContentstring required

Full CSV text including the header row. Same 200MB limit as a file.

fileNamestring

Name shown for the import.

projectIdstring required

Project ID

columnMapobject required

Maps subscriber fields to CSV header names. Only email is required. Supported keys: email, firstName, lastName, name, phone, country, language, and customFields (an object mapping each custom field key to its CSV header).

onConflict'skip' | 'upsert'

How to handle rows whose email already exists.

delimiterstring

CSV field delimiter.

tagsstring[]

Tag names or existing tag IDs to apply to every imported contact. Unknown names create tags.

Response

Import accepted for background processing

successboolean required
errorstring nullable

Example response

{
  "data": {
    "object": "contact_import",
    "status": "processing"
  }
}

Changes