Update an on-call schedule

Rename an on-call schedule or change its Slack user group. Change who is on call with its rotation.

PATCH https://incidents.betterstack.com/api/v3/on-call-schedules/{id}
id string required

ID of the on-call schedule, as List on-call schedules returns it.

team_id string

Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.

Authorization string required

Bearer $TOKEN

Content-Type string

application/json

name string or null

Schedule name. null only on a primary schedule without a name of its own. Required on create.

slack_group_handle string or null

The handle of a Slack user group that always holds whoever is on call, without the @, or null when there's none. A handle for a new group can have up to 80 characters. Slack can still refuse a handle after it's saved, and slack_groups then shows why. Accepts lowercase letters, digits, ., _ and -, or letters outside ASCII. An on-call schedule in another team can't already use it. Send null or an empty string to stop tagging who is on call.

use_existing_slack_group boolean

Whether slack_group_handle names a user group that already exists in your connected Slack workspace, instead of a new group we create. An existing group keeps its other members. A handle that one of your Slack user groups already uses is refused unless this is true, and a handle no group uses is refused when it's true. Sent without slack_group_handle, the setting applies to the current handle. Sending null or leaving it out keeps the schedule's current choice.

200 OK
{
  "data": {
    "id": "123456789",
    "type": "on_call_schedule",
    "attributes": {
      "name": "New name",
      "default_schedule": true,
      "slack_group_handle": "production-oncall",
      "use_existing_slack_group": false,
      "slack_groups": [
        {
          "slack_workspace_id": "T0123ABCD",
          "slack_workspace_name": "Better Stack",
          "status": "active",
          "error": null
        }
      ],
      "team_id": "t123",
      "team_name": "Production"
    },
    "relationships": {
      "on_call_users": {
        "data": [
          {
            "id": "u2345",
            "type": "user"
          }
        ]
      }
    }
  }
}

Returns the updated on-call schedule.

id string

The ID of the on-call schedule.

type string

Always on_call_schedule.

name string or null

Schedule name. null only on a primary schedule without a name of its own.

default_schedule boolean

Whether this is your team's default on-call schedule.

slack_group_handle string or null

The handle of a Slack user group that always holds whoever is on call, without the @, or null when there's none. A handle for a new group can have up to 80 characters. Slack can still refuse a handle after it's saved, and slack_groups then shows why.

use_existing_slack_group boolean

Whether slack_group_handle names a user group that already exists in your connected Slack workspace, instead of a new group we create. An existing group keeps its other members. A handle that one of your Slack user groups already uses is refused unless this is true, and a handle no group uses is refused when it's true. Sent without slack_group_handle, the setting applies to the current handle.

slack_groups array of objects

The state of the handle's user group in each connected Slack workspace.

slack_groups[].slack_workspace_id string

ID of the Slack workspace.

slack_groups[].slack_workspace_name string

Name of the Slack workspace.

slack_groups[].status string

The group's state in the workspace. When the group doesn't follow who's on call, error says why.
Valid values:
pending: The group is being set up.
active: The group follows who's on call.
permission_denied: The Slack workspace lets only admins manage user groups.
plan_required: User groups need a paid Slack plan.
name_conflict: Another Slack user group already uses the handle.
failed: The group couldn't be synced with Slack.
no_slack_users: Nobody on call has connected Slack, so the group tags nobody from this schedule.
reinstall_required: The Slack integration was connected before user groups were supported. Reinstall the integration to set the group up.

slack_groups[].error string or null

What's wrong and what to do about it. null when status is active or pending.

slack_groups[].unconnected_users array of objects

The on-call users the group doesn't include. Present only when you get a single schedule.

slack_groups[].unconnected_users[].id string

The user's ID as u123.

slack_groups[].unconnected_users[].first_name string or null

The user's first name, or null when it isn't set.

slack_groups[].unconnected_users[].last_name string or null

The user's last name, or null when it isn't set.

slack_groups[].unconnected_users[].email string

The user's e-mail address.

relationships.on_call_users.data array

Users on call now, or at from when you send it. Each user's entry under relationships also has a meta object with email, on_holiday and holiday_ends_at.

relationships.on_call_users.data[].id string

ID of the linked user.

relationships.on_call_users.data[].type string

Always user.

team_id string

Team that owns the schedule, such as t123.

team_name string

Name of the team that owns the schedule.

Example cURL

Update an on-call schedule
curl --request PATCH \
  --url https://incidents.betterstack.com/api/v3/on-call-schedules/56 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "name": "New name"
}'