Skip to Content
SendlySendly
API ReferenceContacts

Import contacts from a CSV file

POST
/api/contacts/import

Queue an import of contacts from a CSV file. Send it as multipart/form-data with the file in the file field, or as application/json for a caller that cannot send multipart: { csv, filename? }, the whole file as text. The first row is the header and must include an email column; other columns become custom fields.

The file may be up to 5 MB and must hold no more rows than the project's per-import limit; a file over either limit, or one with no email column, is refused with 400 VALIDATION_ERROR (IMPORT_LIMIT_EXCEEDED for the row limit) before anything is queued, as is a call with no body, a body that is neither multipart nor valid JSON, or no file part. A JSON body that is not { csv, filename? } answers 422 VALIDATION_ERROR. The import runs in the background, so new contacts appear in the contact list as it finishes.

Requires the contacts:write scope — Create, update, and delete your contacts.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

  1. body
file*file

The CSV file. Its name must end in .csv, or its type must be text/csv.

Formatbinary

Response Body

Accepted

application/json
  1. response

The import was accepted and is queued; it has not run yet.

success*true
Value intrue
data*
Example Request
curl -X POST 'https://api.sendly.now/api/contacts/import' \  -H 'Content-Type: application/json' \  -d '{  "csv": "string"}'
Example Response
{  "success": true,  "data": {    "message": "string"  }}