Skip to content

Guide

The event log(catch up on what you missed)

The is the list of everything that happened at a hotel, in order. Each has a number. You remember the last number you used, and you ask for everything after it. So you never lose a booking, even when a did not arrive.

The idea

A webhook is a message that ZimmerStack sends to you. It can arrive twice. It can arrive late, or after a newer one. When your server is down for a day, it may not arrive at all. If your records need every message once and in order, you must think about retries, gaps and clocks.

The event log takes this work away. Every event of a hotel gets a number, its . It is one higher than the hotel's last event. You keep one number for each hotel: the last sequence you used. To catch up, you ask for everything after it.

What is in it
GET /events?after=&limit= is the ordered event log of one hotel. It holds every event a webhook can carry for that hotel: bookings, website bookings and OTA problems. Each event is there once, oldest first.
How to use it
Keep the last sequence you used, and ask for everything after it. Do this after an outage, on a schedule, and when a webhook arrives whose sequence is not your next one. nextAfter in the answer is your new place. more: true means: ask again at once. Nothing depends on a delivery that arrived, or on the order deliveries arrived in.
One item
An item is the webhook's own : id, type, occurredAt, mode, sequence, property, data, changes and previous. So one piece of code reads both. The same sequence is on the webhook, and on every later sending of that webhook.
The version of a booking
data.booking.version is our counter of the events of one . It is 1 on the first event, and one more on each later one. A higher version is a later state, whatever order the deliveries arrived in.
Which key reads what
The channel-bookings:read reads the OTA events: channel.booking.*, channel.sync.* and the other types that start with channel. The scope direct-bookings:read reads the website events, direct.booking.*. A key with only one of the two sees the numbers of the other family skipped, because the sequence belongs to the hotel. A key with neither gets 403 SCOPE_MISSING.
How long it is kept
90 days. earliestSequence is the lowest sequence still kept. See When you were away longer than the log keeps.
What is not in it
The sample event of a Test button: it has no sequence. And events from before 22 Nov 2026.

An example

A guest books a room at The Lantern House on Booking.com. Then the guest adds a night. Your server was restarting, and missed both webhooks. The last sequence you used for this hotel was 40. So you ask for what came after 40.

Put your key in place of zsk_test_YOUR_KEY. The full page of this request is List events.

Open a terminal and run this. On Windows PowerShell, type curl.exe instead of curl.

terminal
curl "https://api.zimmerstack.com/api/v1/connect-api/v1/events?after=40" -H "Authorization: Bearer zsk_test_YOUR_KEY"

With the Node package, reading on from a saved place looks like this:

scripts/event-log.ts · catch up from a saved place
// Every event after the place you saved, in order, to the end of the log.
for await (const event of zs().events.all({ after: place }, { onGap: readBookingsAgain })) {
  await apply(event);
  // The event's sequence is your new place. Save it with what you applied, in one transaction.
  await savePlace(event.sequence);
  place = event.sequence;
}
200 · the data part of the answer
{
  "items": [
    {
      "id": "evt_5d3f0c4a-6b1e-4a7e-9c1b-2f0e8d1a9b77",
      "type": "channel.booking.created",
      "apiVersion": "2026-09-01",
      "occurredAt": "2026-12-22T08:14:03.201Z",
      "mode": "live",
      "sequence": 41,
      "property": {
        "id": 61,
        "name": "The Lantern House",
        "currency": "INR",
        "timezone": "Asia/Kolkata"
      },
      "data": {
        "booking": {
          "id": 100001,
          "reference": "TEST-ZS-8K3Q2M",
          "version": 1,
          "…": "the whole booking, as the webhook carries it"
        }
      },
      "changes": null,
      "previous": null
    },
    {
      "id": "evt_0b7c2e19-3a44-4f0d-8e2a-91c5d7f6a310",
      "type": "channel.booking.modified",
      "apiVersion": "2026-09-01",
      "occurredAt": "2026-12-22T09:02:47.118Z",
      "mode": "live",
      "sequence": 42,
      "property": {
        "id": 61,
        "name": "The Lantern House",
        "currency": "INR",
        "timezone": "Asia/Kolkata"
      },
      "data": {
        "booking": {
          "id": 100001,
          "reference": "TEST-ZS-8K3Q2M",
          "version": 2,
          "…": "the whole booking, as the webhook carries it"
        }
      },
      "changes": [
        "stay.checkOut",
        "stay.nights",
        "amounts.total"
      ],
      "previous": {
        "…": "what those fields held before"
      }
    }
  ],
  "more": false,
  "nextAfter": 42,
  "earliestSequence": 1,
  "retentionDays": 90
}
items
The events after the sequence you sent, oldest first.
more
true means more events follow. Ask again, with after set to nextAfter.
nextAfter
The sequence of the last item. Save it: it is your new place in the log.
earliestSequence
The lowest sequence the log still keeps for this hotel.
retentionDays
How many days an event stays in the log.

Use event 41, then event 42. Save 42 as your place. The version of the booking went from 1 to 2. Maybe you already hold a copy of this booking that says version 2 or more. Then your copy is at least as new as this event, and you leave it alone.

Build your receiver around it

  1. 1

    Check the webhook, and answer 2xx at once

    Check the signature on the raw body: Check the signature. Answer within a few seconds. Do not do the work inside the request.
  2. 2

    Read the log from your saved place

    Send GET /events?after= with the last sequence you used for that hotel. While the answer says more: true, ask again with after set to nextAfter.
  3. 3

    Use each event, then save its sequence

    Save your new place together with what the event changed, in one . Then a crash in the middle repeats nothing and skips nothing.
  4. 4

    Do the same read on a schedule, and when your server starts

    Every few minutes is enough. A webhook that never arrived then costs you minutes, not a booking.

How to use one event

Look at type first. It tells you which part of data to read.

channel.booking.* and direct.booking.*
They carry data.booking.
channel.sync.*
It carries data.sync.
channel.drift.*
It carries data.drift.
A type you do not know yet
Skip the event. Its sequence is still your new place. New types are added without notice.
scripts/event-log.ts · one event, used once (Node package)
if (isOtaBookingEvent(event) || isWebsiteBookingEvent(event)) {
  // A booking arrived, changed or was cancelled. version counts its events: 1, 2, 3 and so on.
  console.log(event.sequence, event.type, event.data.booking.reference, "version", event.data.booking.version);
} else if (isSyncEvent(event)) {
  // A problem with a booking site began (channel.sync.alert) or ended (channel.sync.recovered).
  console.log(event.sequence, event.type, event.data.sync.event);
} else if (isDriftEvent(event)) {
  // A nightly read found a booking site's side holding something other than what you sent.
  console.log(event.sequence, event.type, event.data.drift.cellCount, "nights");
}
// A type you do not know yet is skipped, never an error: its sequence is still your place.

When you were away longer than the log keeps

Every answer carries earliestSequence. It is the lowest sequence still in the log. Is it more than one above the after you sent? Then the events between the two are gone. This also happens on your first read, with after=0, on a hotel that has been live for some time.

Then do this:

  1. Read the latest state of each booking, with GET /channel-bookings and GET /direct-bookings. They list every booking changed since a time you choose, however far back. See List OTA bookings and Read website bookings.
  2. After that, carry on from the log at nextAfter.

With the Node package, zs.events.all calls your onGap function once when this happens.

Small facts that save you time

One sequence for each hotel
With a , each hotel has its own log and its own sequence. Keep one place for each hotel. Name the hotel on the request, with the header.
Numbers you may not read are skipped
A key that holds only one of the two scopes sees the numbers of the other family skipped. nextAfter still moves past them. So you never ask for them twice.
The same number is on the webhook
A delivery carries the sequence of its event. When it is exactly one above your place, you can use the delivery as it is. When it is not, read the log.
A test event is not in the log
A sample sent by the test request of an endpoint says mode: test and has no sequence. An event you make on a is real: it has a sequence, and it is in the log of that sandbox.
Guest contact follows the same rule
The guest's phone and email in the log are returned until 30 days after . Every read of them is recorded. See Guest contact.

Words on this page

Event log
The list of everything that happened at a hotel, in order. You read it with GET /events.
Event
One thing that happened, like a new booking. Each webhook carries one event.
Webhook
A message ZimmerStack sends to your server when something happens, like a new booking.
Sequence
A number that counts a hotel's events in order: 1, 2, 3 and so on.
OTA
Online travel agency: a website that sells hotel rooms, like Booking.com, MakeMyTrip or Agoda. Learn more
Envelope
The outer part of every webhook. It says what happened, when, and at which hotel. The details are inside it.
Booking
A guest has reserved a room for some nights. Also called a reservation.
Scope
One permission of a key. For example ari:write lets the key update availability, rates and restrictions.
Database transaction
A group of changes in your database that are saved all together, or not at all.
Company key
The key of a software company. One key works for all the hotels of that company.
X-ZS-Property
The header that tells ZimmerStack which hotel a request is for. Its value is the property id.
Sandbox
Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.
Check-out
The day a guest leaves. It is not a night of the stay.
Rate limit
How many requests you may send in a minute, an hour or a day.

Routes, samples, limits and codes on this page come from the API's public contract, read live, Fri, 04 Dec 2026 20:22:26 UTC.