MessagePipedocs
API Reference

Contact imports

Upload a CSV, map it, dry-run it, then commit it with a consent declaration, all with an API key.

Imports bring contacts in from a CSV file with a record of where their consent came from. The flow is the dashboard's: upload, configure, dry run, commit. Imports cost 0 credits; the import is not a send.

OperationScopeRate classIdempotency-Key
GET /v1/importsimports:readread
GET /v1/imports/declarationimports:readread
GET /v1/imports/{id}imports:readread
GET /v1/imports/{id}/issuesimports:readread
POST /v1/importsimports:writewriteoptional
PUT /v1/imports/{id}/configimports:writewriteoptional
POST /v1/imports/{id}/dry-runimports:writewriteoptional
POST /v1/imports/{id}/commitimports:writewriterequired
POST /v1/imports/{id}/cancelimports:writewriteoptional

Every import call acts as a marketer, reads included, because the file and its report hold personal data. imports:write is a sensitive scope and is never pre-selected.

Upload

The body is the CSV itself, up to 10 MiB, with Content-Type: text/csv:

curl "https://api.messagepipe.dev/v1/imports?brand_id=brd_xxxxxxxx&filename=customers.csv" \
  -H "Authorization: Bearer mp_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: text/csv" \
  -H "Idempotency-Key: import-2026-11-customers" \
  --data-binary @customers.csv

A repeat of the same file under the same Idempotency-Key replays the first answer; a different file under the same key is 422 idempotency_mismatch. The gateway holds the file (up to the limit) in memory while it forwards it.

Configure and dry-run

PUT /v1/imports/{id}/config takes a mapping (which CSV header is the email, names, tags, attributes and the row's own consent date) and options: whether existing contacts are updated or skipped, the topic_ids to subscribe them to, the consent basis, the consent statement_id and version, collection_method and the collection_from date. The response says whether the configuration is valid and lists problems.

POST /v1/imports/{id}/dry-run checks every row without changing anything; read the outcome from GET /v1/imports/{id} and the row-level issues from GET /v1/imports/{id}/issues (JSON, or CSV with ?format=csv). Changing the configuration discards the dry run.

GET /v1/imports/declaration returns the exact declaration text. Committing requires "declaration_accepted": true (anything else, including the string "true", is refused), a finished dry run of the saved configuration, and an Idempotency-Key:

curl -X POST https://api.messagepipe.dev/v1/imports/imp_xxxxxxxx/commit \
  -H "Authorization: Bearer mp_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: commit-imp_xxxxxxxx" \
  -d '{"declaration_accepted": true}'

The attestation records the declaration text, the file hash, the person who created the key, and the key itself. The commit is audited as a warning with the key as actor. Whether a declaration made by a machine on a person's behalf is acceptable consent evidence in your jurisdiction is a legal question we have not settled; a workspace that does not want imports through the API simply does not give any key imports:write.