Replace on-call events

Replace every shift from today on with the events you send. Past events and all overrides, past and future, are kept. A schedule synced from an external calendar can't be replaced.

Manage on-call with a rotation

Replacing shifts removes the schedule's rotation configuration. Set up each schedule either with its rotation or with this bulk replace, never both. Set up a rotation with Terraform or Replace an on-call schedule rotation.

PUT https://incidents.betterstack.com/api/v3/on-call-schedules/{id}/events

URL parameters

id
required string

Query parameters

team_id
string

Headers

Authorization
required string
Content-Type
string

Body parameters

events
required array of objects
events[].users
array of strings
events[].starts_at
datetime
events[].ends_at
datetime
events[].override
boolean
last_start_at
datetime
200

Response body

{
  "events": [
    {
      "id": "12345",
      "users": [
        "tomas@example.com"
      ],
      "starts_at": "2027-01-04T22:00:00Z",
      "ends_at": "2027-01-05T22:00:00Z",
      "override": false
    }
  ]
}
401

Response body

{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}
403

Response body

{
  "errors": "This API token is read-only and cannot be used for write operations."
}
404
422

Response body

{
  "errors": "This schedule is synced from an external calendar. Edit the event in that calendar to change who's on-call."
}
422

Response body

{
  "errors": "Sorry, these attributes have unsupported values",
  "allowed_values": {
    "event": {
      "starts_at": [
        "must be today at 00:00 UTC or later"
      ]
    }
  }
}

Response attributes

events
array
events[].id
string
events[].users
array of strings
events[].starts_at
datetime
events[].ends_at
datetime
events[].override
boolean

Example cURL

Replace on-call events
curl --request PUT \
  --url https://incidents.betterstack.com/api/v3/on-call-schedules/default/events \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "events": [
    {
      "users": [
        "tomas@example.com"
      ],
      "starts_at": "2027-01-04T22:00:00Z",
      "ends_at": "2027-01-05T22:00:00Z"
    },
    {
      "users": [
        "simon@example.com"
      ],
      "starts_at": "2027-01-05T22:00:00Z",
      "ends_at": "2027-01-06T22:00:00Z"
    },
    {
      "users": [
        "tomas@example.com"
      ],
      "starts_at": "2027-01-06T22:00:00Z",
      "ends_at": "2027-01-07T22:00:00Z",
      "override": true
    }
  ]
}'