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",
  "topics": [
    "Reservation",
    "Folio"
  ],
  "propertyIds": [
    "MUC",
    "BER"
  ]
}

In the payload above, you can see how your subscription can be for multiple topics and properties. 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.
topics This describes what types of events this subscription is listening. Specify one or more topics.
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 topics, 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 topic. 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",
  "topics": [
    "Reservation",
    "Folio"
  ],
  "propertyIds": [
    "MUC",
    "BER"
  ]
}

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

{
  "endpointUrl": "https://example.com",
  "topics": [
    "Reservation",
    "Folio"
  ]
}