Add many contacts to a mailing list at once in CSV or JSON format, and follow the progress of the import. To choose between the v1 and v2 imports, see Importing contacts.
Import CSV to mailing list
Imports contacts from CSV data. The import runs in the background and the call returns before it is done. Imports of one account are processed one at a time, and the call fails if too many imports are already waiting. For large imports, split the data into batches, for example of 10,000 contacts, and import them one at a time. Use getImportStatus to follow the progress of the import. Property name restrictions apply here.
Import CSV to mailing list › Request Body
list_idMailing list ID.
properties_clientDeprecated. Set to null.
csvCSV data, raw or Base64-encoded, with property names in the header row. Use:
- Field separator
; - Encapsulation
" - Encoding
UTF-8 - Unix-style line endings
\n
receiptDeprecated. Set to null.
base64encodedcsv is Base64-encoded. Defaults to false.
truncateRemove current list members who are not in the new data. Defaults to false.
disable_cem_eventsDo not send LianaAutomation events for the import. Defaults to false.
use_list_propsImport properties as list-specific values instead of contact default values. Defaults to false.
use_duplicatesWhen the email and SMS of a row match two different contacts, add both to the list instead of rejecting the row. Defaults to false.
forkDeprecated. Set to null.
user_idID of the user to associate with the import. Must be the ID of the authenticated user.
import_idID of an existing import to use. Applies only with user_id, and the import must belong to that user.
consent_idConsent ID.
consent_langConsent language code, e.g. EN.
Import CSV to mailing list › Responses
OK
succeedResponse status.
resultReturns null.
Import JSON to mailing list
Imports contacts from JSON data. The data is converted to CSV and imported in the background like importCSVToMailingList with default options, so true means the import was started. For large imports, split the data into batches, for example of 10,000 contacts, and import them one at a time. Use getImportStatus to follow the progress of the import. Property name restrictions apply here.
Import JSON to mailing list › Request Body
list_idMailing list ID.
emailsJSON array of email addresses, or of objects with email, sms and property values keyed by property name. Property names are case-insensitive.
Import JSON to mailing list › Responses
OK
succeedResponse status.
resultReturns true on success.
Check CSV before import
Checks CSV data before an import without importing anything. Email addresses are checked against the blocklist of addresses and domains that cannot be imported. Returns true if all rows are allowed, the blocked addresses as CSV otherwise, or false if the data has no email or SMS column.
Check CSV before import › Request Body
list_idMailing list ID.
properties_clientDeprecated. Set to null.
csvCSV data, raw or Base64-encoded, with property names in the header row. Use:
- Field separator
; - Encapsulation
" - Encoding
UTF-8 - Unix-style line endings
\n
receiptDeprecated. Set to null.
base64encodedcsv is Base64-encoded. Defaults to false.
truncateRemove current list members who are not in the new data. Defaults to false.
Check CSV before import › Responses
OK
succeedResponse status.
resultBoolean true if all rows are allowed, false if the data has no email or SMS column, otherwise the blocked addresses in CSV format.
Get import status
Returns the progress of the import of a list started with importCSVToMailingList or importJSONToMailingList. The result is -1 when the import is finished, and also when the list has no import. Poll this until it returns -1, then use getImportLog to see the results.
Get import status › Request Body
list_idMailing list ID.
Get import status › Responses
OK
succeedResponse status.
resultCurrent status: -1 if the list is fully imported, or [0, lines] if still importing.
Get import log
Returns the log of the latest import of the list, with counts of new, updated and rejected records and any errors. The log is removed when a new import of the list starts. Returns an empty string if the list has no import log.
Get import log › Request Body
list_idMailing list ID.
base64encodedReturn the content Base64-encoded. Defaults to false.
Get import log › Responses
OK
succeedResponse status.
resultLog data of list import.