Update
Update a schedule override, moving its window or the rotation and layer it sits on.
An override cannot be reassigned: send the user it already has, and delete and recreate it to put someone else on call for that window.
Overrides on a layer cannot overlap, so widening one over its neighbour’s window takes that time over. The neighbour is deleted, and any of its time left outside the new window comes back as new overrides with new IDs, so other override IDs on this layer may stop resolving — list the schedule’s overrides again to pick up the replacements.
curl --request PUT \
--url https://api.incident.io/v2/schedule_overrides/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_at": "2021-08-17T14:00:00.000000Z",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:00:00.000000Z",
"user": {
"email": "bob@example.com",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"slack_user_id": "USER123"
}
}
'import requests
url = "https://api.incident.io/v2/schedule_overrides/{id}"
payload = {
"end_at": "2021-08-17T14:00:00.000000Z",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:00:00.000000Z",
"user": {
"email": "bob@example.com",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"slack_user_id": "USER123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_at: '2021-08-17T14:00:00.000000Z',
layer_id: '01G0J1EXE7AXZ2C93K61WBPYNH',
rotation_id: '01G0J1EXE7AXZ2C93K61WBPYEH',
start_at: '2021-08-17T13:00:00.000000Z',
user: {
email: 'bob@example.com',
id: '01G0J1EXE7AXZ2C93K61WBPYEH',
slack_user_id: 'USER123'
}
})
};
fetch('https://api.incident.io/v2/schedule_overrides/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/schedule_overrides/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'end_at' => '2021-08-17T14:00:00.000000Z',
'layer_id' => '01G0J1EXE7AXZ2C93K61WBPYNH',
'rotation_id' => '01G0J1EXE7AXZ2C93K61WBPYEH',
'start_at' => '2021-08-17T13:00:00.000000Z',
'user' => [
'email' => 'bob@example.com',
'id' => '01G0J1EXE7AXZ2C93K61WBPYEH',
'slack_user_id' => 'USER123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/schedule_overrides/{id}"
payload := strings.NewReader("{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.incident.io/v2/schedule_overrides/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedule_overrides/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"override": {
"created_at": "2021-08-17T13:28:57.801578Z",
"end_at": "2021-08-17T13:28:57.801578Z",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"schedule_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"updated_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
}schedule_overrides.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The override ID to update
"01FDAG4SAP5TYPT98WGR2N7W91"
Body
End time of the override
"2021-08-17T14:00:00.000000Z"
The layer this override applies to
"01G0J1EXE7AXZ2C93K61WBPYNH"
The rotation this override applies to
"01G0J1EXE7AXZ2C93K61WBPYEH"
Start time of the override
"2021-08-17T13:00:00.000000Z"
Show child attributes
Show child attributes
{
"email": "bob@example.com",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"slack_user_id": "USER123"
}
Response
OK response.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PUT \
--url https://api.incident.io/v2/schedule_overrides/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"end_at": "2021-08-17T14:00:00.000000Z",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:00:00.000000Z",
"user": {
"email": "bob@example.com",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"slack_user_id": "USER123"
}
}
'import requests
url = "https://api.incident.io/v2/schedule_overrides/{id}"
payload = {
"end_at": "2021-08-17T14:00:00.000000Z",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:00:00.000000Z",
"user": {
"email": "bob@example.com",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"slack_user_id": "USER123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
end_at: '2021-08-17T14:00:00.000000Z',
layer_id: '01G0J1EXE7AXZ2C93K61WBPYNH',
rotation_id: '01G0J1EXE7AXZ2C93K61WBPYEH',
start_at: '2021-08-17T13:00:00.000000Z',
user: {
email: 'bob@example.com',
id: '01G0J1EXE7AXZ2C93K61WBPYEH',
slack_user_id: 'USER123'
}
})
};
fetch('https://api.incident.io/v2/schedule_overrides/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/schedule_overrides/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'end_at' => '2021-08-17T14:00:00.000000Z',
'layer_id' => '01G0J1EXE7AXZ2C93K61WBPYNH',
'rotation_id' => '01G0J1EXE7AXZ2C93K61WBPYEH',
'start_at' => '2021-08-17T13:00:00.000000Z',
'user' => [
'email' => 'bob@example.com',
'id' => '01G0J1EXE7AXZ2C93K61WBPYEH',
'slack_user_id' => 'USER123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/schedule_overrides/{id}"
payload := strings.NewReader("{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.incident.io/v2/schedule_overrides/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedule_overrides/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"end_at\": \"2021-08-17T14:00:00.000000Z\",\n \"layer_id\": \"01G0J1EXE7AXZ2C93K61WBPYNH\",\n \"rotation_id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"start_at\": \"2021-08-17T13:00:00.000000Z\",\n \"user\": {\n \"email\": \"bob@example.com\",\n \"id\": \"01G0J1EXE7AXZ2C93K61WBPYEH\",\n \"slack_user_id\": \"USER123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"override": {
"created_at": "2021-08-17T13:28:57.801578Z",
"end_at": "2021-08-17T13:28:57.801578Z",
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"schedule_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"updated_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
}