Update a particular escalation path template.
PUT
/
v2
/
escalation_path_templates
/
{id}
Update
curl --request PUT \
--url https://api.incident.io/v2/escalation_path_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Pages the team on-call, then a fallback user",
"expressions": [
{
"else_branch": {
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"cast": {
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"concatenate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
]
},
"navigate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"operation_type": "navigate",
"parse": {
"returns": {
"array": true,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
],
"name": "Team on-call",
"params": [
{
"allowed_value_types": [
"literal"
],
"array": true,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": true,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": {
"escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
],
"else_path": [
{}
],
"then_path": [
{}
]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": false,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": false,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
'import requests
url = "https://api.incident.io/v2/escalation_path_templates/{id}"
payload = {
"description": "Pages the team on-call, then a fallback user",
"expressions": [
{
"else_branch": { "result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [{ "conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
] }],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": True,
"type": "IncidentStatus"
}
},
"cast": { "returns": {
"array": True,
"type": "IncidentStatus"
} },
"concatenate": { "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]" },
"filter": { "condition_groups": [{ "conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
] }] },
"navigate": { "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]" },
"operation_type": "navigate",
"parse": {
"returns": {
"array": True,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
],
"name": "Team on-call",
"params": [
{
"allowed_value_types": ["literal"],
"array": True,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": True,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": { "escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0" },
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
],
"else_path": [{}],
"then_path": [{}]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": False,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": False,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
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({
description: 'Pages the team on-call, then a fallback user',
expressions: [
{
else_branch: {
result: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
label: 'Team Slack channel',
operations: [
{
branches: {
branches: [
{
condition_groups: [
{
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
]
}
],
result: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
],
returns: {array: true, type: 'IncidentStatus'}
},
cast: {returns: {array: true, type: 'IncidentStatus'}},
concatenate: {reference: 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'},
filter: {
condition_groups: [
{
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
]
}
]
},
navigate: {reference: 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'},
operation_type: 'navigate',
parse: {
returns: {array: true, type: 'IncidentStatus'},
source: 'metadata.annotations["github.com/repo"]'
}
}
],
reference: 'abc123',
root_reference: 'incident.status'
}
],
name: 'Team on-call',
params: [
{
allowed_value_types: ['literal'],
array: true,
default_value: {
array_value: [{label: 'Lawrence Jones', literal: 'SEV123', reference: 'incident.severity'}],
value: {label: 'Lawrence Jones', literal: 'SEV123', reference: 'incident.severity'}
},
description: 'What slack channel should we send the message to?',
label: 'To date',
name: 'severity',
optional: true,
type: 'IncidentSeverity'
}
],
path: [
{
delay: {
delay_interval_condition: 'active',
delay_seconds: 300,
delay_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
escalation_path: {escalation_path_id: '01FCNDV6P870EA6S7TK1DSYDG0'},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
if_else: {
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
],
else_path: [{}],
then_path: [{}]
},
level: {
ack_mode: 'all',
retry_config: {attempts: 3, interval_seconds: 300},
round_robin_config: {enabled: false, rotate_after_seconds: 120},
targets: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
],
time_to_ack_interval_condition: 'active',
time_to_ack_seconds: 1800,
time_to_ack_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
notify_channel: {
targets: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
],
time_to_ack_interval_condition: 'active',
time_to_ack_seconds: 1800,
time_to_ack_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
repeat: {repeat_times: 3, to_node: '01FCNDV6P870EA6S7TK1DSYDG0'},
type: 'if_else'
}
],
repeat_config: {delay_repeat_on_activity: false, repeat_after_seconds: 1800},
working_hours: [
{
id: 'abc123',
name: 'abc123',
timezone: 'abc123',
weekday_intervals: [{end_time: '17:00', start_time: '09:00', weekday: 'monday'}]
}
]
})
};
fetch('https://api.incident.io/v2/escalation_path_templates/{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/escalation_path_templates/{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([
'description' => 'Pages the team on-call, then a fallback user',
'expressions' => [
[
'else_branch' => [
'result' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'label' => 'Team Slack channel',
'operations' => [
[
'branches' => [
'branches' => [
[
'condition_groups' => [
[
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
]
]
],
'result' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
],
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
]
],
'cast' => [
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
]
],
'concatenate' => [
'reference' => 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'
],
'filter' => [
'condition_groups' => [
[
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
]
]
]
],
'navigate' => [
'reference' => 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'
],
'operation_type' => 'navigate',
'parse' => [
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
],
'source' => 'metadata.annotations["github.com/repo"]'
]
]
],
'reference' => 'abc123',
'root_reference' => 'incident.status'
]
],
'name' => 'Team on-call',
'params' => [
[
'allowed_value_types' => [
'literal'
],
'array' => true,
'default_value' => [
'array_value' => [
[
'label' => 'Lawrence Jones',
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'label' => 'Lawrence Jones',
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'description' => 'What slack channel should we send the message to?',
'label' => 'To date',
'name' => 'severity',
'optional' => true,
'type' => 'IncidentSeverity'
]
],
'path' => [
[
'delay' => [
'delay_interval_condition' => 'active',
'delay_seconds' => 300,
'delay_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'escalation_path' => [
'escalation_path_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'if_else' => [
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
],
'else_path' => [
[
]
],
'then_path' => [
[
]
]
],
'level' => [
'ack_mode' => 'all',
'retry_config' => [
'attempts' => 3,
'interval_seconds' => 300
],
'round_robin_config' => [
'enabled' => false,
'rotate_after_seconds' => 120
],
'targets' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
],
'time_to_ack_interval_condition' => 'active',
'time_to_ack_seconds' => 1800,
'time_to_ack_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'notify_channel' => [
'targets' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
],
'time_to_ack_interval_condition' => 'active',
'time_to_ack_seconds' => 1800,
'time_to_ack_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'repeat' => [
'repeat_times' => 3,
'to_node' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'type' => 'if_else'
]
],
'repeat_config' => [
'delay_repeat_on_activity' => false,
'repeat_after_seconds' => 1800
],
'working_hours' => [
[
'id' => 'abc123',
'name' => 'abc123',
'timezone' => 'abc123',
'weekday_intervals' => [
[
'end_time' => '17:00',
'start_time' => '09:00',
'weekday' => 'monday'
]
]
]
]
]),
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/escalation_path_templates/{id}"
payload := strings.NewReader("{\n \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\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/escalation_path_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/escalation_path_templates/{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 \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"escalation_path_template": {
"description": "abc123",
"expressions": [
{
"else_branch": {
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
],
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"cast": {
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"concatenate": {
"reference": "1235",
"reference_label": "Teams"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
]
},
"navigate": {
"reference": "1235",
"reference_label": "Teams"
},
"operation_type": "navigate",
"parse": {
"returns": {
"array": true,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
},
"returns": {
"array": true,
"type": "IncidentStatus"
}
}
],
"reference": "abc123",
"returns": {
"array": true,
"type": "IncidentStatus"
},
"root_reference": "incident.status"
}
],
"has_historical_escalation_path_versions": false,
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Team on-call",
"params": [
{
"allowed_value_types": [
"literal"
],
"array": true,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": true,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": {
"escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
],
"else_path": [
{}
],
"then_path": [
{}
]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": false,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": false,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}🔑 Requires the
escalation_path_templates.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
Unique identifier for this template.
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
application/json
The name of this template, for the user's reference.
Example:
"Team on-call"
The nodes that form the levels and branches of this template.
Show child attributes
Show child attributes
Example:
[
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": {
"escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
],
"else_path": [{}],
"then_path": [{}]
},
"level": {
"ack_mode": "all",
"retry_config": { "attempts": 3, "interval_seconds": 300 },
"round_robin_config": {
"enabled": false,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
]
A description of what this template is for.
Example:
"Pages the team on-call, then a fallback user"
Expressions backing the template's binding targets.
Show child attributes
Show child attributes
Example:
[
{
"else_branch": {
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": { "array": true, "type": "IncidentStatus" }
},
"cast": {
"returns": { "array": true, "type": "IncidentStatus" }
},
"concatenate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
]
},
"navigate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"operation_type": "navigate",
"parse": {
"returns": { "array": true, "type": "IncidentStatus" },
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
]
The parameters declared by this template, bound per templated path.
Show child attributes
Show child attributes
Example:
[
{
"allowed_value_types": ["literal"],
"array": true,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": true,
"type": "IncidentSeverity"
}
]
Show child attributes
Show child attributes
Example:
{
"delay_repeat_on_activity": false,
"repeat_after_seconds": 1800
}
The working hours for this template.
Show child attributes
Show child attributes
Example:
[
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
Response
OK response.
Show child attributes
Show child attributes
Was this page helpful?
Update
curl --request PUT \
--url https://api.incident.io/v2/escalation_path_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Pages the team on-call, then a fallback user",
"expressions": [
{
"else_branch": {
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"cast": {
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"concatenate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
]
}
]
},
"navigate": {
"reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]"
},
"operation_type": "navigate",
"parse": {
"returns": {
"array": true,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
],
"name": "Team on-call",
"params": [
{
"allowed_value_types": [
"literal"
],
"array": true,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": true,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": {
"escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
],
"else_path": [
{}
],
"then_path": [
{}
]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": false,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": false,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
'import requests
url = "https://api.incident.io/v2/escalation_path_templates/{id}"
payload = {
"description": "Pages the team on-call, then a fallback user",
"expressions": [
{
"else_branch": { "result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [{ "conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
] }],
"result": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": True,
"type": "IncidentStatus"
}
},
"cast": { "returns": {
"array": True,
"type": "IncidentStatus"
} },
"concatenate": { "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]" },
"filter": { "condition_groups": [{ "conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
] }] },
"navigate": { "reference": "catalog_attribute[\"01FCNDV6P870EA6S7TK1DSYD5H\"]" },
"operation_type": "navigate",
"parse": {
"returns": {
"array": True,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
}
}
],
"reference": "abc123",
"root_reference": "incident.status"
}
],
"name": "Team on-call",
"params": [
{
"allowed_value_types": ["literal"],
"array": True,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": True,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": { "escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0" },
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": "one_of",
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": "incident.severity"
}
],
"else_path": [{}],
"then_path": [{}]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": False,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": False,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
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({
description: 'Pages the team on-call, then a fallback user',
expressions: [
{
else_branch: {
result: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
label: 'Team Slack channel',
operations: [
{
branches: {
branches: [
{
condition_groups: [
{
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
]
}
],
result: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
],
returns: {array: true, type: 'IncidentStatus'}
},
cast: {returns: {array: true, type: 'IncidentStatus'}},
concatenate: {reference: 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'},
filter: {
condition_groups: [
{
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
]
}
]
},
navigate: {reference: 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'},
operation_type: 'navigate',
parse: {
returns: {array: true, type: 'IncidentStatus'},
source: 'metadata.annotations["github.com/repo"]'
}
}
],
reference: 'abc123',
root_reference: 'incident.status'
}
],
name: 'Team on-call',
params: [
{
allowed_value_types: ['literal'],
array: true,
default_value: {
array_value: [{label: 'Lawrence Jones', literal: 'SEV123', reference: 'incident.severity'}],
value: {label: 'Lawrence Jones', literal: 'SEV123', reference: 'incident.severity'}
},
description: 'What slack channel should we send the message to?',
label: 'To date',
name: 'severity',
optional: true,
type: 'IncidentSeverity'
}
],
path: [
{
delay: {
delay_interval_condition: 'active',
delay_seconds: 300,
delay_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
escalation_path: {escalation_path_id: '01FCNDV6P870EA6S7TK1DSYDG0'},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
if_else: {
conditions: [
{
operation: 'one_of',
param_bindings: [
{
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
],
subject: 'incident.severity'
}
],
else_path: [{}],
then_path: [{}]
},
level: {
ack_mode: 'all',
retry_config: {attempts: 3, interval_seconds: 300},
round_robin_config: {enabled: false, rotate_after_seconds: 120},
targets: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
],
time_to_ack_interval_condition: 'active',
time_to_ack_seconds: 1800,
time_to_ack_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
notify_channel: {
targets: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
id: '01FCNDV6P870EA6S7TK1DSYDG0',
schedule_mode: 'currently_on_call',
selected_rota_id: '01FCNDV6P870EA6S7TK1DSYDG0',
type: 'schedule',
urgency: 'high'
}
],
time_to_ack_interval_condition: 'active',
time_to_ack_seconds: 1800,
time_to_ack_weekday_interval_config_id: '01FCNDV6P870EA6S7TK1DSYDG0'
},
repeat: {repeat_times: 3, to_node: '01FCNDV6P870EA6S7TK1DSYDG0'},
type: 'if_else'
}
],
repeat_config: {delay_repeat_on_activity: false, repeat_after_seconds: 1800},
working_hours: [
{
id: 'abc123',
name: 'abc123',
timezone: 'abc123',
weekday_intervals: [{end_time: '17:00', start_time: '09:00', weekday: 'monday'}]
}
]
})
};
fetch('https://api.incident.io/v2/escalation_path_templates/{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/escalation_path_templates/{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([
'description' => 'Pages the team on-call, then a fallback user',
'expressions' => [
[
'else_branch' => [
'result' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'label' => 'Team Slack channel',
'operations' => [
[
'branches' => [
'branches' => [
[
'condition_groups' => [
[
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
]
]
],
'result' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
],
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
]
],
'cast' => [
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
]
],
'concatenate' => [
'reference' => 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'
],
'filter' => [
'condition_groups' => [
[
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
]
]
]
],
'navigate' => [
'reference' => 'catalog_attribute["01FCNDV6P870EA6S7TK1DSYD5H"]'
],
'operation_type' => 'navigate',
'parse' => [
'returns' => [
'array' => true,
'type' => 'IncidentStatus'
],
'source' => 'metadata.annotations["github.com/repo"]'
]
]
],
'reference' => 'abc123',
'root_reference' => 'incident.status'
]
],
'name' => 'Team on-call',
'params' => [
[
'allowed_value_types' => [
'literal'
],
'array' => true,
'default_value' => [
'array_value' => [
[
'label' => 'Lawrence Jones',
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'label' => 'Lawrence Jones',
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'description' => 'What slack channel should we send the message to?',
'label' => 'To date',
'name' => 'severity',
'optional' => true,
'type' => 'IncidentSeverity'
]
],
'path' => [
[
'delay' => [
'delay_interval_condition' => 'active',
'delay_seconds' => 300,
'delay_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'escalation_path' => [
'escalation_path_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'if_else' => [
'conditions' => [
[
'operation' => 'one_of',
'param_bindings' => [
[
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'subject' => 'incident.severity'
]
],
'else_path' => [
[
]
],
'then_path' => [
[
]
]
],
'level' => [
'ack_mode' => 'all',
'retry_config' => [
'attempts' => 3,
'interval_seconds' => 300
],
'round_robin_config' => [
'enabled' => false,
'rotate_after_seconds' => 120
],
'targets' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
],
'time_to_ack_interval_condition' => 'active',
'time_to_ack_seconds' => 1800,
'time_to_ack_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'notify_channel' => [
'targets' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'schedule_mode' => 'currently_on_call',
'selected_rota_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'type' => 'schedule',
'urgency' => 'high'
]
],
'time_to_ack_interval_condition' => 'active',
'time_to_ack_seconds' => 1800,
'time_to_ack_weekday_interval_config_id' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'repeat' => [
'repeat_times' => 3,
'to_node' => '01FCNDV6P870EA6S7TK1DSYDG0'
],
'type' => 'if_else'
]
],
'repeat_config' => [
'delay_repeat_on_activity' => false,
'repeat_after_seconds' => 1800
],
'working_hours' => [
[
'id' => 'abc123',
'name' => 'abc123',
'timezone' => 'abc123',
'weekday_intervals' => [
[
'end_time' => '17:00',
'start_time' => '09:00',
'weekday' => 'monday'
]
]
]
]
]),
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/escalation_path_templates/{id}"
payload := strings.NewReader("{\n \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\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/escalation_path_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/escalation_path_templates/{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 \"description\": \"Pages the team on-call, then a fallback user\",\n \"expressions\": [\n {\n \"else_branch\": {\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n },\n \"label\": \"Team Slack channel\",\n \"operations\": [\n {\n \"branches\": {\n \"branches\": [\n {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ],\n \"result\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"cast\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n }\n },\n \"concatenate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"filter\": {\n \"condition_groups\": [\n {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ]\n }\n ]\n },\n \"navigate\": {\n \"reference\": \"catalog_attribute[\\\"01FCNDV6P870EA6S7TK1DSYD5H\\\"]\"\n },\n \"operation_type\": \"navigate\",\n \"parse\": {\n \"returns\": {\n \"array\": true,\n \"type\": \"IncidentStatus\"\n },\n \"source\": \"metadata.annotations[\\\"github.com/repo\\\"]\"\n }\n }\n ],\n \"reference\": \"abc123\",\n \"root_reference\": \"incident.status\"\n }\n ],\n \"name\": \"Team on-call\",\n \"params\": [\n {\n \"allowed_value_types\": [\n \"literal\"\n ],\n \"array\": true,\n \"default_value\": {\n \"array_value\": [\n {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"label\": \"Lawrence Jones\",\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"description\": \"What slack channel should we send the message to?\",\n \"label\": \"To date\",\n \"name\": \"severity\",\n \"optional\": true,\n \"type\": \"IncidentSeverity\"\n }\n ],\n \"path\": [\n {\n \"delay\": {\n \"delay_interval_condition\": \"active\",\n \"delay_seconds\": 300,\n \"delay_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"escalation_path\": {\n \"escalation_path_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"if_else\": {\n \"conditions\": [\n {\n \"operation\": \"one_of\",\n \"param_bindings\": [\n {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n ],\n \"subject\": \"incident.severity\"\n }\n ],\n \"else_path\": [\n {}\n ],\n \"then_path\": [\n {}\n ]\n },\n \"level\": {\n \"ack_mode\": \"all\",\n \"retry_config\": {\n \"attempts\": 3,\n \"interval_seconds\": 300\n },\n \"round_robin_config\": {\n \"enabled\": false,\n \"rotate_after_seconds\": 120\n },\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"notify_channel\": {\n \"targets\": [\n {\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n },\n \"id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"schedule_mode\": \"currently_on_call\",\n \"selected_rota_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"type\": \"schedule\",\n \"urgency\": \"high\"\n }\n ],\n \"time_to_ack_interval_condition\": \"active\",\n \"time_to_ack_seconds\": 1800,\n \"time_to_ack_weekday_interval_config_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"repeat\": {\n \"repeat_times\": 3,\n \"to_node\": \"01FCNDV6P870EA6S7TK1DSYDG0\"\n },\n \"type\": \"if_else\"\n }\n ],\n \"repeat_config\": {\n \"delay_repeat_on_activity\": false,\n \"repeat_after_seconds\": 1800\n },\n \"working_hours\": [\n {\n \"id\": \"abc123\",\n \"name\": \"abc123\",\n \"timezone\": \"abc123\",\n \"weekday_intervals\": [\n {\n \"end_time\": \"17:00\",\n \"start_time\": \"09:00\",\n \"weekday\": \"monday\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"escalation_path_template": {
"description": "abc123",
"expressions": [
{
"else_branch": {
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"label": "Team Slack channel",
"operations": [
{
"branches": {
"branches": [
{
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
],
"result": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"cast": {
"returns": {
"array": true,
"type": "IncidentStatus"
}
},
"concatenate": {
"reference": "1235",
"reference_label": "Teams"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
]
}
]
},
"navigate": {
"reference": "1235",
"reference_label": "Teams"
},
"operation_type": "navigate",
"parse": {
"returns": {
"array": true,
"type": "IncidentStatus"
},
"source": "metadata.annotations[\"github.com/repo\"]"
},
"returns": {
"array": true,
"type": "IncidentStatus"
}
}
],
"reference": "abc123",
"returns": {
"array": true,
"type": "IncidentStatus"
},
"root_reference": "incident.status"
}
],
"has_historical_escalation_path_versions": false,
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Team on-call",
"params": [
{
"allowed_value_types": [
"literal"
],
"array": true,
"default_value": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"description": "What slack channel should we send the message to?",
"label": "To date",
"name": "severity",
"optional": true,
"type": "IncidentSeverity"
}
],
"path": [
{
"delay": {
"delay_interval_condition": "active",
"delay_seconds": 300,
"delay_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"escalation_path": {
"escalation_path_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"if_else": {
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Incident Severity",
"reference": "incident.severity"
}
}
],
"else_path": [
{}
],
"then_path": [
{}
]
},
"level": {
"ack_mode": "all",
"retry_config": {
"attempts": 3,
"interval_seconds": 300
},
"round_robin_config": {
"enabled": false,
"rotate_after_seconds": 120
},
"targets": [
{
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"notify_channel": {
"targets": [
{
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
},
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"schedule_mode": "currently_on_call",
"selected_rota_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"type": "schedule",
"urgency": "high"
}
],
"time_to_ack_interval_condition": "active",
"time_to_ack_seconds": 1800,
"time_to_ack_weekday_interval_config_id": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"repeat": {
"repeat_times": 3,
"to_node": "01FCNDV6P870EA6S7TK1DSYDG0"
},
"type": "if_else"
}
],
"repeat_config": {
"delay_repeat_on_activity": false,
"repeat_after_seconds": 1800
},
"working_hours": [
{
"id": "abc123",
"name": "abc123",
"timezone": "abc123",
"weekday_intervals": [
{
"end_time": "17:00",
"start_time": "09:00",
"weekday": "monday"
}
]
}
]
}
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}{
"debug": {
"message": "Something broke: and something else: and something else",
"stacktrace": [
"thing.go:123"
]
},
"errors": [
{
"code": "trial_expired",
"message": "Default incident call link must be a valid URL",
"metadata": {
"abc123": "abc123"
},
"source": {
"field": "default_call_url",
"pointer": "/settings/default_call_url"
}
}
],
"rate_limit": {
"limit": 100,
"name": "client_ip",
"remaining": 98,
"retry_after": "2020-01-01T00:00:00Z"
},
"request_id": "2T1p0e3j",
"status": 408,
"type": "invalid_request_error"
}