---
title: "Update Deployment Schedule"
method: PATCH
path: "/api/deployments/{id}/schedules/{schedule_id}"
tags: ["Deployments"]
---

# Update Deployment Schedule

`PATCH /api/deployments/{id}/schedules/{schedule_id}`

## Path parameters

- `id` string, uuid, required — The deployment id
- `schedule_id` string, uuid, required — The schedule id

## Headers

- `x-prefect-api-version` string

## Request body

- DeploymentScheduleUpdate — A base pydantic.BaseModel for all Prefect schemas and pydantic models. As the basis for most Prefect schemas, this base model usually ignores extra fields that are passed to it at instantiation. Because adding new fields to API payloads is not considered a breaking change, this ensures that any Prefect client loading data from a server running a possibly-newer version of Prefect will be able to process those new fields gracefully. However, when PREFECT_TEST_MODE is on, extra fields are forbidden in order to catch subtle unintentional testing errors.
  - `active` boolean — Whether or not the schedule is active.
  - `schedule` union — The schedule for the deployment.
    - IntervalSchedule — A schedule formed by adding `interval` increments to an `anchor_date`. If no `anchor_date` is supplied, the current UTC time is used. If a timezone-naive datetime is provided for `anchor_date`, it is assumed to be in the schedule's timezone (or UTC). Even if supplied with an IANA timezone, anchor dates are always stored as UTC offsets, so a `timezone` can be provided to determine localization behaviors like DST boundary handling. If none is provided it will be inferred from the anchor date. NOTE: If the `IntervalSchedule` `anchor_date` or `timezone` is provided in a DST-observing timezone, then the schedule will adjust itself appropriately. Intervals greater than 24 hours will follow DST conventions, while intervals of less than 24 hours will follow UTC intervals. For example, an hourly schedule will fire every UTC hour, even across DST boundaries. When clocks are set back, this will result in two runs that *appear* to both be scheduled for 1am local time, even though they are an hour apart in UTC time. For longer intervals, like a daily schedule, the interval schedule will adjust for DST boundaries so that the clock-hour remains constant. This means that a daily schedule that always fires at 9am will observe DST and continue to fire at 9am in the local time zone. Args: interval (datetime.timedelta): an interval to schedule on. anchor_date (DateTimeTZ, optional): an anchor date to schedule increments against; if not provided, the current timestamp will be used. timezone (str, optional): a valid timezone string.
      - `interval` number, required
      - `anchor_date` string, date-time
      - `timezone` string
    - CronSchedule — Cron schedule NOTE: If the timezone is a DST-observing one, then the schedule will adjust itself appropriately. Cron's rules for DST are based on schedule times, not intervals. This means that an hourly cron schedule will fire on every new schedule hour, not every elapsed hour; for example, when clocks are set back this will result in a two-hour pause as the schedule will fire *the first time* 1am is reached and *the first time* 2am is reached, 120 minutes later. Longer schedules, such as one that fires at 9am every morning, will automatically adjust for DST. Args: cron (str): a valid cron string timezone (str): a valid timezone string in IANA tzdata format (for example, America/New_York). day_or (bool, optional): Control how croniter handles `day` and `day_of_week` entries. Defaults to True, matching cron which connects those values using OR. If the switch is set to False, the values are connected using AND. This behaves like fcron and enables you to e.g. define a job that executes each 2nd friday of a month by setting the days of month and the weekday.
      - `cron` string, required
      - `timezone` string
      - `day_or` boolean — Control croniter behavior for handling day and day_of_week entries.
    - RRuleSchedule — RRule schedule, based on the iCalendar standard ([RFC 5545](https://datatracker.ietf.org/doc/html/rfc5545)) as implemented in `dateutils.rrule`. RRules are appropriate for any kind of calendar-date manipulation, including irregular intervals, repetition, exclusions, week day or day-of-month adjustments, and more. Note that as a calendar-oriented standard, `RRuleSchedules` are sensitive to to the initial timezone provided. A 9am daily schedule with a daylight saving time-aware start date will maintain a local 9am time through DST boundaries; a 9am daily schedule with a UTC start date will maintain a 9am UTC time. Args: rrule (str): a valid RRule string timezone (str, optional): a valid timezone string
      - `rrule` string, required
      - `timezone` string
  - `max_active_runs` integer — The maximum number of active runs for the schedule.
  - `max_scheduled_runs` integer — The maximum number of scheduled runs for the schedule.
  - `catchup` boolean — Whether or not a worker should catch up on Late runs for the schedule.

## Response `204`

Successful Response

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/prefecthq/apis/untitled-api-2.md) · [All operations](https://skmtc.net/prefecthq/apis/untitled-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prefecthq/untitled-api-2/revisions/29ba6c4f8837/schema)
