Override a schedule shift
curl --request POST \
--url https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"user_references": [
{
"type": "email",
"value": "emma@example.org"
}
]
}
'import requests
url = "https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/"
payload = {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"user_references": [
{
"type": "email",
"value": "emma@example.org"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end: '2023-11-07T05:31:56Z',
user_references: [{type: 'email', value: 'emma@example.org'}]
})
};
fetch('https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/', 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.shiftkeeper.io/schedules/{schedule_id}/overrides/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z',
'user_references' => [
[
'type' => 'email',
'value' => 'emma@example.org'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.shiftkeeper.io/schedules/{schedule_id}/overrides/"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"override": {
"id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"users": [
{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"time_zone": "<string>",
"slack_id": "<string>"
}
]
}
}{
"error": {
"code": "not_found",
"status": 404,
"message": "The requested resource was not found"
}
}Overrides
Override a schedule shift
Create a new schedule override.
POST
/
schedules
/
{schedule_id}
/
overrides
/
Override a schedule shift
curl --request POST \
--url https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"user_references": [
{
"type": "email",
"value": "emma@example.org"
}
]
}
'import requests
url = "https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/"
payload = {
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"user_references": [
{
"type": "email",
"value": "emma@example.org"
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
start: '2023-11-07T05:31:56Z',
end: '2023-11-07T05:31:56Z',
user_references: [{type: 'email', value: 'emma@example.org'}]
})
};
fetch('https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/', 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.shiftkeeper.io/schedules/{schedule_id}/overrides/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'start' => '2023-11-07T05:31:56Z',
'end' => '2023-11-07T05:31:56Z',
'user_references' => [
[
'type' => 'email',
'value' => 'emma@example.org'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.shiftkeeper.io/schedules/{schedule_id}/overrides/"
payload := strings.NewReader("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shiftkeeper.io/schedules/{schedule_id}/overrides/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"start\": \"2023-11-07T05:31:56Z\",\n \"end\": \"2023-11-07T05:31:56Z\",\n \"user_references\": [\n {\n \"type\": \"email\",\n \"value\": \"emma@example.org\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"override": {
"id": "<string>",
"start": "2023-11-07T05:31:56Z",
"end": "2023-11-07T05:31:56Z",
"users": [
{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"time_zone": "<string>",
"slack_id": "<string>"
}
]
}
}{
"error": {
"code": "not_found",
"status": 404,
"message": "The requested resource was not found"
}
}Authorizations
Enter your API key which starts with 'keeper_'
Path Parameters
The ID of the schedule.
Body
application/json
The start date and time of the override. ISO 8601 format, UTC timezone.
The end date and time of the override. ISO 8601 format, UTC timezone.
The users that that will be on-call during the override.
Required array length:
1 - 4 elements- Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Example:
{ "type": "email", "value": "emma@example.org" }
Response
Default Response
Show child attributes
Show child attributes
Example:
{ "id": "ovr_i9fo8GI1YBAQhtoArC3N1", "start": "2024-12-01T00:00:00Z", "end": "2024-12-08T00:00:00Z", "users": [ { "id": "usr_C0GwCFdk0I4pBMRny4qYV", "name": "Dena", "email": "dena@example.org", "role": "standard", "seat": "member", "slack_id": "U082GMAFR1T" } ] }
⌘I