Scheduling
Real-Time Availability
Keeping clients in sync with slot availability
Set up the SDK server client to run the examples using esus. The REST examples use a session token. To run them with the SDK’s API key, send X-API-Key instead of Authorization.
Current Approach: Polling
Scheduling in Esus stays in sync by polling the Slot search endpoint. There are no push notifications for Slots (see below); the supported way to detect availability changes is to poll Slots periodically.
Slot search only supports schedule (exact Schedule UUID), status, start (same day, no prefixes) and service-type; see “Slots and Availability”.
# Free slots for a schedule on a given day (resolve the practitioner's Schedule id first)
curl "https://api.esus.health/fhir/Slot?schedule=aa11bb22-cc33-dd44-ee55-ff6677889900&status=free&start=2026-04-21&_count=100" \
-H "Authorization: Bearer YOUR_TOKEN"
const { resources, total } = await esus.fhir.search("Slot", {
"schedule": "aa11bb22-cc33-dd44-ee55-ff6677889900",
"status": "free",
"start": "2026-04-21",
"_count": 100
});
Slot search has no _sort and no guaranteed order: sort by start on the client side to find the nearest one. Keep in mind that a slot only becomes free again after a cancellation if your application sets it back to free.
Push notifications
There are no push notifications for Slot changes: the FHIR Subscription resource is not available (/fhir/Subscription returns 404), and there is no Slot webhook event. Use polling.
Appointments do have webhooks: subscribe to appointment.created (also sent by $book), appointment.updated (including $cancel), and appointment.deleted to learn about bookings and cancellations without polling, then refresh the affected day’s slots. See “Webhooks” in the Platform section.
Overbooking and Conflict Handling
There is no _conflictDetection parameter. $book claims the slot with a conditional update, so two concurrent requests for the same slot can’t both succeed: the loser (or any request for a slot that isn’t free) gets HTTP 400, not 409. No booking path returns 409. A participant with an overlapping appointment also gets 400 ("Double booking detected").
{
"resourceType": "OperationOutcome",
"issue": [{
"severity": "error",
"code": "invalid",
"diagnostics": "Slot is not available (status: busy)",
"expression": ["slotId"]
}]
}
The Slot.overbooked boolean exists as a descriptive field, but $book does not evaluate it: a booking is rejected whenever the slot is not free, regardless of overbooked. If your application wants to allow overbooking, that is your business logic’s responsibility (e.g. keep the slot free, or manage overlapping appointments outside of $book).