{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/volunteerreminder-com/json-schema/volunteerreminder-com-schedule-schema.json",
  "title": "Schedule",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/volunteerreminder-com-openapi.yml#/components/schemas/Schedule",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Schedule id."
    },
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "Short label shown on the schedule list and in reminder messages, e.g. \"Sunday morning greeters\"."
    },
    "job_id": {
      "type": "number",
      "description": "Job/role id (use for per-job reminder overrides)."
    },
    "job_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Resolved job/role name."
    },
    "group_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Id of an existing volunteer group to attach, or null. An id not owned by this account is silently ignored (treated as null)."
    },
    "group_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Resolved group name, or null."
    },
    "schedule_type": {
      "type": "string",
      "enum": [
        "weekly",
        "biweekly",
        "monthly_fixed",
        "monthly_nth",
        "bimonthly_fixed",
        "bimonthly_nth",
        "custom"
      ],
      "description": "Recurrence shape. 'weekly' recurs on one or more days of the week; 'biweekly' is the same weekday mask every 14 days (start_date picks which week — it is not BiMonthly, which is every other MONTH); 'monthly_fixed' / 'bimonthly_fixed' recur on a fixed day of the month; 'monthly_nth' / 'bimonthly_nth' recur on the Nth weekday of the month; the 'bimonthly_*' variants additionally alternate months starting from start_month; 'custom' uses an explicit list of dates."
    },
    "days_of_week": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "sunday",
          "monday",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ]
      },
      "description": "Days of the week this recurs on. Required (non-empty) when schedule_type is 'weekly' or 'biweekly'; ignored for every other schedule_type."
    },
    "nth_weekday": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "sunday",
        "monday",
        "tuesday",
        "wednesday",
        "thursday",
        "friday",
        "saturday",
        null
      ],
      "description": "The weekday that recurs. Used by schedule_type 'monthly_nth' / 'bimonthly_nth'; defaults to Sunday if omitted for those types."
    },
    "week_of_month": {
      "type": [
        "number",
        "null"
      ],
      "description": "Nth-weekday occurrence (1-5), or null when schedule_type doesn't use it."
    },
    "day_of_month": {
      "type": [
        "number",
        "null"
      ],
      "description": "Fixed day of month, or null when schedule_type doesn't use it."
    },
    "start_month": {
      "type": [
        "number",
        "null"
      ],
      "description": "Bimonthly anchor month (1-12), or null when schedule_type doesn't use it."
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
      "description": "Wall-clock time of day \"HH:mm\" (24h) in the account's timezone, or null for no specific time (midnight)."
    },
    "start_date": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "\"yyyy-MM-dd\" in the account's timezone before which no occurrences materialize, or null for no lower bound. For 'biweekly' this date also picks which week the 14-day rotation lands on (Sunday-week of this day is an on-week). When omitted for biweekly, the server stores the first selected weekday with a shift still ahead (today if it is selected and its start time hasn't passed, else the next selected weekday; the first shift), and the rotation counts from there. On PATCH of an existing biweekly schedule, null keeps the stored date (the rotation only moves when you send a new date)."
    },
    "end_date": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "\"yyyy-MM-dd\" in the account's timezone after which occurrence materialization stops, or null for no end date."
    },
    "custom_dates": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "description": "Explicit list of \"yyyy-MM-dd\" dates. Required (non-empty) when schedule_type is 'custom'; ignored otherwise."
    },
    "contact_ids": {
      "type": "array",
      "items": {
        "type": "integer"
      },
      "description": "Volunteer roster for this schedule. Ids not owned by this account are silently dropped."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text internal notes."
    },
    "next_occurrence_at": {
      "type": [
        "number",
        "null"
      ],
      "description": "Epoch ms (UTC) of the next upcoming, attendable occurrence, or null."
    },
    "is_muted": {
      "type": "boolean",
      "description": "Whether reminders for this schedule are muted."
    },
    "created_at": {
      "type": "number",
      "description": "Epoch ms (UTC) this schedule was created."
    }
  },
  "required": [
    "id",
    "description",
    "job_id",
    "job_name",
    "group_id",
    "group_name",
    "schedule_type",
    "days_of_week",
    "nth_weekday",
    "week_of_month",
    "day_of_month",
    "start_month",
    "time",
    "start_date",
    "end_date",
    "custom_dates",
    "contact_ids",
    "notes",
    "next_occurrence_at",
    "is_muted",
    "created_at"
  ]
}