Skip to content

Alerts

Rules an environment is watched for, and the alerts they raise. Authentication, errors and limits are on the overview.

List alert channels

GET /api/v1/projects/{project_id}/environments/{environment_id}/alert-channels

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Responses

StatusDescriptionBody
200Oldest firstAlertChannel[]
401No API key, or it is invalid or revokedProblem
404No such environment, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Create alert channel

POST /api/v1/projects/{project_id}/environments/{environment_id}/alert-channels

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Request body

JSON, CreateAlertChannel.

FieldTypeDescription
targetstringA member's email address, or the webhook's URL.
typeChannelTypeRead after the caller's access is checked.

Responses

StatusDescriptionBody
201Created; alerts opened from now on are sent to itAlertChannel
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such environment, or no accessProblem
409The environment already sends to itProblem
422Not a member's address, or not a public URLProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Delete alert channel

DELETE /api/v1/projects/{project_id}/environments/{environment_id}/alert-channels/{alert_channel_id}

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
alert_channel_id requiredpathstringach_ ID

Responses

StatusDescriptionBody
204Deleted; notices already queued for it are dropped
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such channel, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Test alert channel

POST /api/v1/projects/{project_id}/environments/{environment_id}/alert-channels/{alert_channel_id}/test

Send it a test notice.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
alert_channel_id requiredpathstringach_ ID

Responses

StatusDescriptionBody
202Queued; it is sent within seconds
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such channel, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

List alert rules

GET /api/v1/projects/{project_id}/environments/{environment_id}/alert-rules

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Responses

StatusDescriptionBody
200Oldest firstAlertRule[]
401No API key, or it is invalid or revokedProblem
404No such environment, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Create alert rule

POST /api/v1/projects/{project_id}/environments/{environment_id}/alert-rules

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Request body

JSON, CreateAlertRule.

FieldTypeDescription
destination_idstring | nulldst_ ID, for a destination rule; every destination when left out.
enabledboolean | null
kindAlertKindRead after the caller's access is checked, so an unknown kind is a 422 only for someone who may make rules.
minutesinteger (int32) | nullDefault 10 for destination_failing, 5 for verification_failures, 60 otherwise.
source_idstring | nullsrc_ ID, for a source rule; every source when left out.
thresholdinteger (int32) | nullDefault 10 for verification_failures, 1 for dead_letters, 80 for quota.

Responses

StatusDescriptionBody
201Created; evaluated from the next minuteAlertRule
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such environment, or no accessProblem
422An invalid subject, window or thresholdProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Delete alert rule

DELETE /api/v1/projects/{project_id}/environments/{environment_id}/alert-rules/{alert_rule_id}

The rule and its alerts.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
alert_rule_id requiredpathstringalr_ ID

Responses

StatusDescriptionBody
204Deleted
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such rule, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Get alert rule

GET /api/v1/projects/{project_id}/environments/{environment_id}/alert-rules/{alert_rule_id}

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
alert_rule_id requiredpathstringalr_ ID

Responses

StatusDescriptionBody
200The ruleAlertRule
401No API key, or it is invalid or revokedProblem
404No such rule, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Update alert rule

PATCH /api/v1/projects/{project_id}/environments/{environment_id}/alert-rules/{alert_rule_id}

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
alert_rule_id requiredpathstringalr_ ID

Request body

JSON, UpdateAlertRule.

FieldTypeDescription
enabledboolean | null
minutesinteger (int32) | null
thresholdinteger (int32) | null

Responses

StatusDescriptionBody
200UpdatedAlertRule
401No API key, or it is invalid or revokedProblem
403A viewerProblem
404No such rule, or no accessProblem
422An invalid window or thresholdProblem
429Over the key's rate limit; Retry-After says when to try againProblem

List alerts

GET /api/v1/projects/{project_id}/environments/{environment_id}/alerts

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
openquerybooleanOnly alerts still open.
limitqueryinteger (int64)At most this many, 1 to 100; default 50.

Responses

StatusDescriptionBody
200Open alerts first, then the latest resolvedAlert[]
401No API key, or it is invalid or revokedProblem
404No such environment, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem