Links

Notification Channels API

Contents
post
/v2/notifications/
Create a notification channel
Request format:
HTTP/1.1 200
Content-Type: application/json
{
"type": "email" | "pagerduty" | "slack" | "webhook" | "victorops" | "opsgenie",
"description": "Descriptive name for channel",
"destination": "Destination key of the channel.",
"auto_resolve": True | False
}
Curl example
curl -H "Content-Type: application/json" -X POST -d \
'{"type": "email", "description": "A test notification", "destination": "[email protected]"}' \
"https://[email protected]/v2/notifications/"

get
/v2/notifications/?query
Search notification channels
Curl example
curl -X GET "https://[email protected]/v2/notifications/?type=email&type=slack"
Specifying multiple fields performs an OR operation and returns notifications that match either criteria.

get
/v2/notifications/<notification_id>/
Obtain information on a single alert
Curl example
curl -X GET "https://[email protected]/v2/notification/123-456-789/"
Obtain information of the notification channel identified by the id 123-456-789.

put
/v2/notifications/<notification_id>/
Update notification channels
Curl example
curl -H "Content-Type: application/json" -X PUT \
-d '{"destination": "[email protected]"}' \
"https://[email protected]/v2/notifications/123-456-789/"
Updates the destination of notification 123-456-789. Each field is optional and only the specified fields are updated.

DELETE /v2/notifications/<notification_id>/ - Deletes a notification channel identified by the notification id.
Curl example
curl -X DELETE "https://[email protected]/v2/notifications/123-456-789/"
Delete the notification channel identified by the id 123-456-789.
Status Codes:
  • 200 - OK
  • 404 - Notification channel doesn’t exist.