Skip to main content
POST
/
v2
/
alert_sources
Create
curl --request POST \
  --url https://api.incident.io/v2/alert_sources \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "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"
            }
          ],
          "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"
              }
            },
            "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"
      }
    }
  }
}
EOF
{
  "alert_source": {
    "email_options": {
      "email_address": "lawrence@example.com"
    },
    "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"
              }
            ],
            "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"
        }
      }
    }
  }
}

Body

application/json
name
string
required

Unique name of the alert source

Example:

"Production Web Dashboard Alerts"

source_type
enum<string>
required

Type of alert source

Available options:
alertmanager,
app_optics,
azure_monitor,
bugsnag,
checkly,
chronosphere,
cloudwatch,
cloudflare,
coralogix,
cronitor,
crowdstrike_falcon,
datadog,
dynatrace,
elasticsearch,
email,
expel,
github_issue,
google_cloud,
grafana,
http,
http_custom,
honeycomb,
incoming_calls,
jira,
jsm,
monte_carlo,
nagios,
new_relic,
opsgenie,
prtg,
pager_duty,
panther,
pingdom,
runscope,
sns,
sentry,
sentry_metric,
splunk,
status_cake,
status_page_views,
sumo_logic,
uptime,
zendesk
Example:

"alertmanager"

template
object
required
Example:
{
"attributes": [
{
"alert_attribute_id": "abc123",
"binding": {
"array_value": [
{
"literal": "SEV123",
"reference": "incident.severity"
}
],
"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" }
},
"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"
}
}
}
http_custom_options
object
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}"
}
jira_options
object
Example:
{
"project_ids": ["01GBSQF3FHF7FWZQNWGHAVQ804", "10043"]
}
owning_team_ids
string[]

IDs of teams that own this alert source

Example:
["01G0J1EXE7AXZ2C93K61WBPYEH"]

Response

200 - application/json

OK response.

alert_source
object
required
Example:
{
"email_options": { "email_address": "lawrence@example.com" },
"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"
}
],
"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"
}
}
}
}