Bookings

Book, hold, approve, reschedule and cancel bookings with the Scheduling API, with questions, recurring series and webhooks.

const { : ,  } = await ...({
  : ,
  : "2027-01-04T15:00:00Z",
  : { : "patient_77", : "Sam Lee", : "sam@example.com", : "UTC" },
});
if (?. === "slot_unavailable") {
  // Someone else got there first: show the slots again.
}

The SDK retries safely: every attempt carries the same Idempotency-Key, so a lost response can't book twice. A refused request keeps no key.

Describing an event type

Give an event type a description of up to 2,000 characters of plain text. It's shown on hosted booking pages, where https:// links are clickable, and never in emails or calendar events.

Links, and anything shaped like a domain, must be on your organization's verified domains or their subdomains, or saving answers content_refused. In live environments the text is also screened for phishing and spam, like the title.

Why isn't a time available?

coss.scheduling.slots.explain says whether one start can be booked right now and, if not, why, for each host who could take it. It's decided the same way a booking is, including their calendars.

const {  } = await ...(, {
  : "2027-01-04T15:00:00.000Z",
});
.(?., ?.); // false "host_busy"

It tells you when a host is busy, so use it for support and debugging rather than showing it to attendees. To ask why a whole range is empty, without naming a start, use coss scheduling diagnose or the MCP server's diagnose_scheduling_slots.

Taking payment first

Hold the slot, charge the customer, then confirm. Live holds need Pro, Scale and Enterprise. A hold isn't charged and tells nobody. Its slot stays yours until it expires, though a plan's usage limit can still refuse the confirmation.

const { :  } = await ...({
  : ,
  : "2027-01-04T15:00:00Z",
  : { : "patient_77", : "Sam Lee", : "sam@example.com", : "UTC" },
});
// hold?.hold_expires_at: ten minutes by default (the event type's hold_ttl_seconds).

// ...take the payment, then:
await ...(!.);

After a hold expires, confirming answers hold_expired, or books anyway with if_still_free if nobody else took the slot. coss.scheduling.holds.release gives a slot back early.

Approval

An event type with requires_approval makes each booking pending_approval. The time stays blocked until approve, decline, or the deadline (approval_ttl_minutes), which declines it. Nothing's charged or added to a calendar until it's approved.

Questions

An event type can ask questions, answered in answers. Answers are encrypted, and only come back when you retrieve one booking: never in lists, webhooks, logs, emails or calendars. See Privacy before asking anything sensitive.

Guests

An attendee can bring other people. Set max_guests on the event type (up to 10; the default is 0, and a group event type takes none, since each person books a seat), then pass them when booking. The hosted booker offers it too.

await ...({
  : "evtype_01kd2m9a0b1c2d3e4f5g6h7j8m",
  : "2027-01-04T15:00:00.000Z",
  : { : "Sam Lee", : "sam@example.com", : "America/New_York" },
  : [{ : "jo@example.com", : "Jo Park" }],
});

Guests come after the attendee in attendees, with the role guest. With attendee emails on, they get the same confirmation, calendar invite, reminder and changes, in the attendee's time zone, but no link to change the booking, and they hear nothing until it's confirmed. Answers belong to the attendee, and guests aren't counted as seats or extra bookings.

Guests didn't ask to hear from anyone, so in live environments they're emailed only from your own email_from, never coss.com's address. Without a verified one they're still on the booking and its calendar event, and telling them is up to you.

Limiting bookings per person

Set max_active_bookings_per_attendee on an event type to cap how many upcoming bookings of it one person can have at a time. Booking past it answers attendee_limit_reached, without saying what they've booked.

People are known by uid or email, and bookings matching either count. Someone booking with neither isn't limited. Holds, bookings awaiting approval and every occurrence of a series count, and a series that wouldn't fit is refused whole. Guests don't count, and rescheduling an upcoming booking doesn't use up another. Confirming a hold or approving a request that's expired, or moving a past booking into the future, has to fit like a new booking.

On a booking page where people type their own details, that answer tells whoever's typing that the address is at the limit for this event type. If that matters, fill in the attendee when you create the session.

Rescheduling and cancelling

reschedule keeps the booking's id, and its old time stays booked unless the new one's free. Your API key can always do both. Attendees using a manage link are held to the event type's cancel_notice_minutes and reschedule_notice_minutes.

Recurring series

A series books up to 52 occurrences at the attendee's local time, so a weekly 10:00 stays 10:00 across a clock change. Each is an ordinary booking that can move on its own, and a pool keeps one host throughout.

const  = {
  : ,
  : "2027-01-04T15:00:00Z",
  : { : "patient_77", : "America/New_York" },
  : { : "weekly" as , : 12 },
  : "skip" as ,
};

const { :  } = await ...();
const { :  } = await ...();
// series?.conflicts lists any occurrence that wasn't free.

With on_conflict: "reject", the default, one taken occurrence books nothing.

Booking history

coss.scheduling.bookings.events lists what's happened to a booking, oldest first, and who did it.

const {  } = await ...();
for (const  of ?. ?? []) {
  .(., ., ..);
}

A cancelled booking also has cancelled_by. Pass an optional reason when cancelling, as the hosted manage page lets attendees do, and retrieving that one booking returns it as cancellation_reason. It's encrypted, and never appears in the history, webhooks, logs or emails. It's erased with the attendee's details.

Webhooks

Bookings send scheduling.booking.confirmed, .pending_approval, .rescheduled, .cancelled, .declined, .no_show, .external_conflict, .calendar_write_failed, .location_ready, .started, .ended and .reminder. They carry ids, times and statuses only. Retrieve the booking for anything about the person. .started and .ended fire at the booking's own times, and .reminder at any time you choose.

No-shows

Once a booking has started, coss.scheduling.bookings.markNoShow(id) records that the attendee didn't come. It sends scheduling.booking.no_show, stops follow-ups and sends any reminder timed from it. It can't be undone, and marking it again changes nothing.

Last updated