Test webhook

Webhooks

post/api/webhooks/{pcode}/testx-api-key

Send a sample delivery to the URL of a webhook you already created — the body names it by id — and report back what happened: the outcome Hotelgest recorded, how long it took, and the error if it failed. Any 2xx comes back as 200; no response at all (network error, or a URL refused because it resolves to a private network) comes back as 500 with the reason in errorMessage. The body is the same envelope a real delivery has, with a fixed sample booking, so your endpoint can be tested against the real shape. The webhook is tested whether it is enabled or not. A test does not appear in the delivery log. An unknown id answers 404.

Console

Runs against the API from your browser, with the same request your server will send.

Environment

Production

https://uni-api.hotelgest.com

Calls hit live data with your own API key. A POST, PUT, PATCH or DELETE here changes a real property.

Credentials

The API key, sent on every request. A property admin creates it in the PMS under Settings → API keys; a partner receives one per property when the property activates its integration. It works only for the property it was issued for, and only on the endpoints granted to it.

This endpoint needs a credential. Without it you will get a 401.

Stored in this browser only. Never sent anywhere but the API host above.

Path parameters

Body

Arm production

Writing methods are locked until you arm them. This is live hotel data.

POST is locked on production. Arm it above if you mean it.

posthttps://uni-api.hotelgest.com/api/webhooks/123456/test

Send the request to see the real response here.

Nothing is mocked. What comes back is what the API returned.

Requests go straight from your browser to the API host above — nothing is proxied through this site.

Path parameters

pcode
number

Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.

Request body

id
string

Webhook ID

eventType
enum

Webhook Event Type

One of:bookings-added

Example
1{
2 "id": "60d21b4667d0d8992e610c85",
3 "eventType": "bookings-added"
4}

Responses

Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its payload decrypts to. See https://public-api.hotelgest.com/public/guides/encryption

pcode
number

Property code

webhookId
string

ID of the webhook that was tested

url
string

URL the test delivery was sent to: the one configured on the webhook

eventType
enum

Event type of the sample payload

One of:bookings-added

payload
object

The JSON body POSTed to your URL: { "eventType": "bookings-added", "data": { "bookings": [ … ] } }. Each item of data.bookings has the shape GET /api/bookings/{pcode}/detail/{bookingId} answers. Keys whose value was missing when it was sent can hold null here. For a test, the bookings are a fixed sample, not real ones.

statusCode
number

Outcome of the delivery as Hotelgest records it: 200 for any 2xx answer from your endpoint (the exact 2xx is not kept), the status your endpoint answered for any other response (redirects are not followed, so a 3xx is recorded as is), and 500 when there was no response at all — a network error, a TLS failure, or a URL refused because it resolves to a private network. In that last case the 500 is Hotelgest's, not your endpoint's.

errorMessage
string

Why the delivery failed: the HTTP client's message (e.g. Request failed with status code 404, connect ECONNREFUSED 203.0.113.10:443) or the reason the URL was refused. null or absent when the delivery succeeded.

durationMs
number

Duration of the test delivery in milliseconds

Example response
1{
2 "pcode": 1010,
3 "webhookId": "65f1c2a9b4d3e2f1a0c9b8d7",
4 "url": "https://myapp.com/webhooks",
5 "eventType": "bookings-added",
6 "payload": {
7 "eventType": "bookings-added",
8 "data": {
9 "bookings": [
10 {
11 "id": 12345,
12 "pcode": 1010,
13 "groupId": 987,
14 "groupPrice": 950,
15 "groupQuantity": 3,
16 "start": "2025-11-10",
17 "end": "2025-11-13",
18 "arrivalHour": "15:00",
19 "departureHour": "11:00",
20 "nights": 3,
21 "appUrl": "https://app.example.com/booking/12345",
22 "createdAt": "2025-10-26T16:00:00.000Z",
23 "resource": "room-101",
24 "text": "",
25 "board": "hb",
26 "policy": "4",
27 "price": 1200,
28 "paid": 600,
29 "totalExtras": 100,
30 "locked": false,
31 "color": "#ffcc00",
32 "imported": false,
33 "room": {
34 "id": 101,
35 "roomTypeId": 2,
36 "originalRoomTypeId": 2
37 },
38 "locator": "ABC123XYZ",
39 "customer": {
40 "id": 1,
41 "name": "Test",
42 "surname": "User",
43 "documentType": "D",
44 "documentNumber": "A12345678",
45 "phone": "+34911111222",
46 "email": "agustin@example.com",
47 "address": "Calle Falsa 123",
48 "city": "Barcelona",
49 "postalCode": "08001",
50 "country": "ES",
51 "province": "Barcelona",
52 "notes": "Vegetariano",
53 "language": "es"
54 },
55 "companyId": 42,
56 "notes": {
57 "request": "Cuna para bebé, por favor.",
58 "internal": "Cliente frecuente – revisar upgrade",
59 "flat": "Ninguna"
60 },
61 "occupancy": {
62 "total": 3,
63 "adults": 2,
64 "children": 1,
65 "babies": 0
66 },
67 "groupOccupancy": {
68 "total": 9,
69 "adults": 6,
70 "children": 2,
71 "babies": 1
72 },
73 "otaId": 3,
74 "checkInStatus": "checked-in",
75 "bookingStatus": "ready",
76 "virtualPayment": {
77 "type": "directPayment",
78 "amount": 600
79 },
80 "paymentStatus": "no-paid",
81 "invoiceStatus": "no-invoiced",
82 "bookingType": {
83 "label": "Oferta larga estancia",
84 "type": "bloqued-out-order",
85 "typeV2": "blocked-out-order"
86 },
87 "toDos": {
88 "data": [],
89 "pendings": 0,
90 "total": 0
91 },
92 "guests": [
93 {
94 "id": 2,
95 "name": "Test",
96 "surname": "User",
97 "documentType": "D",
98 "documentNumber": "98765432A",
99 "phone": "+34666666666",
100 "email": "laura@example.com",
101 "address": "Calle Real 45",
102 "city": "Madrid",
103 "postalCode": "28001",
104 "country": "ES",
105 "province": "Madrid",
106 "notes": "",
107 "language": "es"
108 }
109 ],
110 "isSaleDirect": true,
111 "housekeeping": {
112 "dateToClean": "2025-11-11",
113 "quantityNightsClean": 2,
114 "weekDaysClean": {
115 "mon": true,
116 "tue": false,
117 "wed": true,
118 "thu": false,
119 "fri": false,
120 "sat": false,
121 "sun": false
122 }
123 }
124 }
125 ]
126 }
127 },
128 "statusCode": 200,
129 "errorMessage": "Request failed with status code 404",
130 "durationMs": 87
131}

What is a pcode?

The property code. Every endpoint is scoped to one property, and your API key only works for the property it was issued for.

Rate limits

100 requests per minute per source IP, 120 per API key and 300 per property, each counted across every endpoint together — not per endpoint. Over any of them you get a 429 with the seconds to wait in Retry-After-<limit> (apikey-ip, apikey or apikey-pcode): stop and wait it out. Repeat offences on a key or a property are blocked for longer each time, up to 7 days.