Update an on-call schedule
Rename an on-call schedule or change its Slack user group. Change who is on call with its rotation.
ID of the on-call schedule, as List on-call schedules returns it.
Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.
Bearer $TOKEN
application/json
Schedule name. null only on a primary schedule without a name of its own. Required on create.
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.
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.
{
"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"
}
]
}
}
}
}
{
"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"
}
{
"errors": "This API token is read-only and cannot be used for write operations."
}
{
"errors": {
"name": [
"can't be blank"
]
}
}
Returns the updated on-call schedule.
The API token is missing or invalid.
The token is read-only, your role doesn't allow the action, or the token can't be used for this API.
The on-call schedule doesn't exist, or the token can't access it.
Validation failed, the request has an unknown field, or slack_group_handle or use_existing_slack_group has the wrong type.
The ID of the on-call schedule.
Always on_call_schedule.
Schedule name. null only on a primary schedule without a name of its own.
Whether this is your team's default on-call schedule.
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.
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.
The state of the handle's user group in each connected Slack workspace.
ID of the Slack workspace.
Name of the Slack workspace.
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.
What's wrong and what to do about it. null when status is active or pending.
The on-call users the group doesn't include. Present only when you get a single schedule.
The user's ID as u123.
The user's first name, or null when it isn't set.
The user's last name, or null when it isn't set.
The user's e-mail address.
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.
ID of the linked user.
Always user.
Team that owns the schedule, such as t123.
Name of the team that owns the schedule.
Example cURL