POST
/v2/uptime/checks/{check_id}/alertsCreate a New Alert
To create an Uptime alert, send a POST request to /v2/uptime/checks/$CHECK_ID/alerts specifying the attributes
in the table below in the JSON body.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
check_idstringrequired
A unique identifier for a check.
The ''type'' field dictates the type of alert, and hence what type of value to pass into the threshold property.
| Type | Description | Threshold Value |
|---|---|---|
latency | alerts on the response latency | milliseconds |
down | alerts on a target registering as down in any region | N/A (Not required) |
down_global | alerts on a target registering as down globally | N/A (Not required) |
ssl_expiry | alerts on a SSL certificate expiring within $threshold days | days |
idstringoptional
A unique ID that can be used to identify and reference the alert.
namestringrequired
A human-friendly display name.
typestringrequired
The type of alert.
thresholdintegeroptional
The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
comparisonstringoptional
The comparison operator used against the alert's threshold.
notificationsobjectrequired
The notification settings for a trigger alert.
periodstringrequired
Period of time the threshold must be exceeded to trigger the alert.
201The response will be a JSON object with a key called `alert`. The value of this will be an object that contains the standard attributes associated with an uptime alert.
alertobjectoptional
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404The resource was not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Error handling
A 401 is returned: Authentication failed due to invalid credentials. A 404 is returned: The resource was not found. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.