---
title: "Update a schedule"
method: PATCH
path: "/api/unstable/fleet/schedules/{id}"
tags: ["Fleet Automation"]
---

# Update a schedule

`PATCH /api/unstable/fleet/schedules/{id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/unstable/fleet/schedules/{id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Partially update a schedule by providing only the fields you want to change.

This endpoint allows you to modify specific attributes of a schedule without
affecting other fields. Common use cases include:
- Changing the schedule status between active and inactive
- Updating the maintenance window times
- Modifying the filter query to target different hosts
- Adjusting the version strategy

Only include the fields you want to update in the request body. All fields
are optional in a PATCH request.

## Path parameters

- `id` string, required

## Request body

- FleetSchedulePatchRequest: Request payload for partially updating a schedule.
  - `data` FleetSchedulePatch, required: Data for partially updating a schedule.
    - `attributes` FleetSchedulePatchAttributes: Attributes for partially updating a schedule. All fields are optional.
      - `name` string: Human-readable name for the schedule.
      - `query` string: Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax.
      - `rule` FleetScheduleRecurrenceRule: Defines the recurrence pattern for the schedule. Specifies when deployments should be automatically triggered based on maintenance windows.
        - `days_of_week` string[], required: List of days of the week when the schedule should trigger. Valid values are: "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun".
        - `maintenance_window_duration` integer, required: Duration of the maintenance window in minutes.
        - `start_maintenance_window` string, required: Start time of the maintenance window in 24-hour clock format (HH:MM). Deployments will be triggered at this time on the specified days.
        - `timezone` string, required: Timezone for the schedule in IANA Time Zone Database format (e.g., "America/New_York", "UTC").
      - `status` 'active' | 'inactive': The status of the schedule. - `active`: The schedule is active and will create deployments according to its recurrence rule. - `inactive`: The schedule is inactive and will not create any deployments.
      - `version_to_latest` integer: Number of major versions behind the latest to target for upgrades. - 0: Always upgrade to the latest version - 1: Upgrade to latest minus 1 major version - 2: Upgrade to latest minus 2 major versions Maximum value is 2.
    - `type` 'schedule', required: The type of schedule resource.

## Response `200`

OK

- FleetScheduleResponse: Response containing a single schedule.
  - `data` FleetSchedule: A schedule that automatically creates deployments based on a recurrence rule.
    - `attributes` FleetScheduleAttributes, required: Attributes of a schedule in the response.
      - `created_at_unix` integer: Unix timestamp (seconds since epoch) when the schedule was created.
      - `created_by` string: User handle of the person who created the schedule.
      - `name` string: Human-readable name for the schedule.
      - `query` string: Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax.
      - `rule` FleetScheduleRecurrenceRule: Defines the recurrence pattern for the schedule. Specifies when deployments should be automatically triggered based on maintenance windows.
        - `days_of_week` string[], required: List of days of the week when the schedule should trigger. Valid values are: "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun".
        - `maintenance_window_duration` integer, required: Duration of the maintenance window in minutes.
        - `start_maintenance_window` string, required: Start time of the maintenance window in 24-hour clock format (HH:MM). Deployments will be triggered at this time on the specified days.
        - `timezone` string, required: Timezone for the schedule in IANA Time Zone Database format (e.g., "America/New_York", "UTC").
      - `status` 'active' | 'inactive': The status of the schedule. - `active`: The schedule is active and will create deployments according to its recurrence rule. - `inactive`: The schedule is inactive and will not create any deployments.
      - `updated_at_unix` integer: Unix timestamp (seconds since epoch) when the schedule was last updated.
      - `updated_by` string: User handle of the person who last updated the schedule.
      - `version_to_latest` integer: Number of major versions behind the latest to target for upgrades. - 0: Always upgrade to the latest version - 1: Upgrade to latest minus 1 major version - 2: Upgrade to latest minus 2 major versions Maximum value is 2.
    - `id` string, required: Unique identifier for the schedule.
    - `type` 'schedule', required: The type of schedule resource.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
