---
title: "Update rotation"
method: PATCH
path: "/api/{cloudId}/v1/schedules/{scheduleId}/rotations/{id}"
tags: ["Schedule rotations"]
---

# Update rotation

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

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

## Path parameters

- `scheduleId` string, required
- `id` string, required

## Request body

- UpdateRotationRequest
  - `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[] — 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.

- Rotation
  - `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 rotation.
- `404` — Returned if the schedule or rotation is not found.
- `409` — Returned if there exists another rotation 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)
