Get a single sync rule for a schedule.
GET
/
v2
/
schedules
/
{schedule_id}
/
sync_rules
/
{id}
Show
curl --request GET \
--url https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id}"
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/{schedule_id}/sync_rules/{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/schedules/{schedule_id}/sync_rules/{id}",
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/{schedule_id}/sync_rules/{id}"
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/{schedule_id}/sync_rules/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id}")
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{
"schedule_sync_rule": {
"created_at": "2021-08-17T13:28:57.801578Z",
"id": "01JXYZ000000000000000000CD",
"rotation_id": "01JXYZ000000000000000000RT",
"schedule_id": "01JXYZ000000000000000000EF",
"schedule_sync_target": {
"add_bot_to_group": true,
"created_at": "2021-08-17T13:28:57.801578Z",
"id": "01JXYZ000000000000000000AB",
"linked_schedules": [
{
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary On-Call Schedule",
"team_ids": [
"01JPQA75EPNEES4479P16P4XAB"
]
}
],
"slack_team_id": "T02A1AZHG3J",
"slack_user_group_id": "S06MNNU5BMK",
"updated_at": "2021-08-17T13:28:57.801578Z"
},
"schedule_sync_target_id": "01JXYZ000000000000000000AB",
"sync_type": "on_call",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The parent schedule ID
Example:
"01FDAG4SAP5TYPT98WGR2N7W91"
The sync rule ID
Example:
"01JXYZ000000000000000000CD"
Response
200 - application/json
OK response.
A sync rule links a schedule to a sync target, telling us which of the schedule's members should flow into the target's Slack user group.
sync_type decides who is synced: on_call syncs only the people currently on call, while all_users syncs everyone on the schedule. By default every rotation on the schedule is included; set rotation_id to scope the rule to a single rotation. As the schedule's shifts change hands, we keep the target's Slack user group membership in step with the rule.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Show
curl --request GET \
--url https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id}"
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/{schedule_id}/sync_rules/{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/schedules/{schedule_id}/sync_rules/{id}",
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/{schedule_id}/sync_rules/{id}"
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/{schedule_id}/sync_rules/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/schedules/{schedule_id}/sync_rules/{id}")
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{
"schedule_sync_rule": {
"created_at": "2021-08-17T13:28:57.801578Z",
"id": "01JXYZ000000000000000000CD",
"rotation_id": "01JXYZ000000000000000000RT",
"schedule_id": "01JXYZ000000000000000000EF",
"schedule_sync_target": {
"add_bot_to_group": true,
"created_at": "2021-08-17T13:28:57.801578Z",
"id": "01JXYZ000000000000000000AB",
"linked_schedules": [
{
"id": "01G0J1EXE7AXZ2C93K61WBPYEH",
"name": "Primary On-Call Schedule",
"team_ids": [
"01JPQA75EPNEES4479P16P4XAB"
]
}
],
"slack_team_id": "T02A1AZHG3J",
"slack_user_group_id": "S06MNNU5BMK",
"updated_at": "2021-08-17T13:28:57.801578Z"
},
"schedule_sync_target_id": "01JXYZ000000000000000000AB",
"sync_type": "on_call",
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}