LianaMailer REST API

Mailing lists

Server

Group the contacts you send deliveries to. A static list contains the members you add to it, and a dynamic list gets its members from a condition on contact properties. Lists can also be linked to IDs in external systems.


Get mailing lists

POST
https://rest.lianamailer.com/api
/v1/getMailingLists

Returns all mailing lists of the account, sorted by name, with member counts and list health. Hidden lists and lists created automatically for single deliveries are not included, and dynamic lists are left out if dynamic lists are not enabled for the account. The import_* fields describe the latest import of the list, and import_status is set only while that import is waiting or running.

Get mailing lists › Request Body

include_deleted
​ListIncludeDeleted

Set to 1 to include deleted mailing lists. Defaults to 0.

Example: 1

Get mailing lists › Responses

OK

succeed
​boolean

Response status.

Example: true
​ListExtendedObject[]

Array of mailing lists.


Get mailing list

POST
https://rest.lianamailer.com/api
/v1/getMailingList

Returns the settings and member count of one mailing list. Deleted lists are also returned: check deleted. To get several lists at once, use getMailingLists.

Get mailing list › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60
sms
​GetSmsCount

Return the number of members with an SMS number as members, instead of all members. Defaults to false.

Example: true

Get mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
​ListObject

Mailing list info.


Create mailing list

POST
https://rest.lianamailer.com/api
/v1/createMailingList

Creates a regular, dynamic or segment list and returns its ID. A list with a condition is dynamic, and a list with a cem_segment is a segment list; neither can be self-service. Dynamic lists must be enabled for the account. Members of a new dynamic list are not added until you call requestTargetgroup.

Create mailing list › Request Body

name
​ListName · required

Mailing list name.

Example: Sample list
desc
​ListDescription

Short description of the mailing list.

Example: Description text
subs
​ListSubs

Whether the list is available for subscription on subscription sites. Cannot be true for dynamic or segment lists.

Example: false
condition
​ListCondition

Dynamic list condition as a JSON string. Must be null for regular and segment lists.

Each condition has a contact property name, a value and a condition: = (equal), <> (not equal), ilike (contains), ilike-not (does not contain), in (in list), begins, begins-not, ends or ends-not.

Example: {"conditions":[{"name":"email", "condition":"begins", "value":"testuser+"}], "enabled":true }
site
​ListSite

Domain name of the subscription site for the list. To list sites, use sites.

Example: site-domain
cem_segment
​ListAutomationSegment

LianaAutomation segment ID of a segment list, or -1 if the segment is not determined yet. Must be null for regular and dynamic lists.

Example: null
ext_id
​ListExtId

External ID of the mailing list.

Example: abc123
ext_type
​ListExtIdType

Type of the external ID.

Example: string

Create mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​ListId

Mailing list ID.

Example: 60

Edit mailing list

POST
https://rest.lianamailer.com/api
/v1/editMailingList

Replaces all list settings: omitted optional parameters are reset, so self-service is turned off and the condition, site and segment are cleared. If new_name is empty, the list is not changed. To change only one setting, use editMailingListCondition or editMailingListSelfService.

Edit mailing list › Request Body

id
​ListId · required

Mailing list ID.

Example: 60
new_name
​ListName · required

Mailing list name.

Example: Sample list
new_desc
​ListDescription · required

Short description of the mailing list.

Example: Description text
new_subs
​ListSubs

Whether the list is available for subscription on subscription sites. Cannot be true for dynamic or segment lists.

Example: false
new_condition
​ListCondition

Dynamic list condition as a JSON string. Must be null for regular and segment lists.

Each condition has a contact property name, a value and a condition: = (equal), <> (not equal), ilike (contains), ilike-not (does not contain), in (in list), begins, begins-not, ends or ends-not.

Example: {"conditions":[{"name":"email", "condition":"begins", "value":"testuser+"}], "enabled":true }
site
​ListSite

Domain name of the subscription site for the list. To list sites, use sites.

Example: site-domain
cem_segment
​ListAutomationSegment

LianaAutomation segment ID of a segment list, or -1 if the segment is not determined yet. Must be null for regular and dynamic lists.

Example: null

Edit mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
​

The list ID, or false if new_name is empty and the list was not changed.


Delete mailing list

POST
https://rest.lianamailer.com/api
/v1/deleteMailingList

Marks the list as deleted. A deleted list is no longer returned by getMailingLists unless include_deleted is set, and there is no endpoint to restore it. Memberships of deleted lists are removed permanently after 6 months.

Delete mailing list › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60

Delete mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string | null

Returns null.

Example: null

Hide mailing list

POST
https://rest.lianamailer.com/api
/v1/hideMailingList

Hides the list from getMailingLists, for example after an ad hoc delivery. The list and its members are kept and the list can still be fetched by ID. There is no endpoint to show a hidden list again.

Hide mailing list › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60

Hide mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string | null

Returns null.

Example: null

Empty mailing list

POST
https://rest.lianamailer.com/api
/v1/truncateMailingList

Removes all active members from the list. Members who have unsubscribed from the list are kept, so truncating the list and adding them back does not subscribe them again. This protects unsubscribed contacts from being imported back to the list by accident, for example from external systems.

Empty mailing list › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60

Empty mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string | null

Returns null.

Example: null

Set mailing list self-service

POST
https://rest.lianamailer.com/api
/v1/editMailingListSelfService

Turns self-service on or off for a regular list. Dynamic and segment lists cannot be self-service. If the account does not allow multiple self-service lists, self-service is turned off on all other lists. Returns the self-service state of every list of the account that is not deleted.

Set mailing list self-service › Request Body

id
​ListId · required

Mailing list ID.

Example: 60
self_service
​ListSubs · required

Whether the list is available for subscription on subscription sites. Cannot be true for dynamic or segment lists.

Example: false

Set mailing list self-service › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​array

List IDs with their self-service states.

Example: [{"id":12,"self_service":true},{"id":23,"self_service":false}]

Get mailing list condition

POST
https://rest.lianamailer.com/api
/v1/getMailingListCondition

Returns the condition of a dynamic list as a JSON string, or an empty value if the list has no condition.

Get mailing list condition › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60

Get mailing list condition › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​ListCondition

Dynamic list condition as a JSON string. Must be null for regular and segment lists.

Each condition has a contact property name, a value and a condition: = (equal), <> (not equal), ilike (contains), ilike-not (does not contain), in (in list), begins, begins-not, ends or ends-not.

Example: {"conditions":[{"name":"email", "condition":"begins", "value":"testuser+"}], "enabled":true }

Edit mailing list condition

POST
https://rest.lianamailer.com/api
/v1/editMailingListCondition

Sets the condition of a dynamic list and returns the saved condition. Other list settings are not changed. Send an empty condition to remove it; setting a condition requires dynamic lists to be enabled for the account. The list members are not updated until you call requestTargetgroup.

Edit mailing list condition › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60
condition
​ListCondition · required

Dynamic list condition as a JSON string. Must be null for regular and segment lists.

Each condition has a contact property name, a value and a condition: = (equal), <> (not equal), ilike (contains), ilike-not (does not contain), in (in list), begins, begins-not, ends or ends-not.

Example: {"conditions":[{"name":"email", "condition":"begins", "value":"testuser+"}], "enabled":true }

Edit mailing list condition › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​ListCondition

Dynamic list condition as a JSON string. Must be null for regular and segment lists.

Each condition has a contact property name, a value and a condition: = (equal), <> (not equal), ilike (contains), ilike-not (does not contain), in (in list), begins, begins-not, ends or ends-not.

Example: {"conditions":[{"name":"email", "condition":"begins", "value":"testuser+"}], "enabled":true }

Update dynamic list members

POST
https://rest.lianamailer.com/api
/v1/requestTargetgroup

Starts a background job that updates the members of a dynamic list from its condition and returns the job handle. The job replaces all current list members with the contacts who match the condition. Call this after creating a dynamic list or changing its condition. Nothing is changed if the condition is not enabled.

Update dynamic list members › Request Body

list
​ListId · required

Mailing list ID.

Example: 60

Update dynamic list members › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string

Job handle.

Example: H:ws2-beta:231124

Recalculate mailing list health

POST
https://rest.lianamailer.com/api
/v1/updateMailingListHealth

Recalculates the health of one or more lists and returns the new values, with the list ID as the key and the health as the value. Health is from 0 to 100, where 100 is best, and is based mainly on greylisted addresses and bounces. Health is also recalculated after list imports and daily for lists with recent deliveries or greylisted addresses.

Recalculate mailing list health › Request Body

​required

Mailing list ID or an array of mailing list IDs.

Example: 60

Recalculate mailing list health › Responses

OK

succeed
​boolean

Response status.

Example: true
​object

Updated list health.


Find list by external ID

POST
https://rest.lianamailer.com/api
/v1/findListExternal

Returns the ID of the list that has the given external ID and type, or false if no list has it. External IDs are added with addMailingListExternalId or when creating the list. If several lists have the same external ID, only one of them is returned. Deleted lists are included, as deleting a list keeps its external IDs.

Find list by external ID › Request Body

ext_id
​ListExtId · required

External ID of the mailing list.

Example: abc123
type
​ListExtIdType · required

Type of the external ID.

Example: string

Find list by external ID › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​ListId

Mailing list ID.

Example: 60

Get mailing list external ID

POST
https://rest.lianamailer.com/api
/v1/getMailingListExternalId

Returns the external ID of the given type for the list, or false if the list has none. If the list has several external IDs of the type, only one of them is returned.

Get mailing list external ID › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60
type
​ListExtIdType · required

Type of the external ID.

Example: string

Get mailing list external ID › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​ListExtId

External ID of the mailing list.

Example: abc123

Add external ID to mailing list

POST
https://rest.lianamailer.com/api
/v1/addMailingListExternalId

Links an external ID, for example the ID of the list in another system, to the list. Use findListExternal to find the list by it later. Adding the same ID and type again does nothing, and a list can have several external IDs.

Add external ID to mailing list › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60
ext_id
​ListExtId · required

External ID of the mailing list.

Example: abc123
type
​ListExtIdType · required

Type of the external ID.

Example: string

Add external ID to mailing list › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string | null

Returns null.

Example: null

Delete mailing list external ID

POST
https://rest.lianamailer.com/api
/v1/deleteMailingListExternalId

Removes all external IDs of the given type from the list. The list itself is not changed.

Delete mailing list external ID › Request Body

list_id
​ListId · required

Mailing list ID.

Example: 60
type
​ListExtIdType · required

Type of the external ID.

Example: string

Delete mailing list external ID › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string | null

Returns null.

Example: null