LianaMailer REST API

Sending

Server

Use event send for single personal or transactional emails, batch send for deliveries to mailing lists, and web page send to send a web page as a newsletter. To choose between them and prepare a send, see Sending mail.


Batch send draft

POST
https://rest.lianamailer.com/api
/v2/deliveries/batch-send

Creates a new delivery from a draft and sends it to the given mailing lists and contacts, right away or at the time in letter.schedule. Each contact receives the mail only once, even if the contact is on multiple mailing lists. Contacts given in recipients are first imported into your account through a hidden mailing list, and the response comes only after the import, so a long list makes the request slow. The response contains the ID of a copy of the draft made for this send, and the created delivery IDs and mail IDs; an A/B subject test creates several deliveries. Each request creates new deliveries, so a retried request is sent again. See Sending mail.

Batch send draft › Request Body

​BatchLetter · required
​object[]

Contacts to send to. Each object needs email or sms; other keys are used as contact properties. Batch send also finds a contact by id alone, but not a contact that has only an SMS number. Event send ignores id when email is given, and fails with id alone.

Example: [{"email":"recipient1@example.com","sms":"+358101234567"},{"email":"recipient2@example.com","sms":"+358201234567"}]
lists
​integer[]

Mailing list IDs to send to. Required if recipients is omitted. Can be combined with recipients.

Example: [1,5]

Batch send draft › Responses

OK

succeed
​boolean

Response status.

Example: true
​object

Send event or transactional mail

POST
https://rest.lianamailer.com/api
/v2/deliveries/event-send

Sends a draft right away to the given contacts as an event delivery. Use it for transactional and other contact-specific mail, such as order confirmations; for newsletters and larger contact groups, use deliveries/batch-send. For better deliverability, use a dedicated LianaMailer account for transactional mail. To activate the transactional email feature, contact your Liana account manager. Giving the same contact twice in one request is an error. See Sending mail.

Send event or transactional mail › Request Body

​EventLetter · required
​object[] · required

Contacts to send to. Each object needs email or sms; other keys are used as contact properties. Batch send also finds a contact by id alone, but not a contact that has only an SMS number. Event send ignores id when email is given, and fails with id alone.

Example: [{"email":"recipient1@example.com","sms":"+358101234567"},{"email":"recipient2@example.com","sms":"+358201234567"}]
tracking_id
​TrackingId

Tracking ID for the event delivery, returned as tracking. Generated when omitted. 10-24 characters, lowercase letters a-z and digits 0-9 only.

Example: customabc123

Send event or transactional mail › Responses

OK

succeed
​boolean

Response status.

Example: true
​object

Send web page

POST
https://rest.lianamailer.com/api
/v2/deliveries/webpage-send

Fetches the web page at letter.url, saves it as a new draft and sends it like deliveries/batch-send. Each contact receives the mail only once, even if the contact is on multiple mailing lists. The response contains the ID of the copy of the new draft that was sent, and the created delivery IDs and mail IDs.

Send web page › Request Body

​WebpageLetter · required
​object[]

Contacts to send to. Each object needs email or sms; other keys are used as contact properties. Batch send also finds a contact by id alone, but not a contact that has only an SMS number. Event send ignores id when email is given, and fails with id alone.

Example: [{"email":"recipient1@example.com","sms":"+358101234567"},{"email":"recipient2@example.com","sms":"+358201234567"}]
lists
​integer[]

Mailing list IDs to send to. Required if recipients is omitted. Can be combined with recipients.

Example: [1,5]

Send web page › Responses

OK

succeed
​boolean

Response status.

Example: true
​object