List
List configured schedules.
GET
/
v2
/
schedules
List
curl --request GET \
--url https://api.incident.io/v2/schedules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/schedules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/schedules', 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/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/schedules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/schedules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pagination_meta": {
"after": "01FCNDV6P870EA6S7TK1DSYDG0",
"page_size": 25,
"total_record_count": 238
},
"schedules": [
{
"annotations": {
"incident.io/terraform/version": "3.0.0"
},
"config": {
"rotations": [
{
"effective_from": "2021-08-17T13:28:57.801578Z",
"handover_start_at": "2021-08-17T13:28:57.801578Z",
"handovers": [
{
"interval": 1,
"interval_type": "hourly"
}
],
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layers": [
{
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Layer 1"
}
],
"name": "Primary On-Call Schedule",
"scheduling_mode": "fair",
"users": [
{
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
],
"working_interval": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
],
"working_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
},
"created_at": "2021-08-17T13:28:57.801578Z",
"current_shifts": [
{
"end_at": "2021-08-17T13:28:57.801578Z",
"entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
],
"holidays_public_config": {
"country_codes": [
"GB",
"FR"
]
},
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary On-Call Schedule",
"next_shifts": [
{
"end_at": "2021-08-17T13:28:57.801578Z",
"entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
],
"team_ids": [
"01JPQA75EPNEES4479P16P4XAB"
],
"timezone": "Europe/London",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
]
}🔑 Requires the
schedules.view scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Query Parameters
Note that next_shifts will only be returned when the page size is 25 or lower.
Required range:
x <= 10000Example:
25
A schedule's ID. This endpoint will return a list of schedules after this ID in relation to the API response order.
Example:
"01FDAG4SAP5TYPT98WGR2N7W91"
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Example:
[ { "annotations": { "incident.io/terraform/version": "3.0.0" }, "config": { "rotations": [ { "effective_from": "2021-08-17T13:28:57.801578Z", "handover_start_at": "2021-08-17T13:28:57.801578Z", "handovers": [ { "interval": 1, "interval_type": "hourly" } ], "id": "01G0J1EXE7AXZ2C93K61WBPYEH", "layers": [ { "id": "01G0J1EXE7AXZ2C93K61WBPYEH", "name": "Layer 1" } ], "name": "Primary On-Call Schedule", "scheduling_mode": "fair", "users": [ { "email": "lisa@incident.io", "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "Lisa Karlin Curtis", "role": "owner", "slack_user_id": "U02AYNF2XJM" } ], "working_interval": [ { "end_time": "17:00", "start_time": "09:00", "weekday": "monday" } ], "working_intervals": [ { "end_time": "17:00", "start_time": "09:00", "weekday": "monday" } ] } ] }, "created_at": "2021-08-17T13:28:57.801578Z", "current_shifts": [ { "end_at": "2021-08-17T13:28:57.801578Z", "entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH", "fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH", "layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH", "rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH", "start_at": "2021-08-17T13:28:57.801578Z", "user": { "email": "lisa@incident.io", "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "Lisa Karlin Curtis", "role": "owner", "slack_user_id": "U02AYNF2XJM" } } ], "holidays_public_config": { "country_codes": ["GB", "FR"] }, "id": "01G0J1EXE7AXZ2C93K61WBPYEH", "name": "Primary On-Call Schedule", "next_shifts": [ { "end_at": "2021-08-17T13:28:57.801578Z", "entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH", "fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH", "layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH", "rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH", "start_at": "2021-08-17T13:28:57.801578Z", "user": { "email": "lisa@incident.io", "id": "01FCNDV6P870EA6S7TK1DSYDG0", "name": "Lisa Karlin Curtis", "role": "owner", "slack_user_id": "U02AYNF2XJM" } } ], "team_ids": ["01JPQA75EPNEES4479P16P4XAB"], "timezone": "Europe/London", "updated_at": "2021-08-17T13:28:57.801578Z" } ]
Show child attributes
Show child attributes
Example:
{ "after": "01FCNDV6P870EA6S7TK1DSYDG0", "page_size": 25, "total_record_count": 238 }
Was this page helpful?
⌘I
List
curl --request GET \
--url https://api.incident.io/v2/schedules \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/schedules"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/schedules', 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/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/schedules"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/schedules")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pagination_meta": {
"after": "01FCNDV6P870EA6S7TK1DSYDG0",
"page_size": 25,
"total_record_count": 238
},
"schedules": [
{
"annotations": {
"incident.io/terraform/version": "3.0.0"
},
"config": {
"rotations": [
{
"effective_from": "2021-08-17T13:28:57.801578Z",
"handover_start_at": "2021-08-17T13:28:57.801578Z",
"handovers": [
{
"interval": 1,
"interval_type": "hourly"
}
],
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layers": [
{
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Layer 1"
}
],
"name": "Primary On-Call Schedule",
"scheduling_mode": "fair",
"users": [
{
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
],
"working_interval": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
],
"working_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
},
"created_at": "2021-08-17T13:28:57.801578Z",
"current_shifts": [
{
"end_at": "2021-08-17T13:28:57.801578Z",
"entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
],
"holidays_public_config": {
"country_codes": [
"GB",
"FR"
]
},
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary On-Call Schedule",
"next_shifts": [
{
"end_at": "2021-08-17T13:28:57.801578Z",
"entry_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"fingerprint": "01G0J1EXE7AXZ2C93K61WBPYEH",
"layer_id": "01G0J1EXE7AXZ2C93K61WBPYNH",
"rotation_id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"start_at": "2021-08-17T13:28:57.801578Z",
"user": {
"email": "lisa@incident.io",
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Lisa Karlin Curtis",
"role": "owner",
"slack_user_id": "U02AYNF2XJM"
}
}
],
"team_ids": [
"01JPQA75EPNEES4479P16P4XAB"
],
"timezone": "Europe/London",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
]
}