Skip to main content
PATCH
Update a monitor alert rule

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Path Parameters

monitorId
string
required

Monitor ID

Example:

"monitor_123"

alertRuleId
string
required

Alert rule ID

Example:

"monitorAlertRule_123"

Body

application/json
metricGroupId
string

A metric family this monitor scores. Only a rule that watches a metric family accepts it. Mutually exclusive with specificationId.

Minimum string length: 1
Example:

"metricGroup_123"

specificationId
string

A Specification this monitor binds. Only a rule that watches a Specification accepts it. Mutually exclusive with metricGroupId.

Minimum string length: 1
Example:

"specification_123"

window
enum<string>

The trailing window the rule evaluates

Available options:
FIFTEEN_MINUTES,
ONE_HOUR,
SIX_HOURS,
TWENTY_FOUR_HOURS
Example:

"ONE_HOUR"

badSessionScore
number | null

BAD_SESSION_COUNT only: a session counts as bad at or below this score. Must be null or left out for NO_SCORE_RATE.

Example:

0.5

threshold
number

The value the rule fires on, by type: a whole count of bad sessions for BAD_SESSION_COUNT, a percent above 0 and at most 100 for NO_SCORE_RATE

Example:

3

recipients
string[]

Email addresses notified when the rule fires (0 to 20). A rule needs at least one address or a webhookUrl.

Maximum array length: 20
Example:
webhookUrl
string | null

URL that receives a signed POST when an alert opens or recovers. It must use https, unless the deployment allows http. A Slack incoming-webhook URL posts a message to its channel. Write-only: responses show only its host and port. On update, null removes it and leaving it out keeps it. Read the signing secret with regenerate-alert-rule-webhook-secret.

Required string length: 1 - 2048
Example:

"https://hooks.slack.com/services/T000/B000/XXXX"

Response

Alert rule updated successfully