Request coverage
curl --request POST \
--url https://api.shiftkeeper.io/user/coverage_requests/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"schedule_ids": [
"sch_KR5uoK0xD0rWQoKTDqwgu",
"sch_ldYmnBVr5o2ikebwmRRZv"
]
}
'import requests
url = "https://api.shiftkeeper.io/user/coverage_requests/"
payload = {
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"schedule_ids": ["sch_KR5uoK0xD0rWQoKTDqwgu", "sch_ldYmnBVr5o2ikebwmRRZv"]
}
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: '2024-12-01T00:00:00Z',
end: '2024-12-08T00:00:00Z',
reason: 'I will be out of office during this week. Could someone jump in to cover these shifts?',
schedule_ids: ['sch_KR5uoK0xD0rWQoKTDqwgu', 'sch_ldYmnBVr5o2ikebwmRRZv']
})
};
fetch('https://api.shiftkeeper.io/user/coverage_requests/', 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/user/coverage_requests/",
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' => '2024-12-01T00:00:00Z',
'end' => '2024-12-08T00:00:00Z',
'reason' => 'I will be out of office during this week. Could someone jump in to cover these shifts?',
'schedule_ids' => [
'sch_KR5uoK0xD0rWQoKTDqwgu',
'sch_ldYmnBVr5o2ikebwmRRZv'
]
]),
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/user/coverage_requests/"
payload := strings.NewReader("{\n \"start\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\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/user/coverage_requests/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shiftkeeper.io/user/coverage_requests/")
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\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"coverage_request": {
"id": "cov_RxQottluZ1oeM47nz4bVl",
"user": {
"id": "usr_bq7CmsOKLmkMeZkUUu1hy",
"name": "Rick",
"email": "rick@example.org",
"time_zone": "Europe/Paris",
"role": "owner",
"seat": "member",
"slack_id": "U082KENSEQ3"
},
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"status": "pending",
"shifts": [
{
"start": "2024-12-02T09:00:00Z",
"end": "2024-12-02T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-03T09:00:00Z",
"end": "2024-12-03T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-04T09:00:00Z",
"end": "2024-12-04T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-05T09:00:00Z",
"end": "2024-12-05T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-06T09:00:00Z",
"end": "2024-12-06T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"schedule_reference": {
"id": "sch_ldYmnBVr5o2ikebwmRRZv",
"name": "Citadel"
}
}
]
}
}{
"error": {
"code": "too_many_shifts_in_coverage_request",
"message": "A coverage request can have a maximum of 500 shifts. Please select a shorter period for your coverage request.",
"status": 422,
"docs_url": "https://docs.shiftkeeper.io/api-reference/errors#too-many-shifts-in-coverage-request"
}
}Coverage
Request coverage
Create a new coverage request for the authenticated user.
POST
/
user
/
coverage_requests
/
Request coverage
curl --request POST \
--url https://api.shiftkeeper.io/user/coverage_requests/ \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"schedule_ids": [
"sch_KR5uoK0xD0rWQoKTDqwgu",
"sch_ldYmnBVr5o2ikebwmRRZv"
]
}
'import requests
url = "https://api.shiftkeeper.io/user/coverage_requests/"
payload = {
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"schedule_ids": ["sch_KR5uoK0xD0rWQoKTDqwgu", "sch_ldYmnBVr5o2ikebwmRRZv"]
}
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: '2024-12-01T00:00:00Z',
end: '2024-12-08T00:00:00Z',
reason: 'I will be out of office during this week. Could someone jump in to cover these shifts?',
schedule_ids: ['sch_KR5uoK0xD0rWQoKTDqwgu', 'sch_ldYmnBVr5o2ikebwmRRZv']
})
};
fetch('https://api.shiftkeeper.io/user/coverage_requests/', 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/user/coverage_requests/",
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' => '2024-12-01T00:00:00Z',
'end' => '2024-12-08T00:00:00Z',
'reason' => 'I will be out of office during this week. Could someone jump in to cover these shifts?',
'schedule_ids' => [
'sch_KR5uoK0xD0rWQoKTDqwgu',
'sch_ldYmnBVr5o2ikebwmRRZv'
]
]),
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/user/coverage_requests/"
payload := strings.NewReader("{\n \"start\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\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/user/coverage_requests/")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"start\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shiftkeeper.io/user/coverage_requests/")
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\": \"2024-12-01T00:00:00Z\",\n \"end\": \"2024-12-08T00:00:00Z\",\n \"reason\": \"I will be out of office during this week. Could someone jump in to cover these shifts?\",\n \"schedule_ids\": [\n \"sch_KR5uoK0xD0rWQoKTDqwgu\",\n \"sch_ldYmnBVr5o2ikebwmRRZv\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"coverage_request": {
"id": "cov_RxQottluZ1oeM47nz4bVl",
"user": {
"id": "usr_bq7CmsOKLmkMeZkUUu1hy",
"name": "Rick",
"email": "rick@example.org",
"time_zone": "Europe/Paris",
"role": "owner",
"seat": "member",
"slack_id": "U082KENSEQ3"
},
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"status": "pending",
"shifts": [
{
"start": "2024-12-02T09:00:00Z",
"end": "2024-12-02T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-03T09:00:00Z",
"end": "2024-12-03T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-04T09:00:00Z",
"end": "2024-12-04T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-05T09:00:00Z",
"end": "2024-12-05T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-06T09:00:00Z",
"end": "2024-12-06T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"schedule_reference": {
"id": "sch_ldYmnBVr5o2ikebwmRRZv",
"name": "Citadel"
}
}
]
}
}{
"error": {
"code": "too_many_shifts_in_coverage_request",
"message": "A coverage request can have a maximum of 500 shifts. Please select a shorter period for your coverage request.",
"status": 422,
"docs_url": "https://docs.shiftkeeper.io/api-reference/errors#too-many-shifts-in-coverage-request"
}
}Authorizations
Enter your API key which starts with 'keeper_'
Body
application/json
The start date and time of the interval you need coverage for.
The end date and time of the interval you need coverage for.
The reason you need coverage.
Required string length:
1 - 300You can optionally limit the coverage request to specific schedules. If not provided, the coverage request will include all schedules you are a member of.
Response
Default Response
Show child attributes
Show child attributes
Example:
{
"id": "cov_RxQottluZ1oeM47nz4bVl",
"user": {
"id": "usr_bq7CmsOKLmkMeZkUUu1hy",
"name": "Rick",
"email": "rick@example.org",
"time_zone": "Europe/Paris",
"role": "owner",
"seat": "member",
"slack_id": "U082KENSEQ3"
},
"reason": "I will be out of office during this week. Could someone jump in to cover these shifts?",
"status": "pending",
"shifts": [
{
"start": "2024-12-02T09:00:00Z",
"end": "2024-12-02T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-03T09:00:00Z",
"end": "2024-12-03T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-04T09:00:00Z",
"end": "2024-12-04T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-05T09:00:00Z",
"end": "2024-12-05T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-06T09:00:00Z",
"end": "2024-12-06T17:00:00Z",
"schedule_reference": {
"id": "sch_KR5uoK0xD0rWQoKTDqwgu",
"name": "Portal support"
}
},
{
"start": "2024-12-01T00:00:00Z",
"end": "2024-12-08T00:00:00Z",
"schedule_reference": {
"id": "sch_ldYmnBVr5o2ikebwmRRZv",
"name": "Citadel"
}
}
]
}