{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shipmail-to/json-schema/shipmail-to-booking-page-schema.json",
  "title": "BookingPage",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shipmail-to-openapi.json#/components/schemas/BookingPage",
  "type": "object",
  "required": [
    "object",
    "id",
    "mailbox",
    "slug",
    "url",
    "name",
    "description",
    "duration_minutes",
    "availability_days",
    "window_start_minutes",
    "window_end_minutes",
    "timezone",
    "lock_timezone",
    "buffer_minutes",
    "minimum_notice_minutes",
    "max_advance_days",
    "conferencing_provider",
    "active",
    "notify_host",
    "require_email_verification",
    "questions",
    "duration_options",
    "weekly_hours",
    "date_overrides",
    "max_bookings_per_day",
    "max_bookings_per_week",
    "reminder_minutes_before",
    "follow_up_minutes_after",
    "follow_up_message",
    "created_at",
    "updated_at"
  ],
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "booking_page"
      ]
    },
    "id": {
      "type": "string"
    },
    "mailbox": {
      "type": "string",
      "format": "email",
      "description": "The mailbox whose availability the page exposes."
    },
    "slug": {
      "type": "string"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public booking URL."
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "duration_minutes": {
      "type": "integer",
      "description": "The default meeting length in minutes."
    },
    "availability_days": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Weekdays offered, 0=Sunday .. 6=Saturday."
    },
    "window_start_minutes": {
      "type": "integer",
      "description": "Start of the daily window, minutes from midnight."
    },
    "window_end_minutes": {
      "type": "integer",
      "description": "End of the daily window, minutes from midnight."
    },
    "timezone": {
      "type": "string"
    },
    "lock_timezone": {
      "type": "boolean",
      "description": "When true, every visitor sees times in the page's timezone instead of their own, and the page offers no timezone selector. Use it for in-person meetings."
    },
    "buffer_minutes": {
      "type": "integer"
    },
    "minimum_notice_minutes": {
      "type": "integer"
    },
    "max_advance_days": {
      "type": "integer"
    },
    "conferencing_provider": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "zoom",
        "google_meet"
      ],
      "description": "Opt-in provider used to create a meeting for each booking. Null means no meeting link. The provider must already be connected to the page's mailbox, or the request is rejected."
    },
    "active": {
      "type": "boolean"
    },
    "notify_host": {
      "type": "boolean",
      "description": "When true, the page's mailbox gets an email each time a visitor books, reschedules or cancels through the public page or one of its one-off links. Changes made in Shipmail send no such email."
    },
    "require_email_verification": {
      "type": "boolean",
      "description": "When true, a visitor enters a 6-digit code sent to the email address they typed before the booking is made, on the public page and its one-off links. Stops fake and mistyped bookings. Bookings made through the API or in Shipmail need no code."
    },
    "questions": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/BookingPageQuestion"
      },
      "description": "Extra questions the public form asks after name and email, in order. Answers go on the host's calendar event, in the host email and in the booking.created event, never in the visitor's confirmation."
    },
    "duration_options": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 5,
        "maximum": 480
      },
      "description": "Extra lengths in minutes a visitor can choose, unique, stored ascending. When not empty, duration_minutes (the default length) must be one of them. [] offers duration_minutes only."
    },
    "weekly_hours": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BookingPageWeeklyInterval"
      },
      "description": "The effective weekly hours. For a page that never set them, derived from availability_days and the window."
    },
    "date_overrides": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BookingPageDateOverride"
      },
      "description": "Time off and special hours. At most 100 entries that do not overlap. Past entries may be dropped on save."
    },
    "max_bookings_per_day": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Most bookings on one day, counted in the page's timezone. null means no cap."
    },
    "max_bookings_per_week": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Most bookings in one week (Monday to Sunday), counted in the page's timezone. null means no cap."
    },
    "reminder_minutes_before": {
      "type": [
        "integer",
        "null"
      ],
      "enum": [
        15,
        60,
        120,
        1440,
        2880,
        null
      ],
      "description": "Email the person who booked this many minutes before the start. null turns the reminder off."
    },
    "follow_up_minutes_after": {
      "type": [
        "integer",
        "null"
      ],
      "enum": [
        60,
        1440,
        null
      ],
      "description": "Email the person who booked this many minutes after the end. Requires follow_up_message. null turns the follow-up off."
    },
    "follow_up_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "The follow-up email's text. Required when follow_up_minutes_after is set."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "BookingPageDateOverride": {
      "type": "object",
      "required": [
        "start_date",
        "end_date",
        "intervals"
      ],
      "description": "Different hours for a date range, in the page's timezone. Empty intervals means unavailable on those dates (time off); otherwise the intervals replace the weekly hours of each day in the range.",
      "properties": {
        "start_date": {
          "type": "string",
          "format": "date",
          "description": "First date, YYYY-MM-DD."
        },
        "end_date": {
          "type": "string",
          "format": "date",
          "description": "Last date, YYYY-MM-DD, on or after start_date. A range spans at most 366 days."
        },
        "intervals": {
          "type": "array",
          "maxItems": 4,
          "items": {
            "$ref": "#/$defs/BookingPageTimeInterval"
          },
          "description": "Open intervals on each of those dates, not overlapping. [] means unavailable."
        }
      }
    },
    "BookingPageQuestion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[A-Za-z0-9_-]+$",
          "description": "Stable question ID. Answers in booking.created carry it as question_id."
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120,
          "description": "The question as visitors see it."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "long_text",
            "phone"
          ],
          "description": "text takes up to 500 characters, long_text up to 2000, phone up to 40 with a loose phone number check."
        },
        "required": {
          "type": "boolean",
          "description": "Visitors must answer it to book."
        }
      },
      "required": [
        "id",
        "label",
        "type",
        "required"
      ],
      "additionalProperties": false
    },
    "BookingPageTimeInterval": {
      "type": "object",
      "required": [
        "start_minutes",
        "end_minutes"
      ],
      "properties": {
        "start_minutes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1439,
          "description": "Minutes after midnight in the page's timezone."
        },
        "end_minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1440,
          "description": "Minutes after midnight in the page's timezone. After start_minutes; 1440 is midnight at the end of the day."
        }
      }
    },
    "BookingPageWeeklyInterval": {
      "type": "object",
      "required": [
        "day",
        "start_minutes",
        "end_minutes"
      ],
      "properties": {
        "day": {
          "type": "integer",
          "minimum": 0,
          "maximum": 6,
          "description": "Weekday, 0=Sunday .. 6=Saturday."
        },
        "start_minutes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1439,
          "description": "Minutes after midnight in the page's timezone."
        },
        "end_minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1440,
          "description": "Minutes after midnight in the page's timezone. After start_minutes; 1440 is midnight at the end of the day."
        }
      }
    }
  }
}