{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shipmail-to/json-schema/shipmail-to-create-booking-page-request-schema.json",
  "title": "CreateBookingPageRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shipmail-to-openapi.json#/components/schemas/CreateBookingPageRequest",
  "type": "object",
  "required": [
    "name",
    "mailbox",
    "slug",
    "duration_minutes",
    "timezone"
  ],
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 120
    },
    "mailbox": {
      "type": "string",
      "format": "email",
      "description": "The mailbox whose availability the page exposes. It must be on your own domain: a temporary try.shipmail.to inbox is rejected with a validation error."
    },
    "slug": {
      "type": "string",
      "description": "URL slug, lowercase letters, numbers, and hyphens."
    },
    "duration_minutes": {
      "type": "integer",
      "minimum": 5,
      "maximum": 480,
      "description": "The default meeting length in minutes. When duration_options is not empty, it must be one of them."
    },
    "availability_days": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 0,
        "maximum": 6
      },
      "description": "Weekdays offered, 0=Sunday .. 6=Saturday. Required unless weekly_hours is given; ignored and derived when weekly_hours is given."
    },
    "window_start_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1440,
      "description": "Minutes after midnight in the page's timezone. Required unless weekly_hours is given; ignored and derived when weekly_hours is given."
    },
    "window_end_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 1440,
      "description": "Minutes after midnight in the page's timezone. Required unless weekly_hours is given; ignored and derived when weekly_hours is given."
    },
    "timezone": {
      "type": "string"
    },
    "lock_timezone": {
      "type": "boolean",
      "default": false,
      "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."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "buffer_minutes": {
      "type": "integer",
      "minimum": 0,
      "maximum": 240,
      "default": 0
    },
    "minimum_notice_minutes": {
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "max_advance_days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 365,
      "default": 30
    },
    "conferencing_provider": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "zoom",
        "google_meet"
      ],
      "description": "Opt-in provider used to create a meeting for each booking. Null or omission means no meeting link. The provider must already be connected to the page's mailbox, or the request is rejected."
    },
    "active": {
      "type": "boolean",
      "default": true
    },
    "notify_host": {
      "type": "boolean",
      "default": true,
      "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",
      "default": false,
      "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,
      "default": [],
      "items": {
        "$ref": "#/$defs/BookingPageQuestionInput"
      },
      "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. Question IDs must be unique."
    },
    "duration_options": {
      "type": "array",
      "maxItems": 6,
      "uniqueItems": true,
      "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.",
      "default": []
    },
    "weekly_hours": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/BookingPageWeeklyInterval"
      },
      "description": "Open intervals per weekday, up to 4 per day and not overlapping, so a day can have breaks. At least one interval must be as long as the shortest offered length. When given it wins over availability_days, window_start_minutes and window_end_minutes, which are derived from it (days with any interval; earliest start to latest end).",
      "default": null
    },
    "date_overrides": {
      "type": "array",
      "maxItems": 100,
      "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.",
      "default": []
    },
    "max_bookings_per_day": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 100,
      "description": "Most bookings on one day, counted in the page's timezone. null means no cap.",
      "default": null
    },
    "max_bookings_per_week": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 100,
      "description": "Most bookings in one week (Monday to Sunday), counted in the page's timezone. null means no cap.",
      "default": null
    },
    "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.",
      "default": null
    },
    "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.",
      "default": null
    },
    "follow_up_message": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000,
      "description": "The follow-up email's text. Required when follow_up_minutes_after is set.",
      "default": null
    }
  },
  "$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."
        }
      }
    },
    "BookingPageQuestionInput": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "maxLength": 40,
          "pattern": "^[A-Za-z0-9_-]+$",
          "description": "Keep a question's existing ID to keep it. Leave it out for a new question and Shipmail generates one."
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120,
          "description": "The question as visitors see it."
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "long_text",
            "phone"
          ]
        },
        "required": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "label",
        "type"
      ],
      "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."
        }
      }
    }
  }
}