Introduction
The LianaAutomation REST API lets your applications bring events and contacts from external systems to LianaAutomation, search and delete that data, export segments, manage channels, and read automation reports. Responses are JSON.
Regions
Send requests to {API URL}/{endpoint}, using the API URL of your region:
| Region | API URL |
|---|---|
| Integration | https://rest.automation.lianacloud.com/api/v1 |
For example, pingpong in the integration region is
https://rest.automation.lianacloud.com/api/v1/pingpong. If you are unsure which region your
integration uses, contact your account manager.
The Asia (t.asia.lianacem.com) and UAE (t6.lianacem.com) installations accept only the legacy
HMAC signature, not Bearer tokens, so this documentation does not cover them.
Requests and responses
Every endpoint takes a POST request with a JSON body. Send {} when the endpoint takes no
parameters.
Most errors in the request, such as a missing parameter or a channel that does not exist, return
HTTP status 200 with succeed: false and a message:
Response
So check succeed, not just the HTTP status. Other errors return an HTTP error status, with the
status repeated in the body:
Response
A missing or invalid Authorization header returns 401, also for an endpoint under /api/v1/ that
does not exist. A path whose first segment after /api/ is not v1 returns 404.
Long-running requests
Database searches and deletes, exports and automation reports run in the background, in three steps:
- Start it with the
requestendpoint, for exampledatabase/search/request. The response holds ahandle. - Call the
readyendpoint with thehandleuntil it returns"ready": true. - Fetch the outcome from the
resultendpoint with the samehandle.
A database search or delete, or an export, can fail or stop without finishing:
- If the
readyresponse haserror, the job failed. Stop polling and make a new request. - Results and errors are kept for about an hour. After that, and for an unknown
handle,readyreturns"ready": falsewithouterror. - A job that stops without finishing stays
"ready": false, so set an overall deadline for polling.
An automation report returns "ready": true also when it fails, and the error is in the result
response.
Make your first request
The pingpong endpoint returns what you send it. Use it to check that your
credentials and the connection work.
-
Get a Bearer token
Create a client ID and secret in LianaAccount, and request a token with them. The examples request the scope
automation-api, which is optional. The token is valid for 15 minutes. -
Send the request
-
Check the response
ResponseA failed request returns an HTTP error status. See Requests and responses.
Next steps
Start with the basics:
- Authorization: getting a Bearer token.
Then browse the endpoints:
Bring events and contacts to LianaAutomation from external systems.
DatabaseSearch events and contacts, and delete them.
ExportExport the contents of a segment.
SegmentList the segments.
ChannelList, create, edit and delete channels, the sources of imported data.
ReportReports on automations and their messages.
FormList the forms.
InfoInformation about the installation.