Create alert rule

POST {{baseUrl}}/alerts/rules?aid=1234

Creates a new alert rule in your account, using the provided POST data. The Edit alert rules permission is required to create an alert rule. Note: Assigning an alert rule to a test during creation requires the Edit tests permission.

Request Params

KeyDatatypeRequiredDescription
aidnumberA unique identifier associated with your account group. You can retrieve your AccountGroupId from the /account-groups endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.

Request Body

{"alertType"=>"http-server", "expression"=>"((hops((hopDelay >= 100 ms))))", "roundsViolatingOutOf"=>5, "roundsViolatingRequired"=>2, "ruleName"=>"The End of the Internet", "direction"=>"to-target", "notifyOnClear"=>true, "isDefault"=>true, "minimumSources"=>10, "minimumSourcesPct"=>99, "includeCoveredPrefixes"=>true, "severity"=>"major", "notifications"=>{"email"=>{"recipients"=>["noreply@thousandeyes.com"], "message"=>"Notification message"}, "thirdParty"=>[{"integrationId"=>"sl-101", "integrationType"=>"slack"}, {"integrationId"=>"sl-101", "integrationType"=>"slack"}], "webhook"=>[{"integrationId"=>"wb-201", "integrationType"=>"webhook"}, {"integrationId"=>"wb-201", "integrationType"=>"webhook"}], "customWebhook"=>[{"integrationId"=>"cwb-201", "integrationType"=>"custom-webhook", "integrationName"=>"My webhook", "target"=>"https://example.com/test/webhooks/notifications"}, {"integrationId"=>"cwb-201", "integrationType"=>"custom-webhook", "integrationName"=>"My webhook", "target"=>"https://example.com/test/webhooks/notifications"}]}, "testIds"=>["281474976710706", "271659"]}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: Created

{"alertType":"http-server","expression":"((hops((hopDelay \u003e= 100 ms))))","roundsViolatingOutOf":5,"roundsViolatingRequired":2,"ruleName":"The End of the Internet","ruleId":"127094","direction":"to-target","notifyOnClear":true,"isDefault":true,"minimumSources":10,"minimumSourcesPct":99,"roundsViolatingMode":"exact","includeCoveredPrefixes":true,"sensitivityLevel":"medium","severity":"major","notifications":{"email":{"recipients":["noreply@thousandeyes.com"],"message":"Notification message"},"thirdParty":[{"integrationId":"sl-101","integrationType":"slack"},{"integrationId":"sl-101","integrationType":"slack"}],"webhook":[{"integrationId":"wb-201","integrationType":"webhook"},{"integrationId":"wb-201","integrationType":"webhook"}],"customWebhook":[{"integrationId":"cwb-201","integrationType":"custom-webhook","integrationName":"My webhook","target":"https://example.com/test/webhooks/notifications"},{"integrationId":"cwb-201","integrationType":"custom-webhook","integrationName":"My webhook","target":"https://example.com/test/webhooks/notifications"}]},"testIds":["281474976710706","271659"],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/link/to/resource/id","templated":false,"type":"Excepteur enim sed in","deprecation":"sint Lor","name":"cupidatat ullamco ipsum velit","profile":"exercitation ad Lorem quis","title":"dolore occaecat est ips","hreflang":"irure qui eu velit dolore"}}}