Rotation Schedules

Create rotation schedule

Changed on

Creates a custom work rotation. Assigning users removes them from any rotation they are currently assigned to. A rotation can only be created as the default in an organization with no saved default.

post/rotationschedules

Request

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

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

Headers

x-organization-idinteger

Required if using a multi organizations token

Request body

namestring required
startDatestring 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. The value is converted to UTC before storage, send in UTC T00:00:00.000Z to pin an exact day.

userIdsinteger[] required

Users to assign to this rotation. Each user is removed from whatever rotation they are currently on.

isDefaultboolean

Whether this is the organization's default rotation, applied to every user without a rotation of their own. This can only be true when the organization has no saved default and is using its virtual default.

Example request

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

Response

Successfully created rotation schedule

idinteger 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.

Example response

{
  "id": 963
}

Changes