LianaMailer REST API

Import

Server

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

POST
https://rest.lianamailer.com/api
/v2/import/mailinglist

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

Either `list_id` or `name` is required.
data
​string · required

Base64-encoded file content. The first row must contain column headers, including an email or SMS column.

Example: ImVtYWlsIjsiZmlyc3RuY...
type
​string · required

File format: csv or xls. A CSV file must use:

  • Field separator ;
  • Enclosure character "
  • Encoding UTF-8
  • Unix line endings \n
Example: csv
list_id
​integer

ID of an existing mailing list to import to. Required if name is omitted. An unknown ID returns an error.

Example: 101
name
​string

Mailing 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 (see folder).
  • With list_id: renames the list if the name differs.
Example: Sample list
folder
​string

Mailing 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.
Example: Example
truncate
​boolean

Remove all current members from the list before importing. Defaults to false.

Example: true
use_list_props
​boolean

Import property values as list-specific values instead of default values. Defaults to false.

Example: false
consent_id
​integer

Consent ID to give to the imported contacts. Requires consent_lang, and the consent must exist in that language.

Example: 4
consent_lang
​string

Consent language as a two-letter ISO 639-1 code, e.g. EN. Requires consent_id.

Example: EN

Import file to mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
​object