Updating an alert rule
POST https://{{base_url}}/v6/alert-rules/{{ruleId}}/update.json
Updating an alert rule
Modifies an existing alert rule in your account, based on properties provided in the POST data. In order to modify an alert rule, the user attempting the creation must be in a role that has the Edit alert rules permission. Users without this permission will receive an error.
Note: when assigning any alert rule to a test (which can be done as part of the update activity), the user must be in a role that has the Edit tests permission.
Optional (Querystring) Parameters
- aid={aid} optional and requires the user to be assigned to the target account group, specifies the account group context of the request, obtained from the /account-groups endpoint. Specifying this parameter without the user being assigned to the target account will result in an error response. See Account group context for more information
Request
- {ruleId} corresponds to a ruleId returned by the /alert-rules endpoint.
- request body must contain a full list of fields. It is recommended to make a request to the alert-rules/{ruleId} endpoint and modify the conditions of the alert rule based on fields returned in that request. See the Alert Rule Metadata page for fields available during alert rule modification.
Request Body
{"alertType"=>"FTP", "default"=>0, "expression"=>"((reachability < 90%))", "minimumSources"=>10, "notes"=>"FTP Alert rule created using write api", "description"=>"TE FTP Alert rule with write api", "notifications"=>{"email"=>{"message"=>"", "recipient"=>["postman+devnet@cisco.com"]}, "thirdParty"=>[{"integrationId"=>"sl-101", "integrationType"=>"SLACK"}], "webhook"=>[{"integrationId"=>"wb-201", "integrationType"=>"WEBHOOK"}]}, "notifyOnClear"=>1, "roundsViolatingOutOf"=>10, "roundsViolatingRequired"=>10, "roundsViolatingMode"=>"ANY", "ruleName"=>"Postman DevNet FTP Alert Rule updated", "sourceMeasure"=>"percent", "testIds"=>[1001, 1002]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |