{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whenmeet-me/json-schema/whenmeet-me-import-preview-schema.json",
  "title": "ImportPreview",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/whenmeet-me-api-openapi.json#/components/schemas/ImportPreview",
  "type": "object",
  "properties": {
    "profile": {
      "type": "object",
      "properties": {
        "handle": {
          "type": [
            "string",
            "null"
          ],
          "description": "Suggested nickname (with -1, -2 … if taken)."
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "timezone": {
          "type": [
            "string",
            "null"
          ]
        },
        "weeklyHours": {
          "anyOf": [
            {
              "$ref": "#/$defs/WeeklyHours"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "applyProfile": {
      "type": "boolean",
      "description": "true while your auto-created profile is untouched — apply will then take over nickname, zone and hours."
    },
    "eventTypes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EventTypeInput"
      }
    },
    "skipped": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ImportFinding"
      },
      "description": "Whole links or types not imported, with a reason."
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ImportFinding"
      },
      "description": "Settings changed, approximated or unavailable for review before applying; separate from skipped links."
    }
  },
  "$defs": {
    "BookingQuestion": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9_]{1,32}$"
        },
        "label": {
          "type": "string",
          "maxLength": 200
        },
        "type": {
          "type": "string",
          "enum": [
            "text",
            "textarea"
          ]
        },
        "required": {
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "label",
        "type",
        "required"
      ]
    },
    "EventTypeInput": {
      "type": "object",
      "description": "Link type settings. Only title is needed to create one; everything else has a sensible default.",
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120
        },
        "slug": {
          "type": "string",
          "description": "Default: from the title (-2, -3 … appended if taken)."
        },
        "description": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000
        },
        "durationMin": {
          "type": "integer",
          "minimum": 5,
          "maximum": 480,
          "multipleOf": 5,
          "default": 30
        },
        "conference": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "meet",
            "teams",
            null
          ],
          "description": "Default: meet for a Google calendar, teams for Microsoft."
        },
        "bufferBeforeMin": {
          "type": "integer",
          "minimum": 0,
          "maximum": 240,
          "default": 0
        },
        "bufferAfterMin": {
          "type": "integer",
          "minimum": 0,
          "maximum": 240,
          "default": 0
        },
        "minNoticeMin": {
          "type": "integer",
          "minimum": 0,
          "maximum": 43200,
          "default": 240
        },
        "maxDaysAhead": {
          "type": "integer",
          "minimum": 1,
          "maximum": 60,
          "default": 60
        },
        "slotStepMin": {
          "type": "integer",
          "enum": [
            5,
            10,
            15,
            20,
            30,
            45,
            60,
            90,
            120
          ],
          "default": 30
        },
        "dailyLimit": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1,
          "maximum": 50,
          "default": null
        },
        "questions": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/BookingQuestion"
          },
          "description": "Name and email are always collected."
        },
        "weeklyHours": {
          "anyOf": [
            {
              "$ref": "#/$defs/WeeklyHours"
            },
            {
              "type": "null"
            }
          ],
          "description": "Personal links only. Set with hoursTimezone to override this link’s weekly hours; null follows the booking profile. Team links reject an override (invalid_weekly_hours)."
        },
        "hoursTimezone": {
          "type": [
            "string",
            "null"
          ],
          "description": "IANA timezone for weeklyHours. A non-null weeklyHours needs a valid non-null zone; clear both to follow the profile (invalid_hours_timezone on a mismatched pair)."
        },
        "reminders": {
          "type": "array",
          "items": {
            "type": "integer",
            "enum": [
              15,
              30,
              60,
              120,
              240,
              1440,
              2880
            ]
          },
          "maxItems": 3,
          "default": [
            1440,
            60
          ],
          "description": "Reminder emails to the invitee and guests, in minutes before the start (24 h and 1 h by default). Any 3 of the allowed values; duplicates collapse, stored sorted descending. [] turns reminders off; null resets to the default. Error: invalid_reminders."
        },
        "active": {
          "type": "boolean",
          "default": true
        },
        "team": {
          "anyOf": [
            {
              "$ref": "#/$defs/TeamSettings"
            },
            {
              "type": "null"
            }
          ]
        },
        "teamHandle": {
          "type": [
            "string",
            "null"
          ],
          "description": "Team links only: the link’s own public address, whenmeet.me/@<teamHandle> (same rules as nicknames and the same namespace; a leading @ and upper case are forgiven). null or \"\" releases it; turning the link personal releases it too. Errors: invalid_team_handle (bad handle, or the link is / becomes personal), 409 handle_taken (held by any nickname — yours included — or another link; nothing changes), 400 too_many_team_handles (you already hold 5 team handles on other links; nothing changes)."
        },
        "teamName": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 80,
          "description": "Shown with the team handle (\"Acme Sales\"); null → the link title. Stored only next to a team handle (ignored without one). Error: invalid_team_name."
        }
      }
    },
    "ImportFinding": {
      "type": "object",
      "description": "A skipped link or a setting warning. Translate by code (+ params); reason is the same message in English.",
      "properties": {
        "name": {
          "type": "string"
        },
        "code": {
          "type": "string",
          "enum": [
            "invalid_settings",
            "slug_taken",
            "one_off",
            "meeting_poll",
            "round_robin",
            "collective",
            "team_event",
            "group_event",
            "secret_event",
            "inactive",
            "group_link",
            "unsupported_link_type",
            "availability_scope_missing",
            "too_many_links",
            "event_hours_unrepresentable",
            "event_hours_no_rule",
            "event_hours_unreadable",
            "calendly_multiple_durations",
            "calendly_duration_rounded",
            "name_shortened",
            "description_shortened",
            "questions_shortened",
            "questions_free_text",
            "multiple_locations",
            "video_provider_not_copied",
            "location_not_copied",
            "no_location",
            "date_exceptions_not_imported",
            "intervals_unrepresentable",
            "calendly_no_duration",
            "calendly_defaults",
            "buffer_unrepresentable",
            "step_unrepresentable",
            "horizon_unrepresentable",
            "hubspot_description_shortened",
            "hubspot_fields_unrepresentable",
            "hubspot_fields_omitted",
            "hubspot_labels_shortened",
            "hubspot_choice_free_text",
            "hubspot_location_not_copied",
            "hubspot_consent_not_copied",
            "hubspot_multiple_durations",
            "hubspot_duration_rounded",
            "hubspot_details_unavailable",
            "hubspot_no_duration",
            "hubspot_custom_availability",
            "hubspot_availability_undocumented",
            "hubspot_date_range_not_imported",
            "hubspot_defaults"
          ],
          "description": "Stable machine code. Skipped: invalid_settings {error}, slug_taken {slug}, one_off, meeting_poll, round_robin, collective, team_event, group_event, secret_event, inactive, group_link, unsupported_link_type, availability_scope_missing, too_many_links {max}. Warnings: everything else; *_multiple_durations {durations, to}, *_duration_rounded {from, to}, calendly_defaults / hubspot_defaults {settings}."
        },
        "params": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "Values for the message. error (invalid_settings) is the untranslated event-type validation code, e.g. invalid_duration_min. settings is a comma-separated list of setting codes: setting_notice, setting_horizon, setting_buffers, setting_buffer, setting_step, setting_daily_limit, setting_reminders."
        },
        "reason": {
          "type": "string",
          "description": "English text (kept for compatibility)."
        }
      },
      "required": [
        "name",
        "code",
        "reason"
      ]
    },
    "TeamSettings": {
      "type": "object",
      "description": "Turns a link into a TEAM link. mode \"all\" = every member must be free (e.g. a two-person interview panel); \"any\" = whoever is free, assigned in turn (round-robin). Members get an email invite and join with one calendar connect.",
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "all",
            "any"
          ]
        },
        "members": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "email"
          },
          "maxItems": 10,
          "description": "Colleagues to invite (you excluded)."
        },
        "includeMe": {
          "type": "boolean",
          "description": "In all mode you attend with the team; in any mode you join the round-robin pool so one available person (you or a teammate) receives the booking. Default true."
        }
      },
      "required": [
        "mode"
      ]
    },
    "WeeklyHours": {
      "type": "object",
      "description": "Working hours per weekday in the profile timezone, or in hoursTimezone for a personal link override: up to 6 [\"HH:MM\",\"HH:MM\"] intervals per day (\"24:00\" allowed as an end). Missing days mean no hours; overlapping intervals merge. Profile default Mon–Fri 09:00–17:00.",
      "properties": {
        "mon": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "tue": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "wed": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "thu": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "fri": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "sat": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        },
        "sun": {
          "type": "array",
          "maxItems": 6,
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            },
            "minItems": 2,
            "maxItems": 2
          }
        }
      }
    }
  }
}