Skip to content

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.

  1. Create a calendar that refuses overlapping events, or turn the setting on for an existing one.
  2. Handle the 409 an overlapping write gets back.
  3. Know exactly what is guaranteed and what is not.

Pass prevent_overlaps: true when you create the calendar:

Terminal window
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
}'

Or turn it on for a calendar you already have with PATCH /v1/calendars/:id:

Terminal window
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 }'

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:

codeCauseWhat to do
calendar_has_overlapsTwo or more active events on the calendar that have not ended yet overlapMove, cancel or delete the events in conflicting_event_ids, then send the request again
calendar_has_recurring_seriesThe calendar has a recurring series that is still runningEnd 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.

On a calendar with prevent_overlaps: true:

  • No two active events that have not ended overlap. An active event is one whose status is confirmed, tentative or hold. 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_time or end_time), setting a cancelled event back to confirmed or tentative, 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_at has passed stops counting at that moment, even before Chronary has sent its event.hold_expired webhook.
  • 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.

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;
}
}

The other places a refusal shows up:

  • Booking pages. A booker who submits a slot that was just taken gets 409 slot_conflict and 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/resolve returns 409 event_conflict and the proposal stays pending. 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 and auto_resolve_error explains this.
  • MCP. create_event, update_event, confirm_event and resolve_proposal return isError: true with "error": "event_conflict" and conflicting_event_ids (after resolve_proposal, the proposal stays pending: cancel it and propose new times). update_calendar returns calendar_has_overlaps or calendar_has_recurring_series with the ids when turning the setting on is refused.
  • 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 answer 409 slot_conflict or 409 slot_unavailable because 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_rule to an event, or moving, re-timing (timezone) or reactivating an existing series returns 409 with code: "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_at passes. 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.

Send prevent_overlaps: false (chronary calendars update cal_x1y2z3 --prevent-overlaps=false). The calendar accepts overlapping events again straight away; nothing on it changes.