Uptime API › Monitors
Create a monitor
Creates a monitor. name, type, interval_seconds and
timeout_seconds are required. url depends on the type:
| Type | url |
|---|---|
http, keyword |
An http:// or https:// URL. |
tcp |
host:port, [v6]:port, tcp://host:port, or an http(s) URL (port 80 or 443). |
icmp |
A host name or IP address. A port or URL is accepted and the host is used. |
heartbeat |
Not used. |
A new monitor is paused unless you send "is_active": true. Its
last_status is unknown until the first check.
A heartbeat monitor gets a ping_token at creation, which never
changes. Its job calls https://evohub.io/ping/{ping_token}.
Defaults when a field is left out or 0: expected_status 200,
failure_threshold 1, http_method GET,
ssl_expiry_threshold_days 30, re_alert_minutes 15, and for a
heartbeat grace_seconds 60.
team_id must be a team the caller is in, or "" for the whole
organization; otherwise 403 NOT_IN_TEAM.
Requires the uptime:monitor:write scope.
Authorization
Request body required
namestring requiredteam_idstringA team the caller is in, or""(the default) for the whole organization.typeMonitorType requiredurlstringThe target; see the table above. Not used byheartbeat.interval_secondsinteger requiredtimeout_secondsinteger requiredgrace_secondsintegerHeartbeat only. Defaults to 60.locationsarray of stringkeywordstringexpected_statusintegeris_activebooleanSendtrueto start checking at once.failure_thresholdintegerhttp_methodstringhttp_headersobjectRequest headers sent with every check, by name. Values are stored but never returned.http_bodystringhttp_auth_userstringhttp_auth_passwordstringBasic Auth password sent with every check. Stored but never returned; responses carryhas_http_auth_password.check_sslbooleanssl_expiry_threshold_daysintegertagsarray of stringgroup_idstringresponse_time_threshold_msintegeroncall_policy_idstringThe On-Call escalation policy its alerts go to.re_alert_minutesintegerassertionsarray of Assertionhttpmonitors only.Show Assertion properties
typestring requiredfieldstringoperatorstring requiredvaluestring
degraded_threshold_msinteger0or absent means never degraded.alert_on_degradedbooleansla_targetnumber0or absent means no target.
Responses
201
The monitor was created.
dataMonitorShow Monitor properties
idstringStarts withmon_.org_idstringteam_idstringThe owning team, or""for the whole organization.namestringurlstringThe target;""for a heartbeat monitor. Shown with credentials masked: userinfo becomes****:****@and the values oftoken,key,secret,password,sig,signature,auth,api_keyandaccess_tokenquery parameters (any case, or a name ending in_or-plus one of them) become****. Checks use the URL as entered.typeMonitorTypeinterval_secondsintegerHow often it is checked; for a heartbeat, how often a ping is expected.timeout_secondsintegerlocationsarray of stringProbe locations. Empty means EvoHub chooses.keywordstringText akeywordmonitor looks for in the body.expected_statusintegerThe status code an HTTP check expects when there are nostatus_codeassertions.is_activebooleanfalsewhile paused: no checks and no alerts.failure_thresholdintegerFailed checks in a row before the monitor is down.consecutive_failuresintegerlast_checked_atstring (date-time)last_statusMonitorStatussilenced_untilstring (date-time)Present on the list while a silence window mutes the monitor; when it ends.http_methodstringhttp_headersarray of objectThe request headers by name, sorted. A header's value is never returned, since it often carries a token.has_valuesays whether one is stored.namestringhas_valueboolean
http_bodystringhttp_auth_userstringhas_http_auth_passwordbooleanWhether a Basic Auth password is stored. The password itself is never returned.check_sslbooleanWarn before the TLS certificate expires.ssl_expiry_threshold_daysintegerDays before expiry to warn.ssl_expiry_daysintegerDays until the certificate expires, from the last check.tagsarray of stringgroup_idstringresponse_time_threshold_msintegeroncall_policy_idstringThe On-Call escalation policy its alerts go to.re_alert_minutesintegerMinutes between repeat alerts while down.grace_secondsintegerHeartbeat only. How late a ping may be.ping_tokenstringHeartbeat only. The job callshttps://evohub.io/ping/{ping_token}.last_ping_atstring (date-time)Heartbeat only.created_atstring (date-time)updated_atstring (date-time)assertionsarray of AssertionShow Assertion properties
typestring requiredfieldstringoperatorstring requiredvaluestring
degraded_threshold_msinteger | nullA passing check slower than this is degraded.alert_on_degradedbooleanRaise a lower-severity alert while degraded.consecutive_degradedintegersla_targetnumber | nullThe uptime percentage the monitor is held to, e.g. 99.9.last_failure_reasonstringlast_failure_atstring (date-time)uptime_percentobjectUptime percentage per window. A single monitor carries24h,7d,30dand90d; the list carries only30d.nullfor a window with no checks. Absent for heartbeat monitors.sla_breached_30dbooleanThe 30-day uptime is belowsla_target. Absent without a target or 30-day data, and for heartbeat monitors.
400
The body is not JSON (INVALID_JSON), or a field breaks a rule
(VALIDATION_ERROR; the message names it): a missing required
field, a value out of range, a url the type cannot probe,
assertions on a non-http monitor or an invalid assertion,
degraded_threshold_ms outside 1–60000, or sla_target outside
(0, 100].
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
401
No API key was sent, or it is unknown, revoked or expired (UNAUTHORIZED).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
403
The key lacks uptime:monitor:write (FORBIDDEN), or team_id names a team the caller is not in (NOT_IN_TEAM).
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
429
Too many requests (RATE_LIMITED). Wait for Retry-After seconds.
Retry-AfterintegerSeconds to wait before retrying.
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
500
Something went wrong on EvoHub's side (INTERNAL_ERROR). Retry later.
errorobject requiredcodestring requiredmessagestring requiredrequest_idstring
Example request
curl -X POST 'https://evohub.io/api/v1/monitors' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"url": "https://api.acme.example/health",
"name": "Checkout API",
"tags": [
"checkout",
"production"
],
"type": "http",
"is_active": true,
"assertions": [
{
"type": "status_code",
"value": "200-299",
"operator": "in"
},
{
"type": "json",
"field": "$.status",
"value": "ok",
"operator": "equals"
}
],
"sla_target": 99.9,
"timeout_seconds": 10,
"interval_seconds": 60,
"failure_threshold": 2,
"degraded_threshold_ms": 1500
}'