Calendars that refuse double bookings
When several agents, booking pages or scheduling proposals write to one calendar at the same moment, checking availability first is not enough: two of them can see the same free slot and both book it. A calendar with prevent_overlaps: true closes that gap. Chronary refuses any write that would leave two active events overlapping on it, and when many writes race for one slot, exactly one of them succeeds.
It is off by default and available on every plan.
What you’ll accomplish
Section titled “What you’ll accomplish”- Create a calendar that refuses overlapping events, or turn the setting on for an existing one.
- Handle the
409an overlapping write gets back. - Know exactly what is guaranteed and what is not.
Turn it on
Section titled “Turn it on”Pass prevent_overlaps: true when you create the calendar:
curl -X POST https://api.chronary.ai/v1/agents/agt_a1b2c3d4/calendars \ -H "Authorization: Bearer chr_sk_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Consultations", "timezone": "America/New_York", "prevent_overlaps": true }'chronary calendars create \ --agent agt_a1b2c3d4 \ --name "Consultations" \ --timezone "America/New_York" \ --prevent-overlapsconst calendar = await client.calendars.create({ agentId: 'agt_a1b2c3d4', name: 'Consultations', timezone: 'America/New_York', prevent_overlaps: true,});console.log(calendar.prevent_overlaps); // truecalendar = client.agents.calendars.create( "agt_a1b2c3d4", name="Consultations", timezone="America/New_York", prevent_overlaps=True,)print(calendar.prevent_overlaps) # Truecal, err := client.Calendars.CreateForAgent(ctx, "agt_a1b2c3d4", &chronary.CreateCalendarParams{ Name: "Consultations", Timezone: "America/New_York", PreventOverlaps: chronary.Bool(true),})Or turn it on for a calendar you already have with PATCH /v1/calendars/:id:
curl -X PATCH https://api.chronary.ai/v1/calendars/cal_x1y2z3 \ -H "Authorization: Bearer chr_sk_your_key_here" \ -H "Content-Type: application/json" \ -d '{ "prevent_overlaps": true }'chronary calendars update cal_x1y2z3 --prevent-overlaps# Turn it off again:chronary calendars update cal_x1y2z3 --prevent-overlaps=falseawait client.calendars.update('cal_x1y2z3', { prevent_overlaps: true });client.calendars.update("cal_x1y2z3", prevent_overlaps=True)_, err := client.Calendars.Update(ctx, "cal_x1y2z3", &chronary.UpdateCalendarParams{ PreventOverlaps: chronary.Bool(true),})Every calendar response carries prevent_overlaps (true or false). Over MCP, create_calendar and update_calendar take the same prevent_overlaps parameter.
Turning it on is refused while the calendar already has overlaps
Section titled “Turning it on is refused while the calendar already has overlaps”The setting is a promise about everything on the calendar, so Chronary checks the calendar first. Turning it on returns 409 conflict with a code and the events in the way:
code | Cause | What to do |
|---|---|---|
calendar_has_overlaps | Two or more active events on the calendar that have not ended yet overlap | Move, cancel or delete the events in conflicting_event_ids, then send the request again |
calendar_has_recurring_series | The calendar has a recurring series that is still running | End or delete the series in conflicting_event_ids (see limits), then send the request again |
{ "error": { "type": "conflict", "code": "calendar_has_overlaps", "message": "This calendar holds overlapping events. Move, cancel or delete them first.", "conflicting_event_ids": ["evt_a1", "evt_b2"], "request_id": "req_abc123" }}conflicting_event_ids lists up to 50 events for calendar_has_overlaps and up to 25 series for calendar_has_recurring_series. If it is empty, the events in the way changed while the request ran: send it again. Overlaps between events that have already ended don’t stop you turning the setting on; they are left as they are. Once the setting is on, the guarantee covers every event on the calendar that has not ended, including the ones written before.
What is guaranteed
Section titled “What is guaranteed”On a calendar with prevent_overlaps: true:
- No two active events that have not ended overlap. An active event is one whose
statusisconfirmed,tentativeorhold. Cancelled and deleted events never block a slot. Overlaps between events that had already ended when you turned the setting on stay as they are; moving one of those events is checked like any other write. - It holds under parallel requests. When many writes for the same slot arrive together, exactly one succeeds and every other one gets
409. You don’t need your own locking or a check-then-write loop. - Every write that can create an overlap is checked: creating an event, moving one (a new
start_timeorend_time), setting a cancelled event back toconfirmedortentative, and confirming a hold. It makes no difference whether the write comes from the REST API, an SDK, the CLI, MCP, a booking page or a scheduling proposal. - Back-to-back is fine. Times are half-open: an event that ends at 10:00 and one that starts at 10:00 don’t overlap.
- An expired hold never blocks. A hold whose
hold_expires_athas passed stops counting at that moment, even before Chronary has sent itsevent.hold_expiredwebhook. - Holds keep their priority rules. A new hold still bumps an overlapping lower-priority hold, but only when nothing else is in the way: a hold that is refused cancels nothing.
Handle the refusal
Section titled “Handle the refusal”A write that would overlap an active event returns 409 with code: "event_conflict" and up to 10 of the events in the way:
{ "error": { "type": "conflict", "code": "event_conflict", "message": "This calendar refuses overlapping events, and this time overlaps an active event on it", "conflicting_event_ids": ["evt_m1n2o3"], "request_id": "req_abc123" }}A new hold that collides only with live holds of equal or higher priority gets the hold answer instead: 409 with type: "conflict", no code and no conflicting_event_ids. If you create holds, treat that as “slot taken” too.
Nothing was written. If conflicting_event_ids is empty, the event in the way moved or ended between the refusal and the lookup, so you can send the same request again. Otherwise don’t retry the same time: pick another free slot (for example from availability) and try again, or look at the conflicting events and decide whether one of them should move.
import { ChronaryError } from '@chronary/sdk';
try { await client.events.create('cal_x1y2z3', { title: 'Consultation', start_time: '2026-12-01T15:00:00Z', end_time: '2026-12-01T15:30:00Z', });} catch (err) { if (err instanceof ChronaryError && err.code === 'event_conflict') { console.log('Slot taken by', err.conflictingEventIds); } else { throw err; }}from chronary import APIStatusError
try: client.events.create( "cal_x1y2z3", title="Consultation", start_time="2026-12-01T15:00:00Z", end_time="2026-12-01T15:30:00Z", )except APIStatusError as err: if err.code != "event_conflict": raise print("Slot taken by", err.conflicting_event_ids)_, err := client.Events.Create(ctx, "cal_x1y2z3", params)var apiErr *chronary.Errorif errors.As(err, &apiErr) && apiErr.Code == "event_conflict" { fmt.Println("Slot taken by", apiErr.ConflictingEventIDs)}The other places a refusal shows up:
- Booking pages. A booker who submits a slot that was just taken gets
409 slot_conflictand picks another time. The booking page never sees which event is in the way. - Scheduling proposals. If the winning slot is taken when the proposal resolves,
POST /v1/scheduling/proposals/:id/resolvereturns409 event_conflictand the proposal stayspending. Resolving again picks the same slot, so cancel the proposal and propose new times. When the last response triggers the resolve, the response is saved andauto_resolve_errorexplains this. - MCP.
create_event,update_event,confirm_eventandresolve_proposalreturnisError: truewith"error": "event_conflict"andconflicting_event_ids(afterresolve_proposal, the proposal stays pending: cancel it and propose new times).update_calendarreturnscalendar_has_overlapsorcalendar_has_recurring_serieswith the ids when turning the setting on is refused.
Limits
Section titled “Limits”- One calendar only. The guarantee is per calendar. Two calendars, even two calendars of the same agent, can hold overlapping events, and there is no guarantee across agents. To keep one schedule free of overlaps, keep it on one protected calendar.
- Imported and connected busy time is consulted, not guaranteed. Events imported from an iCal subscription and busy time from a connected Google or Microsoft calendar never cause an
event_conflict: an event created or moved through the API can still overlap them. Booking pages do check them, both when they offer slots and when a booker submits one, so a booking page can answer409 slot_conflictor409 slot_unavailablebecause of them. Because they can change at any moment outside Chronary, that check is not a guarantee. - No recurring series (v1). A protected calendar cannot hold a running recurring series. Creating one, adding a
recurrence_ruleto an event, or moving, re-timing (timezone) or reactivating an existing series returns409withcode: "recurring_on_protected_calendar". A series that ended before you turned the setting on can still be renamed, edited without changing its time, or cancelled. Put recurring events on a separate calendar. - Expired holds never block. A hold stops counting when its
hold_expires_atpasses. Confirm it before then if you need the slot. - Writes made through Chronary. The guarantee covers what is written to the calendar through Chronary. Upcoming events written before you turned the setting on are covered too, because turning it on is refused while any of them overlap; overlaps that had already ended are left as they are.
Turn it off
Section titled “Turn it off”Send prevent_overlaps: false (chronary calendars update cal_x1y2z3 --prevent-overlaps=false). The calendar accepts overlapping events again straight away; nothing on it changes.
What’s next?
Section titled “What’s next?”- Calendars API reference: every field and error
- Events: holds, confirming and releasing them
- Error reference: all
409codes