Capacity

Open, close, or toggle waitlist-only over a date range

Backs the MCP set_weekly_availability and set_waitlist_mode tools. For each date in [date_from, date_to] whose weekday is in weekdays (omit weekdays for every day):

• action:"close" ensures a CLOSED AvailabilityRule (Schedule Exception) covers the date for the scope (restaurant-wide when service_period_id is omitted, else per-period). Existing bookings are surfaced in the response, NEVER cancelled.

• action:"open" carves overlapping CLOSED AvailabilityRules (and, at restaurant scope, ClosurePeriods) so they no longer cover the target dates; when a restaurant-wide rule is carved for a single-period open, the other periods are re-closed on those dates. Optional cap sets a floor-clamped per-date CapacityOverride. A date whose period doesn't run that weekday is reported could_not_open (never silently skipped). Does NOT lift WAITLIST_ONLY rules — those dates come back could_not_open with closed_reason_kind:"WAITLIST_ONLY"; use waitlist_off.

• action:"waitlist_on" / "waitlist_off" toggle the WAITLIST_ONLY mode (guests can only join the waitlist; staff can still book via POST /bookings with force_closed:true). Same idempotency/carve semantics as close/open; turning off one period inside a restaurant-wide window keeps the other periods gated.

Every result row is read back through the shared date-gate so the response reflects the true post-state. Idempotent, reversible (DELETE /api/v1/availability-rules/:id), audit-logged. Window capped at 180 days. Scope: bookings:write.

post/api/v1/availability-rules

Request

  • Base URL: https://www.gerezi.com
  • URL: https://www.gerezi.com/api/v1/availability-rules
  • Auth: HTTP bearer

Request body

restaurant_idstring

Required for org-level keys.

weekdaysinteger[]

1=Mon … 7=Sun. Omit for every day in the window.

date_fromstring required
date_tostring required
action'open' | 'close' | 'waitlist_on' | 'waitlist_off' required
service_period_idstring

Omit to act on all active periods (restaurant-wide).

capinteger

action=open only. Per-date capacity override, floor-clamped.

reasonstring

Example request

{
  "weekdays": [
    4,
    5,
    6
  ],
  "date_from": "2026-07-01",
  "date_to": "2026-07-31"
}

Response

Per-date result rows + summary (opened/closed/waitlisted/lifted/unchanged/could_not/affected_bookings)

Changes

No recorded changes to this operation across all 1 revision of this API.