Rotation Schedules

Update rotation schedule

Changed on

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.

patch/rotationschedules/{id}

Request

  • Base URL
    https://api.getmaintainx.com/v1
  • Auth
    HTTP bearer

Path parameters

idinteger required

ID of the rotation schedule

Query parameters

skipWebhookboolean

Set skipWebhook=true, skipWebhook=1 or skipWebhook=yes to skip all webhooks upon successful operation on the endpoint. Learn more about webhooks

Request body

namestring
startDatestring 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.

Example request

{
  "name": "Team A - 4 on / 3 off",
  "startDate": "2022-01-01T00:00:00.000Z",
  "days": [
    {
      "dayType": "WORKING",
      "seconds": 28800
    }
  ],
  "users": {
    "addedIds": [
      123,
      456
    ],
    "removedIds": [
      789
    ]
  }
}

Response

Successfully updated rotation schedule

Example response

{
  "rotationSchedule": {
    "id": 963,
    "organizationId": 1,
    "name": "Team A - 4 on / 3 off",
    "startDate": "2022-01-01T00:00:00.000Z",
    "days": [
      {
        "dayType": "WORKING",
        "seconds": 28800
      }
    ],
    "sourceTemplatePattern": "pitman",
    "assignedUsersCount": 3,
    "createdAt": "2022-01-01T00:00:00.000Z",
    "updatedAt": "2022-01-01T00:00:00.000Z",
    "archivedAt": "2022-01-01T00:00:00.000Z"
  }
}

Changes