Consultar las entregas de un webhook

Webhooks

get/api/webhooks/{pcode}/{id}/logsx-api-key

El historial de entregas de un webhook, de la más reciente a la más antigua: por cada intento, el evento, el payload que se envió (las claves que faltaban al enviarlo se guardan como null), el resultado, cuánto tardó y el error si lo hubo. Cualquier 2xx se anota como 200; una entrega que nunca obtuvo respuesta —error de red, o una URL rechazada porque resuelve a una red privada— se anota como 500 con el motivo en el mensaje. Este es el sitio donde mirar cuando un evento que esperabas no llegó y, como los fallos no se reintentan, el único registro de que se intentó. **Las entradas se conservan 30 días** y luego se borran solas, así que descarga lo que necesites guardar antes.

Consola

Llama a la API desde tu navegador, con la misma petición que enviará tu servidor.

Entorno

Producción

https://uni-api.hotelgest.com

Las llamadas van contra datos reales con tu propia clave. Un POST, PUT, PATCH o DELETE aquí modifica un establecimiento de verdad.

Credenciales

La clave de API, en cada petición. La crea un administrador del establecimiento en el PMS, en Configuración → Claves de API; un partner recibe una por establecimiento cuando este activa su integración. Solo funciona con el establecimiento para el que se emitió y con los endpoints que tiene concedidos.

Este endpoint necesita una credencial. Sin ella recibirás un 401.

Se guarda solo en este navegador. No se envía a ningún sitio que no sea el host de la API de arriba.

Parámetros de ruta

gethttps://uni-api.hotelgest.com/api/webhooks/123456/65f1c2a9b4d3e2f1a0c9b8d7/logs

Envía la petición y aquí verás la respuesta real.

No hay nada simulado. Lo que aparezca es lo que devolvió la API.

Las peticiones salen directamente de tu navegador al host de la API de arriba: esta web no hace de intermediaria.

Parámetros de ruta

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.

id
string

Webhook ID, as returned by GET /api/webhooks/{pcode}.

Respuestas

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

id
string

Unique identifier of the log entry (a 24-character hex id)

pcode
number

Property code

webhookId
string

ID of the webhook this delivery belongs to

url
string

URL the delivery was sent to, as the webhook had it at that moment

eventType
enum

Event type that triggered the delivery

Uno de: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.

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 delivery in milliseconds

createdAt
string · date-time

When the delivery was made (ISO 8601). Entries are deleted 30 days after it

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

¿Qué es un pcode?

El código de propiedad. Cada endpoint está limitado a un establecimiento, y tu clave de API solo funciona con el establecimiento para el que se emitió.

Límites de uso

100 peticiones por minuto por IP de origen, 120 por clave de API y 300 por establecimiento, cada una contada entre todos los endpoints a la vez, no por endpoint. Al pasarte de cualquiera recibes un 429 con los segundos de espera en Retry-After-<límite> (apikey-ip, apikey o apikey-pcode): para y espera. Cada reincidencia en una clave o un establecimiento se bloquea más tiempo, hasta 7 días.