Create an alert profile with metric rules and notification settings

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Creates a new alert profile and returns the generated profile identifier.

Request URL

https://{serverurl}/intelligence/api/alerts/addPolicy

Scope

DesktopCentralCloud.DEX.CREATECopied!

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Request Parameters

- Request Headers

Content-TypestringMandatory
application/alertRuleDetails.v1+jsonapplication/alertRuleDetails.v1+jsonCopied!
AcceptstringMandatory
application/alertRuleAdded.v1+jsonapplication/alertRuleAdded.v1+jsonCopied!

- Request Body

application/json
JSON Object
Hide Sub-Attributes
ruleNamestringOptional

Unique alert profile name

descriptionstringOptional

Profile description

rulesJSON ArrayOptional

List of metric rule definitions

Show Sub-Attributes
JSON Object
Show Sub-Attributes
metricKeystringOptional

Metric key identifying the selected alert rule template

ruleParamsJSON ObjectOptional

Rule parameter map keyed by template identifier

Show Sub-Attributes
numericforidsJSON ObjectOptional

Rule parameter object keyed by numeric template id

Show Sub-Attributes
paramValuestringOptional

Configured value for the parameter

ruleUnitstringOptional

Configured display unit for the parameter

alertTypeJSONJSON ObjectOptional

Alert type and grouped threshold details

Show Sub-Attributes
alertTypestringOptional

Alert mode. Allowed values: Individual, Grouped

endpointsCountstringOptional

Minimum impacted endpoint threshold for grouped alerts

monitoringIntervalstringOptional

Monitoring interval in minutes

prioritystringOptional

Alert priority. Allowed values: Critical, High, Medium, Low

coolOffPeriodstringOptional

Cool-off period in minutes

notificationJSON ObjectOptional

Notification configuration details

Show Sub-Attributes
enabledbooleanOptional

Whether notification is enabled for the profile

notificationGroupIdlongOptional

Notification group identifier when available

emailJSON ObjectOptional

Email notification channel details

Show Sub-Attributes
templateIdlongOptional

Email template identifier associated with notification group

addressesarrayOptional

Configured recipient email addresses

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request POST \
  --url https://appdomains/intelligence/api/alerts/addPolicy \
  --header 'Accept: application/alertRuleAdded.v1+json' \
  --header 'Authorization: Zoho-oauthtoken  d92d4xxxxxxxxxxxxx15f52' \
  --header 'Content-Type: application/alertRuleDetails.v1+json' \
  --data '{}'

Sample Request Body

Create grouped alert profile with email notification

Copied!
  {
    "alertTypeJSON": {
      "alertType": "Grouped",
      "endpointsCount": "5"
    },
    "notification": {
      "enabled": true,
      "email": {
        "addresses": [
          "ops-team@example.com"
        ]
      }
    },
    "coolOffPeriod": "30",
    "monitoringInterval": "5",
    "ruleName": "High CPU Spike",
    "description": "Alert when CPU usage is sustained above threshold",
    "rules": [
      {
        "metricKey": "301",
        "ruleParams": {
          "7001": {
            "ruleUnit": "%",
            "paramValue": "90"
          },
          "7002": {
            "ruleUnit": "minutes",
            "paramValue": "10"
          }
        }
      }
    ],
    "priority": "High"
  }
                
Show full

Response Parameters

- HTTP code 200

Response Body - application/json
JSON Object
Hide Sub-Attributes
alertProfileIdlong

Generated alert profile identifier

Messagestring

Localized success message

- HTTP code 400

Response Body - application/json
JSON Object
Hide Sub-Attributes
errorCodestring

Validation error code for add policy request

errorMessagestring

Validation failure message for add policy request

- HTTP code 500

Response Body - application/json
JSON Object
Hide Sub-Attributes
errorCodestring

Internal server error code for add policy operation

errorMessagestring

Internal server error message for add policy operation

Possible Response Codes

200HTTP code
400HTTP code
500HTTP code

Sample Response: HTTP 200

Profile created successfully

Copied!
  {
    "alertProfileId": 1051,
    "Message": "High CPU Spike created successfully"
  }
                
Show full

Sample Response: HTTP 400

Missing mandatory request data

Copied!
  {
    "errorMessage": "Required input is missing or invalid",
    "errorCode": "GENERIC0002"
  }
                
Show full

Sample Response: HTTP 500

Server side failure

Copied!
  {
    "errorMessage": "Unable to create alert policy due to internal error",
    "errorCode": "INTERNAL_ERROR"
  }
                
Show full

Duration: 1 minute | Threshold: 30 | Lock period: 5 minutes

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.