Skip to main content

Upload and parse a contact list file

POST 

/api/partner-gateway/contacts/upload

Imports the rows of a CSV, text or Excel file as contacts of your account.

  • How to send it: as multipart/form-data, with the file in file and its original name in fileName. The format is detected from the extension of fileName.
  • Formats: .csv and .txt files delimited by commas, semicolons, pipes or tabs (detected automatically), and Excel .xls and .xlsx files. For VCard files, use POST /contacts/upload/vcard.
  • Columns are mapped automatically from the header names the platform recognises, such as firstName, lastName, phoneNumber and email. Send removeHead=true when the first row holds column headers, so that it is not imported as a contact.
  • Create or update: new contacts are created, and a contact already in your account, matched by mobile phone number or by email address (compared after normalisation), is updated. If the phone number and the email match two different contacts, the one matched by email is updated.
  • List: with listId, every contact imported is added to that contact list.
  • Consents: the file cannot carry consents. The optional consents form field gives the same consents to every imported contact; the rules are on the field.

Large files are imported in the background. For 50,000 rows or more (a lower threshold applies in test environments) the call answers 200 at once with numContact, addedContact, updatedContact and numError set to -1 and listId and listName null. The final counts arrive only in the import-completed email sent to the user the API key belongs to. Do not upload the file again when you get -1: that would run the import a second time.

Request​

Responses​

File imported: the counts of added, updated and failed contacts, all -1 when the import continues in the background.