Show
Load details about a specific alert source in your account.
GET
/
v2
/
alert_sources
/
{id}
Show
curl --request GET \
--url https://api.incident.io/v2/alert_sources/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/alert_sources/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/alert_sources/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/alert_sources/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/alert_sources/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/alert_sources/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alert_sources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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_sources.view scope.Was this page helpful?
⌘I
Show
curl --request GET \
--url https://api.incident.io/v2/alert_sources/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.incident.io/v2/alert_sources/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.incident.io/v2/alert_sources/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.incident.io/v2/alert_sources/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.incident.io/v2/alert_sources/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.incident.io/v2/alert_sources/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.incident.io/v2/alert_sources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"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"
}
}
}
}
}