---
title: "Update rotation schedule"
method: PATCH
path: "/rotationschedules/{id}"
tags: ["Rotation Schedules"]
---

# Update rotation schedule

`PATCH /rotationschedules/{id}`

## Request

- Base URL: `https://api.getmaintainx.com/v1`
- URL: `https://api.getmaintainx.com/v1/rotationschedules/{id}`
- Auth: HTTP bearer

Updates a custom work rotation and, optionally, who is assigned to it. Changing `days` or `startDate` re-bases the cycle for every user currently assigned to the rotation. Adding users unassigns them from whatever rotation they are currently on, and removing them returns them to the organization default rotation. `isDefault` and `sourceTemplatePattern` are fixed at creation and cannot be changed here. The organization is resolved from `{id}`, so no `x-organization-id` header is required.

## Path parameters

- `id` integer, required

## Query parameters

- `skipWebhook` boolean

## Request body

- object
  - `name` string
  - `startDate` string, date-time: First day of the rotation (ISO 8601 UTC datetime, RFC 3339 date-time format). The pattern in `days` repeats from this date. The value is converted to UTC before storage, send in UTC `T00:00:00.000Z` to pin an exact day. Moving this re-bases the cycle for every user currently assigned to the rotation.
  - `days` object[]: The repeating pattern, one entry per day of the cycle, ordered by `dayIndex`. Replaces the cycle in full rather than merging per entry, so send every day you want to keep. Changing it re-bases the cycle for every user currently assigned to the rotation.
    - `dayIndex` integer, required: Position of the day in the rotation, starting at 0 on `startDate`
    - `dayType` 'WORKING' | 'NON_WORKING', required
    - `seconds` integer, required: Seconds worked on that day. Always 0 for a `NON_WORKING` day.
  - `users` object: Assignment changes to apply alongside the field updates. Each list is de-duplicated, capped at 100 entries per request, and sending the same user id in both is rejected.
    - `addedIds` integer[]: Users to assign to this rotation. Each user is removed from whatever rotation they are currently on. A user already on this rotation is a no-op.
    - `removedIds` integer[]: Users to unassign from this rotation, returning them to the organization default rotation. Ids that are not currently assigned to this rotation are ignored, so this can never unassign a user from a different rotation.

## Response `200`

Successfully updated rotation schedule

- object
  - `rotationSchedule` object, required
    - `id` integer, required: Global ID of the rotation schedule. `0` is an alias addressing the organization's current default rotation: its saved default when it has one, otherwise the virtual default it gets until it saves one of its own. Responses always carry the canonical id, so a request against `0` can come back with a different `id`.
    - `organizationId` integer, required: ID of the organization that owns this resource
    - `name` string, required
    - `startDate` string, date-time, required: First day of the rotation (ISO 8601 UTC datetime, RFC 3339 date-time format). The pattern in `days` repeats from this date.
    - `days` object[], required: The repeating pattern, one entry per day of the cycle, ordered by `dayIndex`.
      - `dayIndex` integer, required: Position of the day in the rotation, starting at 0 on `startDate`
      - `dayType` 'WORKING' | 'NON_WORKING', required
      - `seconds` integer, required: Seconds worked on that day. Always 0 for a `NON_WORKING` day.
    - `isDefault` boolean, required: Whether this is the organization's default rotation, applied to every user without a rotation of their own.
    - `sourceTemplatePattern` string, nullable: Template pattern used to create this rotation in the UI, if one was selected
    - `assignedUsersCount` integer, required: Number of users on this rotation. For the default rotation, every schedulable user not on a rotation of their own. The users themselves are at `GET /rotationschedules/{id}/assignedusers`.
    - `createdAt` string, date-time
    - `updatedAt` string, date-time, nullable
    - `archivedAt` string, date-time, nullable: When the rotation schedule was archived, or `null` while it is active

## Other responses

- `400`: Failed to update the rotation schedule
- `401`: Invalid token
- `403`: The caller cannot edit this rotation schedule
- `404`: Could not find the specified rotation schedule.
- `500`: Internal server error.

## Changes

> 30 revisions in range; 1 not diffed.

- **2026-10-16** `08b21e946629`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/getmaintainx/apis/maintainx-api/changes/rotationschedules/:id/patch.md)

---

[API](https://skmtc.dev/getmaintainx/apis/maintainx-api.md) - [All operations](https://skmtc.dev/getmaintainx/apis/maintainx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getmaintainx/apis/maintainx-api/revisions/6258367c04ff?raw)
