---
title: "Create a rotation group"
method: POST
path: "/api-public/v1/teams/{team}/rotations"
tags: ["Rotations"]
---

# Create a rotation group

`POST /api-public/v1/teams/{team}/rotations`

Create a new rotation group under the specified team, optionally including one or more shifts.

Each shift must have a duration of 90 days or less. All usernames provided must belong to the organization
and must not be stakeholder users.

The "shifttype" field must be one of: "std" (Standard), "fts" (Follow The Sun), "cstm" (Custom), "pho" (Period Hand Off).
The "mask2" and "mask3" properties are optional and are used for "cstm" and "fts" shift types.

This API may be called a maximum of 2 times per second.

## Path parameters

- `team` string, required

## Query parameters

- `skip` integer
- `count` integer

## Headers

- `X-VO-Api-Id` string, required
- `X-VO-Api-Key` string, required

## Request body

- RotationGroupCreatePayload — The payload for creating a new rotation group with optional shifts
  - `label` string, required — The name of the rotation group
  - `shifts` RotationShiftCreatePayload[] — An optional list of shifts to create within the rotation group
    - `label` string, required — The name of the shift
    - `timezone` string, required — The timezone for the shift (e.g. "America/Denver", "Asia/Calcutta")
    - `start` integer, required — The start time of the shift in epoch milliseconds
    - `duration` integer, required — The duration of the shift in days (must be 90 or less)
    - `shifttype` 'std' | 'fts' | 'cstm' | 'pho', required — The type of shift. Must be one of: std (Standard), fts (Follow The Sun), cstm (Custom), pho (Period Hand Off)
    - `mask` RotationMask, required — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `mask2` RotationMask — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `mask3` RotationMask — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `usernames` string[] — An optional list of usernames to add to this shift. Only honored when creating shifts inline via the create rotation group endpoint; it is ignored by the add shift and update shift endpoints (use the shift members endpoint to manage members there).

## Response `200`

The created rotation group with its shifts and on-call period details

- RotationGroupResponse — The created rotation group with its shifts
  - `orgslug` string — The organization slug
  - `teamslug` string — The team slug
  - `id` integer — The rotation group ID
  - `label` string — The name of the rotation group
  - `shifts` RotationShiftResource[] — The list of shifts in this rotation group
    - `org_slug` string
    - `team_slug` string
    - `rot_id` integer — The shift/rotation ID
    - `group_id` integer — The parent rotation group ID
    - `label` string — The name of the shift
    - `timezone` string — The timezone of the shift
    - `start` integer — The start time of the shift in epoch milliseconds
    - `duration` integer — The duration of the shift in days
    - `shifttype` 'std' | 'fts' | 'cstm' | 'pho' — The type of shift: std, fts, cstm, or pho
    - `mask` RotationMask — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `mask2` RotationMask — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `mask3` RotationMask — A definition of the time range and days of the week that the rotation has on-call periods
      - `day` object
        - `su` boolean
        - `m` boolean
        - `t` boolean
        - `w` boolean
        - `th` boolean
        - `f` boolean
        - `sa` boolean
      - `time` MaskTimeRange[]
        - `start` object
          - `hour` number
          - `minute` number
        - `end` object
          - `hour` number
          - `minute` number
    - `periods` RotationShiftPeriod[] — On-call periods for this shift
      - `start` integer — Start time of the period in epoch milliseconds
      - `end` integer — End time of the period in epoch milliseconds
      - `username` string — The username of the on-call user for this period
      - `isRoll` boolean — Whether this period represents a roll/handoff
      - `memberSlug` string — The slug identifier of the member
    - `oncall` string — The username of the currently on-call user
    - `current` RotationShiftPeriod — An on-call period within a shift
      - `start` integer — Start time of the period in epoch milliseconds
      - `end` integer — End time of the period in epoch milliseconds
      - `username` string — The username of the on-call user for this period
      - `isRoll` boolean — Whether this period represents a roll/handoff
      - `memberSlug` string — The slug identifier of the member
    - `next` RotationShiftPeriod — An on-call period within a shift
      - `start` integer — Start time of the period in epoch milliseconds
      - `end` integer — End time of the period in epoch milliseconds
      - `username` string — The username of the on-call user for this period
      - `isRoll` boolean — Whether this period represents a roll/handoff
      - `memberSlug` string — The slug identifier of the member
    - `usernames` string[] — Usernames of the members in this shift
    - `shiftMembers` ShiftMember[] — The members of this shift
      - `slug` string
      - `username` string

## Other responses

- `400` — Problem with the request arguments. The response payload may include an error message.
- `401` — Authentication parameters missing
- `403` — Authentication failed or rate-limit reached
- `404` — Path not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/victorops/apis/victorops-api.md) · [All operations](https://skmtc.net/victorops/apis/victorops-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/victorops/victorops-api/revisions/7a7391256058/schema)
