API

Delivery

Learn how LiveSession delivers webhook events to your endpoints.

Overview

When an event ready for webhook transmission occurs within LiveSession, an event payload is crafted. If you've set up endpoints for that specific event type, the payload gets lined up for delivery.

These "trigger-ready" events encompass actions ideal for webhook interaction. For instance, when a session event is created, it's trigger-ready.

Event delivery typically takes mere seconds, though a strict FIFO order isn't assured. Given potential event volume, the webhook platform prioritizes throughput over rigid sequencing.

Once an event is dispatched, a payload signature is computed and included in the request. The request sent to your chosen endpoint bears these details:

  1. HTTP method is POST

  2. Content-Type of the request body is application/json

  3. There will be a request header named LiveSession-Signature - this includes the request signature which the recipient should verify.

  4. Every request body will contain a JSON object with the following fields:

    1. message_id - the message identifier

    2. webhook_id - the webhook identifier

    3. webhook_type - the webhook type

    4. api_version - the webhook API version

    5. account_id - the account identifier

    6. website_id - the website identifier

    7. created_at - the message creation timestamp

    8. payload - the event payload

Below is a representation of the entire HTTP request:

1
POST /webhooks HTTP/1.1
2
Host: example.com
3
Content-Type: application/json; charset=utf-8
4
LiveSession-Signature: /NLAt29+UdUod1lyzeWcbNigjzGfvtusP44dNKt4Q3U=
5
User-Agent: LiveSessionWebhooks/1.0
6
7
{
8
"message_id": "d5932de4-a8da-4546-4439-3c640ba8dc05",
9
"webhook_id": "542de45",
10
"webhook_type": "session.event",
11
"api_version": "v1.0",
12
"account_id": "3ca3b1b",
13
"website_id": "8d53ea3",
14
"created_at": 1691161881,
15
"payload": {
16
"visitor": {
17
"id": "e4d5932d-4439-4546-a8da-a8d40bc053c6",
18
"name": "John Doe",
19
"email": "john.doe@livesession.io",
20
"params": [
21
{
22
"name": "plan",
23
"value": "pro"
24
}
25
],
26
"geolocation": {
27
"country_code": "PL",
28
"city": "Wroclaw",
29
"region": "Dolnoslaskie"
30
}
31
},
32
"event_name": "Error",
33
"time": 1691161881,
34
"count": 1,
35
"value": "ProductCatalog: product is not valid"
36
}
37
}

Throttling

To prevent your servers from being overwhelmed or unintentionally participating in a service disruption on your webhook endpoint, LiveSession limits the number of events sent for a given webhook to a maximum of 1000 per minute.

If you've configured an endpoint for a high-volume event flow, like a frequently triggered custom event during user sessions, expect possible webhook delays. When the number of events for an endpoint exceeds 1000 per minute, the extra events will be queued].

If the events happen really fast for a little while and then slow down, all the events might still arrive, but it could take longer than when they first happened. But if the fast rate continues for a long time, some events might not be delivered. If an event is undeliverable for 24 hours, it's treated as failed, and no more tries will be made.

The limit of 1000 events per minute is per account.

Retry behavior

LiveSession attempts to deliver a given event to your webhook endpoint for up to 8 hours with an exponential backoff in beetwen 1-10 minutes interval gap from the previous attempt.

ConfigurationVerify