Repository navigation
GET /v1/bookings: add updated_since (including cancellations) for efficient sync #262
dominik-myszkowski
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We sync bookings to an external service (an SMS reminder sender) by polling GET /v1/bookings. Today the list filters by from/to on start_at, status, when, event_type etc., and excludes cancelled bookings unless status=cancelled is set explicitly. So a poller has to:
fetch the whole upcoming window on every run,
detect cancellations by a booking disappearing from the list (or make a second call with status=cancelled),
detect reschedules by diffing start_at.
Proposal: an updated_since= parameter returning every booking whose row changed after that instant, including cancelled ones, ordered by updated_at ascending, with updated_at in each item. A client keeps a cursor (the last updated_at it saw) and gets an exact change feed, which is also useful as a fallback when a webhook delivery was missed. The bookings table already has updated_at. The change would make sure every status, time and host change bumps it, and possibly add an index on it.
Happy to implement (handler + booking.ListFilter + tests + docs) if this fits your API design.
All reactions