Update
Update an incident template. This is a full replacement: any field not supplied is cleared.
PUT
/
v1
/
incident_templates
/
{id}
Update
curl --request PUT \
--url https://api.incident.io/v1/incident_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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": "alert.priority"
}
]
}
],
"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": "alert.priority"
}
]
}
]
},
"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": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"incident_type": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"name": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"summary": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
}
'import requests
url = "https://api.incident.io/v1/incident_templates/{id}"
payload = {
"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": "alert.priority"
}
] }],
"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": "alert.priority"
}
] }] },
"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": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"incident_type": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"name": {
"autogenerated": False,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"summary": {
"autogenerated": False,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} }
}
}
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({
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: 'alert.priority'
}
]
}
],
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: 'alert.priority'
}
]
}
]
},
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: 'Payments incidents',
template: {
custom_fields: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
custom_field_id: '01FCNDV6P870EA6S7TK1DSYDG0',
merge_strategy: 'first-wins'
}
],
incident_mode: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
incident_type: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
name: {
autogenerated: false,
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
severity: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
merge_strategy: 'first-wins'
},
start_in_triage: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
summary: {
autogenerated: false,
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
workspace: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
}
})
};
fetch('https://api.incident.io/v1/incident_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/v1/incident_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([
'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' => 'alert.priority'
]
]
]
],
'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' => 'alert.priority'
]
]
]
]
],
'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' => 'Payments incidents',
'template' => [
'custom_fields' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'custom_field_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'merge_strategy' => 'first-wins'
]
],
'incident_mode' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'incident_type' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'name' => [
'autogenerated' => false,
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'severity' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'merge_strategy' => 'first-wins'
],
'start_in_triage' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'summary' => [
'autogenerated' => false,
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'workspace' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
]
]),
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/v1/incident_templates/{id}"
payload := strings.NewReader("{\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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\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/v1/incident_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v1/incident_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 \"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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\n }\n}"
response = http.request(request)
puts response.read_body{
"incident_template": {
"created_at": "2021-08-17T13:28:57.801578Z",
"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": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Priority",
"reference": "alert.priority"
}
}
]
}
],
"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": "1235",
"reference_label": "Teams"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Priority",
"reference": "alert.priority"
}
}
]
}
]
},
"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"
}
],
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"incident_type": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"name": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"summary": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
},
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}{
"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
incident_template.update scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Path Parameters
The incident template's ID
Example:
"01FCNDV6P870EA6S7TK1DSYDG0"
Body
application/json
The name of this incident template, for the user's reference
Example:
"Payments incidents"
The values an incident template applies to the incidents it creates.
Show child attributes
Show child attributes
Example:
{
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"incident_type": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"name": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"summary": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
The expressions used by bindings in this template
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": "alert.priority"
}
]
}
],
"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": "alert.priority"
}
]
}
]
},
"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"
}
]
Response
OK response.
A reusable set of values applied to incidents created from alerts.
Show child attributes
Show child attributes
Was this page helpful?
Update
curl --request PUT \
--url https://api.incident.io/v1/incident_templates/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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": "alert.priority"
}
]
}
],
"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": "alert.priority"
}
]
}
]
},
"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": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"incident_type": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"name": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"summary": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
}
'import requests
url = "https://api.incident.io/v1/incident_templates/{id}"
payload = {
"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": "alert.priority"
}
] }],
"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": "alert.priority"
}
] }] },
"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": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"incident_type": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"name": {
"autogenerated": False,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} },
"summary": {
"autogenerated": False,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": { "binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
} }
}
}
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({
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: 'alert.priority'
}
]
}
],
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: 'alert.priority'
}
]
}
]
},
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: 'Payments incidents',
template: {
custom_fields: [
{
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
custom_field_id: '01FCNDV6P870EA6S7TK1DSYDG0',
merge_strategy: 'first-wins'
}
],
incident_mode: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
incident_type: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
name: {
autogenerated: false,
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
severity: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
},
merge_strategy: 'first-wins'
},
start_in_triage: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
summary: {
autogenerated: false,
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
},
workspace: {
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
}
})
};
fetch('https://api.incident.io/v1/incident_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/v1/incident_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([
'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' => 'alert.priority'
]
]
]
],
'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' => 'alert.priority'
]
]
]
]
],
'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' => 'Payments incidents',
'template' => [
'custom_fields' => [
[
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'custom_field_id' => '01FCNDV6P870EA6S7TK1DSYDG0',
'merge_strategy' => 'first-wins'
]
],
'incident_mode' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'incident_type' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'name' => [
'autogenerated' => false,
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'severity' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'merge_strategy' => 'first-wins'
],
'start_in_triage' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'summary' => [
'autogenerated' => false,
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
],
'workspace' => [
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
]
]),
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/v1/incident_templates/{id}"
payload := strings.NewReader("{\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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\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/v1/incident_templates/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v1/incident_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 \"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\": \"alert.priority\"\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\": \"alert.priority\"\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\": \"Payments incidents\",\n \"template\": {\n \"custom_fields\": [\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 \"custom_field_id\": \"01FCNDV6P870EA6S7TK1DSYDG0\",\n \"merge_strategy\": \"first-wins\"\n }\n ],\n \"incident_mode\": {\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 },\n \"incident_type\": {\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 },\n \"name\": {\n \"autogenerated\": false,\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 },\n \"severity\": {\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 \"merge_strategy\": \"first-wins\"\n },\n \"start_in_triage\": {\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 },\n \"summary\": {\n \"autogenerated\": false,\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 },\n \"workspace\": {\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 }\n }\n}"
response = http.request(request)
puts response.read_body{
"incident_template": {
"created_at": "2021-08-17T13:28:57.801578Z",
"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": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Priority",
"reference": "alert.priority"
}
}
]
}
],
"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": "1235",
"reference_label": "Teams"
},
"filter": {
"condition_groups": [
{
"conditions": [
{
"operation": {
"label": "Lawrence Jones",
"value": "01FCQSP07Z74QMMYPDDGQB9FTG"
},
"param_bindings": [
{
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
],
"subject": {
"label": "Priority",
"reference": "alert.priority"
}
}
]
}
]
},
"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"
}
],
"id": "01FCNDV6P870EA6S7TK1DSYDG0",
"name": "Payments incidents",
"template": {
"custom_fields": [
{
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"custom_field_id": "01FCNDV6P870EA6S7TK1DSYDG0",
"merge_strategy": "first-wins"
}
],
"incident_mode": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"incident_type": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"name": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"severity": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
},
"merge_strategy": "first-wins"
},
"start_in_triage": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"summary": {
"autogenerated": false,
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
},
"workspace": {
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
},
"updated_at": "2021-08-17T13:28:57.801578Z"
}
}{
"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"
}