Add contacts to a mailing list in a single request. To choose between the v1 and v2 imports, see Importing contacts.
Import file to mailing list
Imports contacts from a CSV or XLS file into a new or existing mailing list and returns the list ID. The import continues in the background after the response, so use getImportStatus to follow it. If too many imports are unfinished at the same time, the request returns an error, so split large imports into batches (of 10,000 contacts, for example) and import them one by one. Property name restrictions apply.
Import file to mailing list › Request Body
dataBase64-encoded file content. The first row must contain column headers, including an email or SMS column.
typeFile format: csv or xls. A CSV file must use:
- Field separator
; - Enclosure character
" - Encoding
UTF-8 - Unix line endings
\n
list_idID of an existing mailing list to import to. Required if name is omitted. An unknown ID returns an error.
nameMailing list name. Required if list_id is omitted.
- Without
list_id: imports to the list with exactly this name, or creates it if none is found (seefolder). - With
list_id: renames the list if the name differs.
folderMailing list folder path, with levels separated by /, e.g. Customers/Finland. Missing folders are created.
With list_id:
- Moves the list to the given folder.
/moves the list to the root folder.- Empty or omitted leaves the list where it is.
Without list_id:
- Imports to the list with the same name in the given folder, or creates the list there if none is found.
- Empty, omitted or
/imports to the first list with the same name in any folder, or creates the list in the root folder if none is found.
truncateRemove all current members from the list before importing. Defaults to false.
use_list_propsImport property values as list-specific values instead of default values. Defaults to false.
consent_idConsent ID to give to the imported contacts. Requires consent_lang, and the consent must exist in that language.
consent_langConsent language as a two-letter ISO 639-1 code, e.g. EN. Requires consent_id.
Import file to mailing list › Responses
OK
succeedResponse status.