/v2/monitoring/alertsCreate an alert policy
Creates an alert policy that monitors a selected metric for droplets, load balancers, databases, or autoscale pools. Set type, entities, and tags to define what the policy monitors; when both entities and tags are empty, it applies to all entities of the selected type in the account. A 200 response returns the alert policy, including its generated UUID.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Alert policy configuration. Include all required fields: type, description, compare, value, window, entities, tags, alerts, and enabled.
A 401 is returned when authentication credentials are invalid, a 429 when the API rate limit is exceeded, and a 500 when a server error occurs. The body requires type, description, compare, value, window, entities, tags, alerts, and enabled; compare must be GreaterThan or LessThan, and window must be 5m, 10m, 30m, or 1h. Include both slack and email in alerts, and ensure each Slack integration includes url and channel.