{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/highlevel/json-schema/highlevel-get-all-schedules-response-dto-schema.json",
  "title": "GetAllSchedulesResponseDTO",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/highlevel-availability-api-openapi.yml#/components/schemas/GetAllSchedulesResponseDTO",
  "type": "object",
  "properties": {
    "schedules": {
      "description": "Array of schedules",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ScheduleObjectResponseDTO"
      }
    }
  },
  "required": [
    "schedules"
  ],
  "$defs": {
    "ScheduleIntervalDTO": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "description": "Start time in HH:MM format (24-hour format)",
          "pattern": "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
        },
        "to": {
          "type": "string",
          "description": "End time in HH:MM format (24-hour format)",
          "pattern": "^([01]?[0-9]|2[0-3]):[0-5][0-9]$"
        }
      },
      "required": [
        "from",
        "to"
      ]
    },
    "ScheduleObjectResponseDTO": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the schedule"
        },
        "name": {
          "type": "string",
          "description": "Human-readable name for the schedule"
        },
        "locationId": {
          "type": "string",
          "description": "Location ID where this schedule applies"
        },
        "rules": {
          "description": "Schedule rules defining when the schedule is active",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScheduleRuleDTO"
          }
        },
        "timezone": {
          "type": "string",
          "description": "Timezone for the schedule (IANA timezone identifier)"
        },
        "dateAdded": {
          "type": "string",
          "description": "ISO date string when the schedule was created"
        },
        "dateUpdated": {
          "type": "string",
          "description": "ISO date string when the schedule was last updated"
        },
        "userId": {
          "type": "string",
          "description": "User ID associated with the schedule"
        },
        "calendarIds": {
          "description": "Calendar IDs associated with the schedule",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "deleted": {
          "type": "boolean",
          "description": "Whether the schedule has been deleted"
        }
      },
      "required": [
        "id",
        "name",
        "locationId",
        "rules",
        "timezone",
        "dateAdded",
        "dateUpdated",
        "userId",
        "deleted"
      ]
    },
    "ScheduleRuleDTO": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "wday",
            "date"
          ],
          "description": "Type of schedule rule - weekday (recurring) or date (specific date)"
        },
        "intervals": {
          "description": "Time intervals for the rule (e.g., 9 AM to 5 PM)",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ScheduleIntervalDTO"
          }
        },
        "date": {
          "type": "string",
          "description": "Specific date in YYYY-MM-DD format (only for date-type rules)",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "day": {
          "type": "string",
          "enum": [
            "sunday",
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday",
            "saturday"
          ],
          "description": "Day of week (only for weekday-type rules)"
        }
      },
      "required": [
        "type",
        "intervals"
      ]
    }
  }
}