Webhooks
Get told when something happens instead of asking every minute.
4 min read
A webhook is a URL of yours that the PMS calls with an HTTP POST when an event fires. You register it once per property, choose the events, and stop polling.
Available events
| Event | Fires when |
|---|---|
| bookings-added | A booking is created on the property — from the PMS, a channel, or the API. |
One event, for now
That is the whole catalogue today. If you need an event that is not here, say so — the list is short because of demand, not design.
Registering one
bash
1curl -X POST 'https://uni-api.hotelgest.com/api/webhooks/1234' \2 -H 'x-api-key: YOUR_API_KEY' \3 -H 'Content-Type: application/json' \4 -d '{5 "name": "Booking created → our CRM",6 "url": "https://example.com/hooks/hotelgest",7 "eventTypes": ["bookings-added"],8 "authentication": {9 "status": true,10 "username": "hotelgest",11 "password": "example-long-random-string"12 }13 }'
This one writes
Creating a webhook takes effect immediately: the property starts sending events to your URL on the next booking. Have the endpoint up and answering 200 before you run this. Events are delivered only to properties whose plan includes the API add-on.
Turn the basic auth on
Your webhook URL is a public endpoint that accepts POSTs about real reservations.
authentication.status: true with a long random password is the difference between a private notification and anyone who guesses the URL being able to feed you fake bookings. Register an https:// URL: over plain http:// the password and the bookings travel in clear.When deliveries fail
- 1POST /api/webhooks/{pcode}/test sends a test payload and returns the status code, the response time and the error message of the attempt. Use it before blaming the PMS.
- 2GET /api/webhooks/{pcode}/{id}/logs is the delivery history: every attempt with its payload, status code and error message. Any 2xx from your endpoint is recorded as
200; an error status of yours is recorded as you sent it; when your endpoint could not be reached at all (refused connection, DNS, TLS), the status is500and the error message says why. - 3Each event is sent once and never retried: a failed delivery stays in the logs only, so reconcile with the booking search.
- 4Disable rather than delete while you fix your side — a disabled webhook keeps its id, its logs and its configuration.
Answer fast, work later
Return 200 as soon as you have the payload and do the real work on a queue. The deliveries of a property go one after another, so a slow endpoint holds up the ones that come after it, on the busy morning when it matters most.