---
title: "Update schedule"
method: PATCH
path: "/api/{cloudId}/v1/schedules/{id}"
tags: ["Schedules"]
---

# Update schedule

`PATCH /api/{cloudId}/v1/schedules/{id}`

Updates the schedule with given id in the request. <br> <br> **Permissions required:** Permission to update the schedule: 
 - the user has edit configuration right. 
 - the user is the admin of the team that the schedule belongs to.

## Path parameters

- `id` string, required

## Request body

- UpdateScheduleRequest
  - `name` string — Name of the schedule.
  - `teamId` string — ID of the team that schedule belongs to. Set as empty string to change it to global schedule.
  - `description` string — Description of the schedule.
  - `timezone` string — Time zone ID of the schedule.
  - `enabled` boolean — Indicates whether the schedule is enabled or not.
  - `rotations` CreateRotationRequest[]
    - `name` string — Name of the rotation.
    - `startDate` string, date-time, required — Start time of the rotation.
    - `endDate` string, date-time — End time of the rotation.
    - `type` 'daily' | 'weekly' | 'hourly', required — Type of the rotation.
    - `length` integer — Length of the rotation based on type.
    - `participants` ResponderInfo[] — Participants of the rotation.
      - `type` 'user' | 'team' | 'escalation' | 'noone', required — Type of the responder.
      - `id` string — ID of the responder. Null if the type is `noone`.
    - `timeRestriction` union
      - TimeOfDayTimeRestrictionRequest — Time restrictions of the rotation.
        - `type` string, required — Type of the time restriction.
        - `restriction` TimeOfDayTimeRestrictionSettingsRequest
          - `startHour` integer, required — Start hour of the time restriction.
          - `endHour` integer, required — End hour of the time restriction.
          - `startMin` integer, required — Start minute of the time restriction.
          - `endMin` integer, required — End minute of the time restriction.
      - WeekdayTimeRestrictionRequest — Time restrictions of the rotation.
        - `type` string, required — Type of the time restriction.
        - `restrictions` WeekdayTimeRestrictionSettingsRequest[]
          - `startDay` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday', required — Start day of the time restriction.
          - `endDay` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday', required — End day of the time restriction.
          - `startHour` integer, required — Start hour of the time restriction.
          - `endHour` integer, required — End hour of the time restriction.
          - `startMin` integer, required — Start minute of the time restriction.
          - `endMin` integer, required — End minute of the time restriction.

## Response `200`

Returned if the request is successful.

- Schedule
  - `id` string — ID of the schedule.
  - `name` string — Name of the schedule.
  - `description` string — Description of the schedule.
  - `timezone` string — Time zone ID of the schedule.
  - `enabled` boolean — Indicates whether the schedule is enabled or not.
  - `teamId` string — ID of the team that schedule belongs to.
  - `rotations` Rotation[] — Rotation details of the schedule.
    - `id` string — ID of the rotation.
    - `name` string — Name of the rotation.
    - `startDate` string, date-time — Start time of the rotation.
    - `endDate` string, date-time — End time of the rotation.
    - `type` 'daily' | 'weekly' | 'hourly' — Type of the rotation.
    - `length` integer — Length of the rotation based on type.
    - `participants` ResponderInfo[] — List of participants of the rotation.
      - `type` 'user' | 'team' | 'escalation' | 'noone', required — Type of the responder.
      - `id` string — ID of the responder. Null if the type is `noone`.
    - `timeRestriction` union
      - TimeOfDayTimeRestriction
        - `type` string — Type of the time restriction.
        - `restriction` TimeOfDayTimeRestrictionSettings — Details of the time restriction. Returned if the type of the time restriction is `time-of-day`.
          - `startHour` integer — Start hour of the time restriction.
          - `endHour` integer — End hour of the time restriction.
          - `startMin` integer — Start minute of the time restriction.
          - `endMin` integer — End minute of the time restriction.
      - WeekdayTimeRestriction
        - `type` string — Type of the time restriction.
        - `restrictions` WeekdayTimeRestrictionSettings[] — Details of the time restriction. Returned if the type of the time restriction is `weekday-and-time-of-day`.
          - `startDay` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — Start day of the time restriction.
          - `endDay` 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' — End day of the time restriction.
          - `startHour` integer — Start hour of the time restriction.
          - `endHour` integer — End hour of the time restriction.
          - `startMin` integer — Start minute of the time restriction.
          - `endMin` integer — End minute of the time restriction.

## Other responses

- `401` — Returned if the authentication credentials are incorrect.
- `403` — Returned if the user does not have permission to update the schedule.
- `404` — Returned if the schedule is not found.
- `409` — Returned if there exists another schedule with the same name.
- `422` — Returned if the payload cannot be validated.

---

[API](https://skmtc.net/atlassian/apis/jsm-operations-api.md) · [All operations](https://skmtc.net/atlassian/apis/jsm-operations-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/jsm-operations-api/versions/ed65f017bcb8/schema)
