Pools and groups

Any available host, several hosts at once, and sessions with seats.

An event type's kind says who a booking needs.

Pools: any available host

const { :  } = await ...({
  : "See the next available doctor",
  : "pool",
  : 15,
  : [{ : "doctor_482", : 200 }, { : "doctor_483" }],
  : { : "urgent-care" },
});

Hosts come from hosts, plus any active host matching all of host_filter. A slot is offered if anyone's free, and a booking goes to whoever's furthest behind their share (weight), then whoever's waited longest. If they've just been taken, it moves on to the next.

Narrow one booking with attributes, such as who's licensed in the patient's state:

await ...({
  : ,
  : "2027-01-04T15:00:00Z",
  : { : "CA" },
  : { : "patient_77", : "America/Los_Angeles" },
});

Who's free?

For a marketplace's search page: each matching host's soonest slots, soonest first, across up to 500 hosts.

const {  } = await ...({
  : ,
  : "2027-01-04T00:00:00Z",
  : "2027-01-18T00:00:00Z",
  : { : "es" },
  : 3,
});

Collective: several hosts at once

With kind: "collective", every host with role: "required" must be free, such as a doctor and an interpreter. Add at most one member, and one of a pool is chosen alongside them.

Group sessions

With kind: "group" and a capacity, each attendee books a seat in the same session, with a booking and manage link of their own. The host's time is taken once, by the first seat, and given back with the last. A full session answers slot_unavailable. A seat moves by cancelling it and booking another session.