{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/volunteerreminder-com/json-schema/volunteerreminder-com-schedule-update-request-schema.json",
  "title": "ScheduleUpdateRequest",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/volunteerreminder-com-openapi.yml#/components/schemas/ScheduleUpdateRequest",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "minLength": 1,
      "description": "Short label shown on the schedule list and in reminder messages, e.g. \"Sunday morning greeters\"."
    },
    "job_name": {
      "type": "string",
      "minLength": 1,
      "description": "The role/task volunteers are reminded about. Matched case-insensitively against this account's existing jobs and created if new."
    },
    "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)."
    },
    "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": "integer",
      "minimum": 1,
      "maximum": 5,
      "description": "Which occurrence of the weekday in the month (1st through 5th). Used by 'monthly_nth' / 'bimonthly_nth'; defaults to 1."
    },
    "day_of_month": {
      "type": "integer",
      "minimum": 1,
      "maximum": 31,
      "description": "Fixed day of the month. Used by 'monthly_fixed' / 'bimonthly_fixed'; defaults to 1. Clamped to the last day of shorter months (e.g. 31 in February becomes the 28th/29th)."
    },
    "start_month": {
      "type": "integer",
      "minimum": 1,
      "maximum": 12,
      "description": "Anchor month (1=January .. 12=December) the every-other-month cadence steps from. Used by 'bimonthly_fixed' / 'bimonthly_nth'; defaults to the account's current month."
    },
    "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."
    },
    "notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "Free-text internal notes."
    },
    "confirm_remove": {
      "type": "boolean",
      "description": "Set true, together with `confirm_token`, to apply an edit that removes upcoming shifts (e.g. a new start_month or fewer weekdays). Without both, such an edit saves nothing and answers 409 `confirm_remove_required` listing the shifts; resend only once the user has agreed to drop them."
    },
    "confirm_token": {
      "type": "string",
      "description": "The `confirm_token` from the 409 `confirm_remove_required` for this same edit. It only matches while the edit and the shifts it removes are unchanged; otherwise you get a fresh 409 to review."
    }
  }
}