Alerting & Response/Alert Rules
POSTAlertingSince 1.0SynchronousAuth Required
ValidateAlertRule
Validate an alert rule definition for correctness before saving
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
ruleObjectRequiredAlert rule input to validate
nameStringRule name to validate
Example: High CPU Usage
promqlStringPromQL expression for the rule
Example: avg(cpu_usage_percent) > 90
thresholdLongThreshold value for the rule
Example: 90
forStringDuration string for the for clause
Example: 5m
Responses
Endpoint
POST/api/v1/alerting/rules/validate
/api/v1/alerting/rules/validate
Request Example
curl -X POST '{host}/api/v1/alerting/rules/validate' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"rule":{"name":"High CPU Usage","promql":"avg(cpu_usage_percent) > 90","threshold":90.0,"for":"5m"}}'
Response Example
200{
"valid": true,
"promqlErrors": [],
"wouldFireNow": false,
"currentValue": 45.2,
"threshold": 90.0,
"nameConflict": false,
"validationErrors": []
}Change History
This API has no change history records yet.
