LianaAutomation REST API documentation (1.0)

Download OpenAPI specification:Download

LianaAutomation REST API documentation.

Authentication

LianaAutomation REST API supports two authentication methods. OAuth 2.0 Bearer token authentication is recommended for new integrations and is available only on the rest.automation.lianacloud.com host. The legacy HMAC-SHA256 method remains supported on other hosts, with a phased deprecation described below.


OAuth 2.0 Bearer Token

OAuth 2.0 client credentials authentication is the recommended method for server-to-server integrations. It is available only when calling the API via the rest.automation.lianacloud.com host — no other LianaAutomation REST API host supports it. A short-lived access token is obtained from the LianaCloud token service and sent as a Bearer token in the Authorization header. No request signing or additional headers are required.

Obtaining client credentials

Create OAuth client credentials in LianaAccount or contact your account manager. Each credential set is associated with a customer account and carries a set of permitted scopes.

Requesting an access token

Exchange your client credentials for an access token using the OAuth 2.0 client credentials grant:

POST https://tokens.lianacloud.com/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id=<your-client-id>&client_secret=<your-client-secret>&scope=automation-api

The token service returns a JSON response:

{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 900,
  "scope": "automation-api"
}

Required scope

The token must carry at least one scope from the automation-api namespace. Use automation-api as the scope value when requesting the token.

Making authenticated requests

Include the access token in the Authorization header of every request:

Authorization: Bearer <access-token>
Content-Type: application/json

The Date and Content-md5 headers are not required when using Bearer tokens.

Token expiry

Access tokens are short-lived (the expires_in field in seconds shows the lifetime). When a token expires, the API returns a 401 response. Request a new token from the token service using the same client credentials.


Legacy HMAC-SHA256 (deprecated)

Deprecation notice: On the rest.automation.lianacloud.com host, legacy HMAC-SHA256 authentication will be discontinued after 31 December 2026, after which OAuth 2.0 Bearer token authentication will be the only supported method on that host. Migrate existing integrations to OAuth before that date. This deprecation does not apply to other LianaAutomation REST API hosts — they do not have OAuth available and will continue to use the legacy method after that date; contact your account manager if you are unsure which host your integration uses.

The legacy method authenticates requests using an HMAC-SHA256 signature computed from the request content. It requires the following headers on every request:

  • Date: Timestamp in ISO 8601
  • Authorization: REALM USERID:SIGNATURE
  • Content-md5: MD5 hash of the request body
  • Content-Type: application/json

Authorization header format

REALM USERID:SIGNATURE

The header is valid for 15 minutes based on the given timestamp.

Computing the signature

The signature is an HMAC-SHA256 of a newline-separated string, using the REST user password as the key. The string is constructed from the following fields in order:

  • Request method: POST
  • Content MD5: the same value as the Content-md5 header
  • Content Type: application/json
  • Date: the same value as the Date header
  • Body: the full request body
  • Path: the URI path including any query parameters

Example

POST
b41c090e9b32a3f85c631db1af38b0af
application/json
2099-01-01 00:00:00+0200
{"ping":"pong"}
/rest/v1/pingpong

HMAC_SHA256("password", message)
= d0e9d4895b0a06e19623b6c63cf6b173d9fa8ca3427ccb680c22209b90d7bb5e

Error responses

Authentication failures return HTTP 401. A wrong URL or REALM returns HTTP 404.

Ping

Test connection

pingpong

This utility function can be used for verifying connections with the LianaAutomation REST API. This is the first command you should try out before investing time into the more complex ones

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
ping
string

Responses

Request samples

Content type
application/json
{
  • "ping": "pong"
}

Response samples

Content type
application/json
{
  • "pong": "pong"
}

Import

Import events

import

Bring data to LianaAutomation from external systems.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
channel
required
string

The channel system name or ID. Channel ID is used to track the source of the data. Can be found from LianaAutomation under Settings from the Admin Channels -page

no_duplicates
boolean

If true, do not create a new duplicate event when an identical event already exists. Automations will not be triggered. Default: false

skip_automations
boolean

If true, this import will not trigger automations. Default: false

allow_identity_update
boolean

If true, the import can update email and sms values of the identity. Default: false

required
Array of objects

An array of multiple identities and events related to that identity.

Responses

Request samples

Content type
application/json
{
  • "channel": "string",
  • "no_duplicates": false,
  • "skip_automations": false,
  • "allow_identity_update": false,
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "succeed": true,
  • "handle": "string"
}

Database

Query database

search/request

Make a database search request

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
channels
Array of strings

Channels to search from

verbs
Array of strings

Event types to search for

from
string <date-time>

Event is newer than

to
string <date-time>

Event is older than

include_data
boolean

Include event data in response

limit
integer
Default: 10000

Limit event count in result. Maximum is 10000

offset
integer

Offset for traversing large event counts

Array of objects

Persons to search for

Responses

Request samples

Content type
application/json
{
  • "channels": [
    ],
  • "verbs": [
    ],
  • "from": "2019-08-24T14:15:22Z",
  • "to": "2019-08-24T14:15:22Z",
  • "include_data": true,
  • "limit": 10000,
  • "offset": 0,
  • "identities": [
    ]
}

Response samples

Content type
application/json
{
  • "handle": "1234"
}

search/ready

Check if a requested database search is completed.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
{
  • "ready": true
}

search/result

Fetch search results of a finished request

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
[
  • {
    }
]

delete/request

Request data to be deleted from database.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
channels
Array of strings

Channels to delete from

Array of objects

Persons to delete

Responses

Request samples

Content type
application/json
{
  • "channels": [
    ],
  • "identities": [
    ]
}

Response samples

Content type
application/json
{
  • "handle": "1234"
}

delete/ready

Check if a delete request is finished.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
{
  • "ready": true
}

delete/result

Returns LianaAutomation system id of the deleted items.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
{
  • "deleted": [
    ]
}

Export

Export data

export/request

Make a request to export the contents of a given segment.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
integer (components-schemas-RequestIn)

Segment ID

Responses

Request samples

Content type
application/json
1

Response samples

Content type
application/json
{
  • "handle": "1234"
}

export/ready

Check if an export request is ready.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
{
  • "ready": true
}

export/result

Export results of a finished export request.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
[
  • {
    }
]

Segment

Segment management

segment/list

List of segments.

Authorizations:
LegacyHMACOAuthBearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Channel

channel/list

List of channels. Depending on channel type different fields will be returned.

Authorizations:
LegacyHMACOAuthBearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

channel/create

Create channel. Only channels without type can be created.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
name
required
string
color
string
tracking_enabled
boolean
Default: false
notes
string

Responses

Request samples

Content type
application/json
{
  • "name": "Automation",
  • "color": "#37aef3",
  • "tracking_enabled": true,
  • "notes": ""
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Automation",
  • "color": "#37aef3",
  • "front_url": "//t.lianacem.com",
  • "icon": "",
  • "tracking_enabled": true,
  • "notes": "",
  • "system_name": "",
  • "tracking_js": "",
  • "import_js": "",
  • "verbs": {
    },
  • "type": "empty",
  • "default_url": "",
  • "events": 100
}

channel/edit

Edit channel. Only channels without type can be edited.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
id
required
integer
name
string
color
string
tracking_enabled
boolean
Default: false
notes
string

Responses

Request samples

Content type
application/json
{
  • "id": 10,
  • "name": "Automation",
  • "color": "#37aef3",
  • "tracking_enabled": true,
  • "notes": ""
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Automation",
  • "color": "#37aef3",
  • "front_url": "//t.lianacem.com",
  • "icon": "",
  • "tracking_enabled": true,
  • "notes": "",
  • "system_name": "",
  • "tracking_js": "",
  • "import_js": "",
  • "verbs": {
    },
  • "type": "empty",
  • "default_url": "",
  • "events": 100
}

channel/delete

Delete channel. Channel can be deleted only if it doesn't have type, events and is not used in any automation or segment.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
id
required
integer

Responses

Request samples

Content type
application/json
{
  • "id": 10
}

Response samples

Content type
application/json
{
  • "succeed": true
}

Report

automations/request

Make a automations report request

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
start_date
required
string
end_date
required
string

Responses

Request samples

Content type
application/json
{
  • "start_date": "2022-02-01",
  • "end_date": "2022-02-25"
}

Response samples

Content type
application/json
{
  • "handle": "1234"
}

automations/ready

Check if a requested automations report is completed.

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
{
  • "ready": true
}

automations/result

Fetch results of a finished request

Authorizations:
LegacyHMACOAuthBearer
Request Body schema: application/json
handle
string

The handle returned as response from the initial request

Responses

Request samples

Content type
application/json
{
  • "handle": "1234"
}

Response samples

Content type
application/json
[
  • {
    }
]

Form

form/list

List of forms.

Authorizations:
LegacyHMACOAuthBearer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Info

info

Get information about installation

Authorizations:
LegacyHMACOAuthBearer

Responses

Response samples

Content type
application/json
{}