Create a new subscription

Webhook API endpoints allow you to create subscriptions programmatically. To create new subscriptions, you must make a POST request to the Webhook API.

POST https://webhook.apaleo.com/v1/subscriptions

With a request body like:

{
  "endpointUrl": "https://example.com",
  "events": [
    "reservation/*",
    "folio/created",
    "folio/charges-changed"
  ],
  "propertyIds": [
    "MUC",
    "BER"
  ]
}

In the payload above, you can see how your subscription can be if you want to subscribe to all reservation events and only certain folio events.

⚠️ As you may have noticed you can subscribe to all the events of one of the topics or to specific ones. To subscribe to all events of the topic you should follow the pattern: "{topic}/*"

If you create the subscription without specifying a list of properties, then the subscription will automatically work for all current and future properties of the account.

A subscription object has the following fields:

Field Description
endpointUrl The URL where the webhook payload is sent.
events This describes what types of events this subscription is listening. Specify one or more events.
propertyIds The property id (s) for which the events are subscribed. If you create the subscription without specifying a list of properties, then the subscription will automatically work for all current and future properties of the account.

Filtering mechanism for subscriptions

Two useful filtering mechanisms allow you to tailor your subscriptions to your needs. As mentioned before you can create subscriptions for a set of events, what you can also do is to create the subscription for a group of properties or none at all.

As a requirement, your subscriptions must be for at least one event. However, when it comes to properties, you can not provide any, and your subscription will work for all of them out of the box, think of it as your wildcard.

Here is an example of a payload to create a subscription for reservation and folio topics for a set of properties:

{
  "endpointUrl": "https://example.com",
  "events": [
    "reservation/*",
    "folio/*"
  ],
  "propertyIds": [
    "MUC",
    "BER"
  ]
}

Using the same payload above, however, without the properties filter:

{
  "endpointUrl": "https://example.com",
  "events": [
    "reservation/*",
    "folio/*"
  ]
}