# Create an alert profile with metric rules and notification settings Creates a new alert profile and returns the generated profile identifier. ## Endpoint `POST` `/intelligence/api/alerts/addPolicy` ## Request URL `https://{serverurl}/intelligence/api/alerts/addPolicy` [{serverurl}](https://www.manageengine.com/products/desktop-central/help/api/cloud/oauth-authentication-endpoint-domain.html) ### Scope `DesktopCentralCloud.DEX.CREATE` ### Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** (`string`, Mandatory): `application/alertRuleDetails.v1+json` - **Accept** (`string`, Mandatory): `application/alertRuleAdded.v1+json` ### Request Body `application/json` - JSON Object - **ruleName** (`string`, Optional): Unique alert profile name - **description** (`string`, Optional): Profile description - **rules** (`JSON Array`, Optional): List of metric rule definitions - **alertTypeJSON** (`JSON Object`, Optional): Alert type and grouped threshold details - **monitoringInterval** (`string`, Optional): Monitoring interval in minutes - **priority** (`string`, Optional): Alert priority. Allowed values: Critical, High, Medium, Low - **coolOffPeriod** (`string`, Optional): Cool-off period in minutes - **notification** (`JSON Object`, Optional): Notification configuration details - **enabled** (`boolean`, Optional): Whether notification is enabled for the profile - **notificationGroupId** (`long`, Optional): Notification group identifier when available - **email** (`JSON Object`, Optional): Email notification channel details ## Sample Request ```curl 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 ```json { "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" } ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - JSON Object - **alertProfileId** (`long`): Generated alert profile identifier - **Message** (`string`): Localized success message ### HTTP Code 400 Response Body — `application/json` - JSON Object - **errorCode** (`string`): Validation error code for add policy request - **errorMessage** (`string`): Validation failure message for add policy request ### HTTP Code 500 Response Body — `application/json` - JSON Object - **errorCode** (`string`): Internal server error code for add policy operation - **errorMessage** (`string`): Internal server error message for add policy operation ## Possible Response Codes - `200` HTTP code - `400` HTTP code - `500` HTTP code ## Sample Response: HTTP 200 Profile created successfully ```json { "alertProfileId": 1051, "Message": "High CPU Spike created successfully" } ``` ## Sample Response: HTTP 400 Missing mandatory request data ```json { "errorMessage": "Required input is missing or invalid", "errorCode": "GENERIC0002" } ``` ## Sample Response: HTTP 500 Server side failure ```json { "errorMessage": "Unable to create alert policy due to internal error", "errorCode": "INTERNAL_ERROR" } ``` ## Rate Limits **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.