An HTTP POST message is used to push relevant booking or conversation data to the Webhook URL, and is triggered whenever the defined lifecycle event occurs. The data is sent as JSON key-value pairs (KVPs) to your receiving server when a booking lifecycle event occurs in your OnceHub account. For example, you can create a Webhook that sends customer details whenever a new booking is scheduled.
Managing your Webhooks
Webhook subscriptions can be created, deleted, and retrieved via the Webhooks API. You can also view and delete your Webhooks from the API Integration page
Webhook event triggers
Booking lifecycle events
When you create a Webhook subscription, you must define the set of events that will trigger POST messages to your URL endpoint. These events represent the booking lifecycle scenarios you wish to receive notifications about.
Specific and composite event triggers
- Specific triggers are based on an individual event (e.g. a booking is scheduled, or a booking is canceled, or a conversation is closed).
- The composite
bookingevent trigger includes all of the booking lifecycle event triggers.
Specific booking event triggers
Specific conversation event triggers
Composite booking event triggers
booking (includes all of the specific booking event triggers listed above)
Managing Webhook subscriptions via the API
The Webhook API allows you to create, retrieve, and delete your Webhook subscriptions.
Create a webhook
Creates a webhook subscription.
When creating the webhook, you should provide
urlfor receiving POST messages
- an array of
eventsin the request body.
You may specify specific booking lifecycle events you wish to subscribe to, or you can pass the
booking event to trigger the POST payload message whenever any of the supported booking lifecycle events occurs.
Make sure that you pass the full URL. For security reasons, only HTTPS URLs are accepted.
Returns the webhook object if the call succeeded. Returns an error if something goes wrong.