{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/whatsapp/json-schema/whatsapp-schedule-create-request-schema.json",
  "title": "ScheduleCreateRequest",
  "description": "Request payload for creating a new schedule",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whatsapp-schedule-management-api-openapi.yml#/components/schemas/ScheduleCreateRequest",
  "type": "object",
  "required": [
    "name",
    "schedule_type",
    "start_time",
    "end_time"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Human-readable name for the schedule",
      "minLength": 1,
      "maxLength": 100
    },
    "schedule_type": {
      "$ref": "#/$defs/WhatsAppScheduleType"
    },
    "description": {
      "type": "string",
      "description": "Optional description of the schedule purpose",
      "maxLength": 500
    },
    "start_time": {
      "type": "string",
      "format": "time",
      "description": "Schedule start time in HH:MM format"
    },
    "end_time": {
      "type": "string",
      "format": "time",
      "description": "Schedule end time in HH:MM format"
    },
    "timezone": {
      "type": "string",
      "description": "Timezone identifier for the schedule",
      "default": "UTC"
    },
    "days_of_week": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DayOfWeek"
      },
      "description": "Days of the week when the schedule is active"
    },
    "is_active": {
      "type": "boolean",
      "description": "Whether the schedule should be active upon creation",
      "default": true
    },
    "recurrence_pattern": {
      "$ref": "#/$defs/RecurrencePattern"
    }
  },
  "$defs": {
    "DayOfWeek": {
      "type": "string",
      "description": "Day of the week",
      "enum": [
        "MONDAY",
        "TUESDAY",
        "WEDNESDAY",
        "THURSDAY",
        "FRIDAY",
        "SATURDAY",
        "SUNDAY"
      ]
    },
    "RecurrencePattern": {
      "type": "object",
      "description": "Pattern for recurring schedules",
      "properties": {
        "frequency": {
          "type": "string",
          "enum": [
            "DAILY",
            "WEEKLY",
            "MONTHLY",
            "YEARLY"
          ]
        },
        "interval": {
          "type": "integer",
          "minimum": 1,
          "description": "Interval between recurrences"
        },
        "end_date": {
          "type": "string",
          "format": "date",
          "description": "End date for the recurrence pattern"
        }
      }
    },
    "WhatsAppScheduleType": {
      "type": "string",
      "description": "Type of schedule configuration",
      "enum": [
        "BUSINESS_HOURS",
        "AUTOMATED_RESPONSE",
        "MESSAGE_CAMPAIGN",
        "MAINTENANCE_WINDOW",
        "CUSTOM"
      ]
    }
  }
}