Create
Create a new alert source in your account.
POST
/
v2
/
alert_sources
Create
curl --request POST \
--url https://api.incident.io/v2/alert_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"auto_resolve_incident_alerts": false,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"redactions": [
"credit_card_numbers"
],
"transform_expression": "return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\n deduplication_key: $.header_message_id,\n}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {\n title: $.title || $.name || 'Unknown Alert',\n status: $.status === 'resolved' ? 'resolved' : 'firing',\n description: $.description || $.message || '',\n sourceURL: $.url || $.link || '',\n metadata: { team: $.team, severity: $.severity }\n}"
},
"jira_options": {
"project_ids": [
"01GBSQF3FHF7FWZQNWGHAVQ804",
"10043"
]
},
"name": "Production Web Dashboard Alerts",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
],
"is_private": false,
"title": {
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
EOFimport requests
url = "https://api.incident.io/v2/alert_sources"
payload = {
"auto_resolve_incident_alerts": False,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"redactions": ["credit_card_numbers"],
"transform_expression": "return {
title: $.subject,
description: $.text,
status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',
deduplication_key: $.header_message_id,
}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {
title: $.title || $.name || 'Unknown Alert',
status: $.status === 'resolved' ? 'resolved' : 'firing',
description: $.description || $.message || '',
sourceURL: $.url || $.link || '',
metadata: { team: $.team, severity: $.severity }
}"
},
"jira_options": { "project_ids": ["01GBSQF3FHF7FWZQNWGHAVQ804", "10043"] },
"name": "Production Web Dashboard Alerts",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"],
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
],
"is_private": False,
"title": {
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auto_resolve_incident_alerts: false,
auto_resolve_timeout_minutes: 1,
email_options: {
redactions: ['credit_card_numbers'],
transform_expression: 'return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith(\'[RESOLVED]\') ? \'resolved\' : \'firing\',\n deduplication_key: $.header_message_id,\n}'
},
heartbeat_options: {failure_threshold: 1, grace_period_seconds: 0, interval_seconds: 60},
http_custom_options: {
deduplication_key_path: '$.alert_id',
transform_expression: 'return {\n title: $.title || $.name || \'Unknown Alert\',\n status: $.status === \'resolved\' ? \'resolved\' : \'firing\',\n description: $.description || $.message || \'\',\n sourceURL: $.url || $.link || \'\',\n metadata: { team: $.team, severity: $.severity }\n}'
},
jira_options: {project_ids: ['01GBSQF3FHF7FWZQNWGHAVQ804', '10043']},
name: 'Production Web Dashboard Alerts',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH'],
source_type: 'alertmanager',
template: {
attributes: [
{
alert_attribute_id: 'abc123',
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
merge_strategy: 'first_wins',
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
],
description: {literal: 'SEV123', reference: 'incident.severity'},
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'
}
],
is_private: false,
title: {literal: 'SEV123', reference: 'incident.severity'},
visible_to_teams: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
})
};
fetch('https://api.incident.io/v2/alert_sources', 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/alert_sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'auto_resolve_incident_alerts' => false,
'auto_resolve_timeout_minutes' => 1,
'email_options' => [
'redactions' => [
'credit_card_numbers'
],
'transform_expression' => 'return {
title: $.subject,
description: $.text,
status: $.subject.startsWith(\'[RESOLVED]\') ? \'resolved\' : \'firing\',
deduplication_key: $.header_message_id,
}'
],
'heartbeat_options' => [
'failure_threshold' => 1,
'grace_period_seconds' => 0,
'interval_seconds' => 60
],
'http_custom_options' => [
'deduplication_key_path' => '$.alert_id',
'transform_expression' => 'return {
title: $.title || $.name || \'Unknown Alert\',
status: $.status === \'resolved\' ? \'resolved\' : \'firing\',
description: $.description || $.message || \'\',
sourceURL: $.url || $.link || \'\',
metadata: { team: $.team, severity: $.severity }
}'
],
'jira_options' => [
'project_ids' => [
'01GBSQF3FHF7FWZQNWGHAVQ804',
'10043'
]
],
'name' => 'Production Web Dashboard Alerts',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
],
'source_type' => 'alertmanager',
'template' => [
'attributes' => [
[
'alert_attribute_id' => 'abc123',
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'merge_strategy' => 'first_wins',
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
],
'description' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
],
'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'
]
],
'is_private' => false,
'title' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
],
'visible_to_teams' => [
'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/v2/alert_sources"
payload := strings.NewReader("{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}")
req, _ := http.NewRequest("POST", 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.post("https://api.incident.io/v2/alert_sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alert_sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}"
response = http.request(request)
puts response.read_body{
"alert_source": {
"alert_events_url": "https://api.incident.io/v2/alert_events/http/01GW2G3V0S59R238FAHPDS1R66",
"auto_resolve_incident_alerts": false,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"email_address": "lawrence@example.com",
"redactions": [
"credit_card_numbers"
],
"transform_expression": "return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\n deduplication_key: $.header_message_id,\n}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60,
"ping_url": "https://api.incident.io/v2/heartbeat/01GW2G3V0S59R238FAHPDS1R66/ping"
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {\n title: $.title || $.name || 'Unknown Alert',\n status: $.status === 'resolved' ? 'resolved' : 'firing',\n description: $.description || $.message || '',\n sourceURL: $.url || $.link || '',\n metadata: { team: $.team, severity: $.severity }\n}"
},
"id": "01GW2G3V0S59R238FAHPDS1R66",
"jira_options": {
"project_ids": [
"01GBSQF3FHF7FWZQNWGHAVQ804",
"10043"
]
},
"name": "Production Web Dashboard Alerts",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"secret_token": "some-secret-token",
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
},
"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"
}
],
"is_private": false,
"title": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
}🔑 Requires the
alert_source.create scope.Authorizations
API key from your incident.io dashboard (Settings → API keys)
Body
application/json
Unique name of the alert source
Example:
"Production Web Dashboard Alerts"
Type of alert source
Available options:
alertmanager, app_optics, azure_monitor, big_panda, bugsnag, checkly, chronosphere, cloudwatch, cloudflare, coralogix, cronitor, crowdstrike_falcon, datadog, dynatrace, elasticsearch, email, expel, github_issue, google_cloud, grafana, heartbeat, http, http_custom, honeycomb, incoming_calls, jira, jsm, monte_carlo, nagios, new_relic, opsgenie, prtg, pager_duty, panther, pingdom, runscope, sns, sentry, sentry_metric, service_now, splunk, status_cake, status_page_views, sumo_logic, uptime, vercel, zendesk Example:
"alertmanager"
Show child attributes
Show child attributes
Example:
{
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
],
"is_private": false,
"title": {
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
Whether to auto-resolve incident alerts when the alert auto-resolves. Defaults to true. Only use in conjunction with auto_resolve_timeout_minutes.
Example:
false
When set, alerts from this source will automatically resolve after this many minutes.
Example:
1
Show child attributes
Show child attributes
Example:
{
"redactions": ["credit_card_numbers"],
"transform_expression": "return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\n deduplication_key: $.header_message_id,\n}"
}
Show child attributes
Show child attributes
Example:
{
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60
}
Show child attributes
Show child attributes
Example:
{
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {\n title: $.title || $.name || 'Unknown Alert',\n status: $.status === 'resolved' ? 'resolved' : 'firing',\n description: $.description || $.message || '',\n sourceURL: $.url || $.link || '',\n metadata: { team: $.team, severity: $.severity }\n}"
}
Show child attributes
Show child attributes
Example:
{
"project_ids": ["01GBSQF3FHF7FWZQNWGHAVQ804", "10043"]
}
IDs of teams that own this alert source
Example:
["01G0J1EXE7AXZ2C93K61WBPYEH"]
Response
200 - application/json
OK response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Create
curl --request POST \
--url https://api.incident.io/v2/alert_sources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"auto_resolve_incident_alerts": false,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"redactions": [
"credit_card_numbers"
],
"transform_expression": "return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\n deduplication_key: $.header_message_id,\n}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {\n title: $.title || $.name || 'Unknown Alert',\n status: $.status === 'resolved' ? 'resolved' : 'firing',\n description: $.description || $.message || '',\n sourceURL: $.url || $.link || '',\n metadata: { team: $.team, severity: $.severity }\n}"
},
"jira_options": {
"project_ids": [
"01GBSQF3FHF7FWZQNWGHAVQ804",
"10043"
]
},
"name": "Production Web Dashboard Alerts",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
],
"is_private": false,
"title": {
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
EOFimport requests
url = "https://api.incident.io/v2/alert_sources"
payload = {
"auto_resolve_incident_alerts": False,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"redactions": ["credit_card_numbers"],
"transform_expression": "return {
title: $.subject,
description: $.text,
status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',
deduplication_key: $.header_message_id,
}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {
title: $.title || $.name || 'Unknown Alert',
status: $.status === 'resolved' ? 'resolved' : 'firing',
description: $.description || $.message || '',
sourceURL: $.url || $.link || '',
metadata: { team: $.team, severity: $.severity }
}"
},
"jira_options": { "project_ids": ["01GBSQF3FHF7FWZQNWGHAVQ804", "10043"] },
"name": "Production Web Dashboard Alerts",
"owning_team_ids": ["01G0J1EXE7AXZ2C93K61WBPYEH"],
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
],
"is_private": False,
"title": {
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
auto_resolve_incident_alerts: false,
auto_resolve_timeout_minutes: 1,
email_options: {
redactions: ['credit_card_numbers'],
transform_expression: 'return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith(\'[RESOLVED]\') ? \'resolved\' : \'firing\',\n deduplication_key: $.header_message_id,\n}'
},
heartbeat_options: {failure_threshold: 1, grace_period_seconds: 0, interval_seconds: 60},
http_custom_options: {
deduplication_key_path: '$.alert_id',
transform_expression: 'return {\n title: $.title || $.name || \'Unknown Alert\',\n status: $.status === \'resolved\' ? \'resolved\' : \'firing\',\n description: $.description || $.message || \'\',\n sourceURL: $.url || $.link || \'\',\n metadata: { team: $.team, severity: $.severity }\n}'
},
jira_options: {project_ids: ['01GBSQF3FHF7FWZQNWGHAVQ804', '10043']},
name: 'Production Web Dashboard Alerts',
owning_team_ids: ['01G0J1EXE7AXZ2C93K61WBPYEH'],
source_type: 'alertmanager',
template: {
attributes: [
{
alert_attribute_id: 'abc123',
binding: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
merge_strategy: 'first_wins',
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
],
description: {literal: 'SEV123', reference: 'incident.severity'},
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'
}
],
is_private: false,
title: {literal: 'SEV123', reference: 'incident.severity'},
visible_to_teams: {
array_value: [{literal: 'SEV123', reference: 'incident.severity'}],
value: {literal: 'SEV123', reference: 'incident.severity'}
}
}
})
};
fetch('https://api.incident.io/v2/alert_sources', 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/alert_sources",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'auto_resolve_incident_alerts' => false,
'auto_resolve_timeout_minutes' => 1,
'email_options' => [
'redactions' => [
'credit_card_numbers'
],
'transform_expression' => 'return {
title: $.subject,
description: $.text,
status: $.subject.startsWith(\'[RESOLVED]\') ? \'resolved\' : \'firing\',
deduplication_key: $.header_message_id,
}'
],
'heartbeat_options' => [
'failure_threshold' => 1,
'grace_period_seconds' => 0,
'interval_seconds' => 60
],
'http_custom_options' => [
'deduplication_key_path' => '$.alert_id',
'transform_expression' => 'return {
title: $.title || $.name || \'Unknown Alert\',
status: $.status === \'resolved\' ? \'resolved\' : \'firing\',
description: $.description || $.message || \'\',
sourceURL: $.url || $.link || \'\',
metadata: { team: $.team, severity: $.severity }
}'
],
'jira_options' => [
'project_ids' => [
'01GBSQF3FHF7FWZQNWGHAVQ804',
'10043'
]
],
'name' => 'Production Web Dashboard Alerts',
'owning_team_ids' => [
'01G0J1EXE7AXZ2C93K61WBPYEH'
],
'source_type' => 'alertmanager',
'template' => [
'attributes' => [
[
'alert_attribute_id' => 'abc123',
'binding' => [
'array_value' => [
[
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
],
'merge_strategy' => 'first_wins',
'value' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
]
]
]
],
'description' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
],
'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'
]
],
'is_private' => false,
'title' => [
'literal' => 'SEV123',
'reference' => 'incident.severity'
],
'visible_to_teams' => [
'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/v2/alert_sources"
payload := strings.NewReader("{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}")
req, _ := http.NewRequest("POST", 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.post("https://api.incident.io/v2/alert_sources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alert_sources")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"auto_resolve_incident_alerts\": false,\n \"auto_resolve_timeout_minutes\": 1,\n \"email_options\": {\n \"redactions\": [\n \"credit_card_numbers\"\n ],\n \"transform_expression\": \"return {\\n title: $.subject,\\n description: $.text,\\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\\n deduplication_key: $.header_message_id,\\n}\"\n },\n \"heartbeat_options\": {\n \"failure_threshold\": 1,\n \"grace_period_seconds\": 0,\n \"interval_seconds\": 60\n },\n \"http_custom_options\": {\n \"deduplication_key_path\": \"$.alert_id\",\n \"transform_expression\": \"return {\\n title: $.title || $.name || 'Unknown Alert',\\n status: $.status === 'resolved' ? 'resolved' : 'firing',\\n description: $.description || $.message || '',\\n sourceURL: $.url || $.link || '',\\n metadata: { team: $.team, severity: $.severity }\\n}\"\n },\n \"jira_options\": {\n \"project_ids\": [\n \"01GBSQF3FHF7FWZQNWGHAVQ804\",\n \"10043\"\n ]\n },\n \"name\": \"Production Web Dashboard Alerts\",\n \"owning_team_ids\": [\n \"01G0J1EXE7AXZ2C93K61WBPYEH\"\n ],\n \"source_type\": \"alertmanager\",\n \"template\": {\n \"attributes\": [\n {\n \"alert_attribute_id\": \"abc123\",\n \"binding\": {\n \"array_value\": [\n {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n ],\n \"merge_strategy\": \"first_wins\",\n \"value\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n }\n }\n }\n ],\n \"description\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\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 \"is_private\": false,\n \"title\": {\n \"literal\": \"SEV123\",\n \"reference\": \"incident.severity\"\n },\n \"visible_to_teams\": {\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}"
response = http.request(request)
puts response.read_body{
"alert_source": {
"alert_events_url": "https://api.incident.io/v2/alert_events/http/01GW2G3V0S59R238FAHPDS1R66",
"auto_resolve_incident_alerts": false,
"auto_resolve_timeout_minutes": 1,
"email_options": {
"email_address": "lawrence@example.com",
"redactions": [
"credit_card_numbers"
],
"transform_expression": "return {\n title: $.subject,\n description: $.text,\n status: $.subject.startsWith('[RESOLVED]') ? 'resolved' : 'firing',\n deduplication_key: $.header_message_id,\n}"
},
"heartbeat_options": {
"failure_threshold": 1,
"grace_period_seconds": 0,
"interval_seconds": 60,
"ping_url": "https://api.incident.io/v2/heartbeat/01GW2G3V0S59R238FAHPDS1R66/ping"
},
"http_custom_options": {
"deduplication_key_path": "$.alert_id",
"transform_expression": "return {\n title: $.title || $.name || 'Unknown Alert',\n status: $.status === 'resolved' ? 'resolved' : 'firing',\n description: $.description || $.message || '',\n sourceURL: $.url || $.link || '',\n metadata: { team: $.team, severity: $.severity }\n}"
},
"id": "01GW2G3V0S59R238FAHPDS1R66",
"jira_options": {
"project_ids": [
"01GBSQF3FHF7FWZQNWGHAVQ804",
"10043"
]
},
"name": "Production Web Dashboard Alerts",
"owning_team_ids": [
"01G0J1EXE7AXZ2C93K61WBPYEH"
],
"secret_token": "some-secret-token",
"source_type": "alertmanager",
"template": {
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"merge_strategy": "first_wins",
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
],
"description": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
},
"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"
}
},
"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"
}
],
"is_private": false,
"title": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
},
"visible_to_teams": {
"array_value": [
{
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
],
"value": {
"label": "Lawrence Jones",
"literal": "SEV123",
"reference": "incident.severity"
}
}
}
}
}