POST
Create alert rule

Authorizations

X-API-KEY
string
header
required

Your Atatus API key. You can also send it as the api_key query parameter or, for POST/PUT requests, in the request body.

Body

application/json
name
string
required

Rule name.

Example:

"High CPU - prod web"

queries
object[]
required

One or more queries. At least one is required.

evaluationOptions
object
required

How much data each evaluation looks at, and how long a breach must hold.

description
string

Longer description.

alertType
enum<string>

Defaults to threshold.

Available options:
threshold,
anomaly,
forecast,
rateChange,
outlier
priority
enum<string>

Defaults to P3.

Available options:
P1,
P2,
P3,
P4,
P5
lifecycleStatus
enum<string>

A label for filtering rules. It does not affect evaluation; set enabled to false to stop a rule from evaluating. Defaults to published.

Available options:
published,
draft,
archived
enabled
boolean

Defaults to true.

formulas
object[]

Arithmetic expressions over the queries' name labels, for ratios such as an error rate.

thresholds
object

Threshold rules: at least one of warning or critical is required. Replaced as a whole object on update.

operator
enum<string>

Comparison direction. Defaults to above.

Available options:
above,
below,
equal,
notEqual,
aboveOrEqual,
belowOrEqual
anomalyConfig
object

anomaly rules: algorithm, sensitivity (1 to 5), direction, and adaptive baseline window.

forecastConfig
object

forecast rules: forecastDuration to project forward and the threshold the projection must not cross.

rateChangeConfig
object

rateChange rules: comparisonWindow, threshold, and changeType (absolute or percentage).

outlierConfig
object

outlier rules: statistical algorithm such as mad, plus threshold and direction.

grouping
object

Evaluate each distinct combination of the queries' groupBy values as its own series, with its own state and history.

tags
string[]

Free-form labels, usable to scope a maintenance window to a group of rules.

message
string

Body sent with this rule's notifications.

runbookUrl
string

Runbook to surface alongside the alert.

notifications
object
alertOptions
object

Re-notification behaviour: renotifyInterval (minutes), renotifyOccurrences, renotifyStatuses, escalationMessage.

incidents
object
metadata
object

Free-form ownership context: team, service, environment.

Response

Rule created

success
boolean
data
object

The created rule.