Appointment Booking integrates with calendars via iMIP, not middleware APIs
- Deciders: Julian Bäume
- Date: 2026-07-08
Status
Accepted. Amended 2026-07-28: a reschedule is an iTIP UPDATE, not CANCEL + REQUEST (decision 1).
Context
Appointment Booking must get a confirmed booking into the owner's App Suite Calendar (and ideally check the owner's free/busy while deriving slots). Unlike poll finalization — driven by the owner from their own browser session — these actions are triggered by unauthenticated bookers: there is no session to forward, and this service deliberately stores no user credentials (ADR-0006).
Acting on a user's behalf without their session has no dependable platform mechanism today:
- The Java middleware supports one configured IdP at a time. The documented switchboard impersonation pattern (machine JWT → impersonation JWT → middleware OAuth provider) only works where switchboard is that IdP — impossible whenever a real IdP is configured. Teams has the same need and it is unsolved there too.
- IdP-side constructions (service accounts, additional OIDC clients, token exchange) are operationally expensive to roll out across deployments.
Independently, the feature needs outbound mail anyway: the booker's confirmation and manage link are mails this service must send itself.
Decision
Booking talks to calendars via iMIP over SMTP. The service acts as the iTIP organizer, sending from a dedicated mailbox identity. A confirmed booking produces an iMIP
REQUESTto both the owner and the booker (the booker's copy doubles as their calendar invite); a cancellation produces an iMIPCANCEL; a reschedule is anUPDATE— the sameUIDwith the nextSEQUENCEand the new times, so the existing entry moves. Events carry an iCalendarUIDderived from the booking id — that is the traceability mechanism (replacing theextendedPropertiesmarker the Chronos API path would have used).Amended 2026-07-28. The reschedule was originally specified as
CANCEL+ a newREQUEST, because the reschedule flow creates a new booking row and theUIDwas derived per row. On the wire that made a moved appointment look like a loss followed by an unrelated rebooking: it emptied the slot in both calendars before refilling it, and it cost five mails where one exchange is meant to happen. A rescheduled booking now inherits theUIDand sequence of the booking it supersedes, so one rebook chain is one calendar entry and a move sends exactly one mail per party. TheUIDis therefore unique per chain, not per row; the chain's live booking is the one that has not been superseded. Rebooking a booking that was already cancelled stays a freshREQUESTwith a newUID— itsCANCELhas gone out and clients may have purged the event, so anUPDATEcould land nowhere.The booking record stays authoritative; owner acceptance is feedback, not a gate. The slot is blocked the moment the booking is confirmed. The invitation lands in the owner's calendar through App Suite's standard iMIP processing; whether and when the owner accepts changes what their calendar shows, never whether the slot is booked.
No middleware calls on the owner's behalf in the baseline. Slot derivation checks Booking's own bookings and the availability rules only. Free/busy conflict checking is a later enhancement that assumes a middleware free/busy API usable by services — if none materializes, that requirement is raised at platform level (shared with Teams) rather than worked around here.
Owner-session reconciliation happens in the plugin. Wherever feedback from the owner's calendar is wanted (invitation accepted? event declined or deleted?), the
ui-plugin— which always runs with the owner's session — looks the event up by itsUIDvia the normal Chronos API and surfaces findings (e.g. "you declined this booking's event — cancel the booking?"). The backend never needs credentials for this.The integration sits behind an internal interface. If the platform gains a real service-auth mechanism, a full-fidelity middleware backend (dedicated calendar folder, events created as confirmed, server-side free/busy) can replace or augment the iMIP path without touching the booking domain logic.
Consequences
Positive
- Works on every deployment that can relay SMTP — no IdP coupling, no impersonation tokens, no per-deployment admin negotiation beyond a sender mailbox.
- One new dependency (mail) covers both architectural gaps: calendar delivery and the booker's manage-link/confirmation mail.
- iTIP/iMIP is the standard for cross-system scheduling; the booker's side works identically for non-App-Suite recipients (Gmail, Outlook, …) for free.
- The immediate-block model keeps the no-double-booking guarantee entirely inside this service's transaction — calendar delivery is asynchronous decoration.
Negative / constraints
- The event appears in the owner's default calendar as an invitation (tentative until accepted) — no dedicated "Bookings" folder, no server-controlled event state.
- Booking cannot detect calendar-side changes by itself; detection degrades to plugin-side reconciliation while the owner is active in App Suite (and possibly iTIP
REPLYprocessing later, which would require reading the organizer mailbox — out of scope for the first iteration). - Depends on App Suite's inbound iMIP auto-processing behavior for what state an arriving event lands in.
- A sender mailbox identity per installation becomes required operations setup, and mail deliverability (SPF/DKIM) becomes part of the feature's operational surface.

