LianaMailer REST API

Sites

Server

The domain, language and layout of the public pages that contacts see, such as the subscription, confirmation and unsubscribe pages. Each account has one default site. Create, update and delete sites, and set the default site and the welcome delivery of each site.


Get sites

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

Returns all your sites with their settings and full domain. Use data to also include properties, mailing lists, layout, marketing settings, authorization settings or parent sites; without data, no extra data is returned. For one site with all its data, use site. For settings only, use getCustomerSites.

Get sites › Request Body

​SiteShowData

Extra data to include for each site. Omitted keys default to false.

​SiteOptions

Get sites › Responses

OK

succeed
​boolean

Response status.

Example: true
​SiteObjectExtended[]

Array of site objects.


Get site

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

Returns one of your sites with all its data: settings, full domain, properties, mailing lists, labels, HTML elements, layout, marketing settings and authorization settings. Returns an error if no site matches. For settings only, use getCustomerSite; for all your sites, use sites.

Get site › Request Body

domain
​SiteDomain · required

Site domain name.

Example: site-domain
children
​integer

Set to 1 to also look up parent sites of your sites. Defaults to 0.

Example: 0
​object

Site options.

Get site › Responses

OK

succeed
​boolean

Response status.

Example: true
​SiteObjectExtended

Get all site settings

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

Returns the settings of all your sites, sorted by domain. Deleted sites are left out. To also get the full domain and extra data such as mailing lists, properties and layout, use sites.

Get all site settings › Request Body

id
​integer · required

Your own customer ID, or 0. Other IDs return an error.

Example: 0

Get all site settings › Responses

OK

succeed
​boolean

Response status.

Example: true
​CustomerSite[]

Get site settings

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

Returns the settings of one of your sites by domain, or of your default site if site is empty. If the domain is the parent site of one of your sites, the parent site is returned. If no site matches, result is false. To also get the mailing lists, properties, layout and other extra data of the site, use site.

Get site settings › Request Body

site
​string

Site domain. If empty, the default site is returned.

Example: example.site

Get site settings › Responses

OK

succeed
​boolean

Response status.

Example: true
​object

Get default site settings

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

Returns the settings of your default site. This is the same as getCustomerSite with an empty site.

Get default site settings › Request Body

id
​integer · required

Your own customer ID, or 0. Other IDs return an error.

Example: 0

Get default site settings › Responses

OK

succeed
​boolean

Response status.

Example: true
​object

Create site

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

Creates a site for your account and returns its domain. If the domain is already taken, a suffix such as -2 is added to its first label, so use the returned domain in later calls. If you already have a site with this domain, that site is updated instead.

Create site › Request Body

domain
​SiteDomain · required

Site domain name.

Example: site-domain
​SiteAttributes

Site settings. has_csrf and deny_framing default to true.

Create site › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​SiteDomain

Site domain name.

Example: site-domain

Update site

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

Updates the settings of one of your sites. Returns an error if you have no site with this domain. The settings in attrs are saved only when attrs has site.

The language is read from language, not lang as in siteCreate, and a missing language sets the site to FI. Other settings left out of attrs are reset too:

  • has_csrf and deny_framing become false, although siteCreate defaults them to true.
  • welcome, ssl, is_default, whitelist_*, redirect, postfix, envelope_sender, embed_* and robots_txt are reset. For example, leaving out is_default makes the site no longer the default site.
  • domain_aliases, recaptcha_*, csp and parent are kept.

Get the current settings with site first and send them all with your changes.

Update site › Request Body

domain
​SiteDomain · required

Site domain name.

Example: site-domain

Site settings. They are saved only when site is given, and settings left out are then reset, as described in siteUpdate.

Update site › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​integer

Returns 1 on success.

Example: 1

Delete site

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

Deletes one of your sites. Fails if it is your only site, if a mailing list uses it, or if a scheduled delivery that has not been sent yet uses it. If the deleted site was your default site, another site becomes the default.

Delete site › Request Body

domain
​SiteDomain · required

Site domain name.

Example: site-domain

Delete site › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​boolean

Returns true on success.

Example: true

Set site welcome message

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

Sets or removes the welcome message of one of your sites. Returns 1 even if you have no site with the given domain. You can also set the welcome message with the welcome setting of siteCreate and siteUpdate.

Set site welcome message › Request Body

site
​string · required

Domain of your site.

Example: example.site
delivery
​integer · required

Delivery ID sent as the welcome message when a contact joins through the site. 0 removes the welcome message.

Example: 300

Set site welcome message › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​integer

Returns 1 on success.

Example: 1

Set default site

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

Legacy method. Prefer siteCreate and siteUpdate, which accept all site settings. Creates the site if it does not exist, or updates its language, welcome message and HTTPS setting, and makes it the default site. Other settings, such as redirect, postfix and the embedding and security options, are reset to their defaults. Returns the site domain, which can have a suffix such as -2 if a new site's domain is already taken.

Set default site › Request Body

id
​integer · required

Set to 0. Other values, including your own customer ID, return an error.

Example: 0
site
​string · required

Site domain. The site is created if it does not exist and set as the default site.

Example: new.site
language
​string · required

Site language, such as EN.

Example: EN
welcome
​integer

Delivery ID of the site welcome message.

Example: 1
ssl
​integer

Whether the site uses HTTPS: 1 or 0. Defaults to 0.

Example: 1

Set default site › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string

Domain name of the new default site.

Example: example.site

Set default site by customer ID

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

Creates or updates a site of your own customer account or of your parent or child account, and makes it the default site of that account. Settings not in the request, such as redirect, postfix and the embedding and security options, are reset to their defaults. For your own sites, prefer siteCreate and siteUpdate, which accept all site settings.

Set default site by customer ID › Request Body

site
​string · required

Domain of the site to modify. If empty or not found, a new site is created.

Example: old.site
customerId
​integer · required

Customer ID: your own, or that of your parent or child customer.

Example: 1001
newName
​string · required

New site domain. For a new site, a suffix such as -2 is added to the first label if the domain is taken.

Example: new.site
language
​string · required

Site language, such as EN.

Example: EN
welcome
​integer

Delivery ID of the site welcome message.

Example: 1
ssl
​integer

Whether the site uses HTTPS: 1 or 0. Defaults to 0.

Example: 1

Set default site by customer ID › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​string

Domain name of the new or modified site.

Example: new.site

Get domain postfixes

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

Returns the shared domains (postfixes) available for sites. A site whose domain is only a name, such as newsletter, is served under a postfix, for example newsletter.example.net. Use one as the postfix setting in siteCreate or siteUpdate. The list is the same for all customers.

Get domain postfixes › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​DomainPostfix[]

Array of available site postfixes.


Get default domain postfix

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

Returns the postfix used for sites that have no postfix setting. See postfixes.

Get default domain postfix › Responses

OK

succeed
​boolean

Response status.

Example: true
result
​DomainPostfix

Domain postfix.

Example: example.com

deprecated

Get site by name

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

Deprecated. Returns an error in the current version. Use getCustomerSite to get a site by domain.

Get site by name › Request Body

site
​string · required

Site domain.

Example: example.site

Get site by name › Responses

OK

succeed
​boolean

Response status.

Example: true
​object