Webhooks payload
Health check
When you subscribe, apaleo will send a health-check event. If that fails, the subscription would not be created.
A webhook is considered as successful when the
endpointUrl
responds with 2xx code.
Here is a sample healthcheck payload:
{
"id": "56eca994-f272-47b3-a56b-1327e9125ff3",
"topic": "system",
"type": "healthcheck",
"accountId": "SDXE",
"propertyIds": [
"MUC",
"BER"
],
"timestamp": 1655824163606
}
Once you have created your subscription, all you have to do is process the incoming events from apaleo.
The webhook service will send all types of events as a POST
request to the endpointUrl
that you
have set up for your subscription.
Events that we send to your webhooks all have the same structure as follows:
{
"topic": "Reservation",
"type": "created",
"id": "ec5a1fe4-331c-450a-915c-5caa231cc825",
"accountId": "HFTF",
"propertyId": "HFTF-AADS",
"timestamp": 1692268510605,
"clientId": "ABCD-SP-APPDOINGSOMETHING",
"subjectId": "6f1c719d-1f45-4331-a30c-c6da0f642b60",
"data": {
"entityId": "XPGMSXGF-1"
}
}
The payload has the following fields and headers:
Field | Description |
---|---|
topic | The webhook topic |
type | The operation type (created, changed, and so on) |
id | The webhook internal id |
accountId | The account id to where the notification is related to |
propertyId | The property id to where the notification is related to |
entityId | The object for which the event is created |
clientId | The client id of the app which triggered the process related to the notification |
subjectId | The optional subject id of the triggering request related to the notification |
timestamp | The time of the event |
Header | Description |
---|---|
apaleo-tracking-id | The tracking Id of the request that initiated the event. It can be useful if you want to track the whole flow from sending the first request to being notified that this request has changed something in the platform. |
Typically, you might want to use this information to query more data. For example, get the
reservation entity by its ID. The data
element is optional and can in the future contain payloads
with different schemas. For now, it’s always the entityId
.