Create an on-call calendar rotation

Creates an on-call rotation. This creates consecutive on-call events for specified users, rotating through them until reaching the end date. This only creates events that end after 0:00 UTC today and removes any existing non-override events within this range.

POST https://uptime.betterstack.com/api/v2/on-calls/{calendar_id}/rotation

URL parameters

calendar_id
required string

Headers

Authorization
required string

Body parameters

users
required array
rotation_length
required number
rotation_period
required string
start_rotations_at
required date
end_rotations_at
required date
200

Response body

{
  "rotation_length": 8,
  "rotation_interval": "hour",
  "start_rotations_at": "2025-02-01T07:00:00.000Z",
  "end_rotations_at": "2027-02-01T07:00:00.000Z",
  "users": [
    "bob@betterstack.com",
    "alice@betterstack.com"
  ]
}

Example cURL

Example
curl --request POST \
  --url "https://uptime.betterstack.com/api/v2/on-calls/default/rotation" \
  --header 'Authorization: Bearer $TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"users": ["bob@betterstack.com", "alice@betterstack.com"], "rotation_length": 8, "rotation_interval": "hour", "start_rotations_at": "2025-02-01T07:00:00Z", "end_rotations_at": "2027-02-01T07:00:00Z"}'