Let us know at hello@betteruptime.com.
Please, see Obtaining an API token.
YOUR_API_TOKEN
status
attribute can have one of the following values:
paused
- the monitor was paused
pending
- the monitor was just created and it's waiting for the first check
maintenance
- the monitor is paused because it is currently in its maintenance period
up
- checks are passing
validating
- service seems to be back up, but the recovery_period
since the last failed check still hasn't passed
down
- checks are failing
If an escalation policy is set (policy_id
) then the simple escalation policy settings (call
, sms
, email
, push
) are ignored.{"data": [{"id": "2","type": "monitor","attributes": {"url": "https://betteruptime.com","pronounceable_name": "BetterUptime homepage","monitor_type": "keyword","monitor_group_id": "12345","last_checked_at": "2020-09-01T14:17:46.000Z","status": "up","required_keyword": "We call you","verify_ssl": true,"check_frequency": 30,"call": true,"sms": true,"email": true,"push": true,"team_wait": null,"http_method": "get","request_timeout": 15,"recovery_period": 0,"request_body": "","paused_at": null,"created_at": "2020-02-18T13:38:16.586Z","updated_at": "2020-09-08T13:10:20.202Z","ssl_expiration": 7,"domain_expiration": 14,"regions": ["us", "eu", "as", "au"],"port": null}}],"pagination": {"first": "https://betteruptime.com/api/v2/monitors?page=1","last": "https://betteruptime.com/api/v2/monitors?page=16","prev": null,"next": "https://betteruptime.com/api/v2/monitors?page=2"}}
curl --request GET \--url https://betteruptime.com/api/v2/monitors \--header 'Authorization: Bearer YOUR_API_TOKEN'
YOUR_API_TOKEN
status
attribute can have one of the following values:
paused
- the monitor was paused
pending
- the monitor was just created and it's waiting for the first check
maintenance
- the monitor is paused because it is currently in its maintenance period
up
- checks are passing
validating
- service seems to be back up, but the recovery_period
since the last failed check still hasn't passed
down
- checks are failing
If an escalation policy is set (policy_id
), then the simple escalation policy settings (call
, sms
, email
, phone
) are ignored.{"data": {"id": "123456789","type": "monitor","attributes": {"url": "https://betteruptime.com","pronounceable_name": "BetterUptime homepage","monitor_type": "keyword","monitor_group_id": "12345","last_checked_at": "2020-09-01T14:17:46.000Z","status": "up","required_keyword": "We call you","verify_ssl": true,"check_frequency": 30,"call": true,"sms": true,"email": true,"push": true,"team_wait": null,"http_method": "get","request_timeout": 15,"recovery_period": 0,"request_body": "","paused_at": null,"created_at": "2020-02-18T13:38:16.586Z","updated_at": "2020-09-08T13:10:20.202Z","ssl_expiration": 7,"domain_expiration": 14,"regions": ["us", "eu", "as", "au"],"port": null}}}
{"errors": "Resource with provided ID was not found"}
curl --request GET \--url https://betteruptime.com/api/v2/monitors/123456789 \--header 'Authorization: Bearer YOUR_API_TOKEN'
YOUR_API_TOKEN
{"data": {"id": "270985","type": "monitor_response_times","attributes": {"regions": [{"region": "us","response_times": [{"at": "2021-01-24T15:06:03.727Z","response_time": 1.25366666666667},{"at": "2021-01-24T15:06:33.658Z","response_time": 1.239},{"at": "2021-01-24T15:07:05.097Z","response_time": 1.26},{"at": "2021-01-24T15:07:34.961Z","response_time": 1.20933333333333}]},{"region": "eu","response_times": [{"at": "2021-01-24T15:06:03.727Z","response_time": 0.58966666666667},{"at": "2021-01-24T15:06:33.658Z","response_time": 0.611},{"at": "2021-01-24T15:07:05.097Z","response_time": 0.53},{"at": "2021-01-24T15:07:34.961Z","response_time": 0.546}]}]}}}
curl --request GET \--url https://betteruptime.com/api/v2/monitors/123456789/response-times \--header 'Authorization: Bearer YOUR_API_TOKEN'
YOUR_API_TOKEN
2021-01-26
)2021-01-27
)total_downtime
, longest_incident
, and average_incident
are in seconds.{"data": {"id": "258338","type": "monitor_sla","attributes": {"availability": 99.98,"total_downtime": 600,"number_of_incidents": 3,"longest_incident": 300,"average_incident": 200}}}
from
and to
dates are invalid (e.g., the start date is in the future or the end date is before the start date).{"errors": "The data range is invalid. The date format could not be parsed, the start time is in the future, or the end time is after the start time."}
curl --request GET \--url https://betteruptime.com/api/v2/monitors/123456789/sla?from=2021-01-26&to=2021-01-27 \--header 'Authorization: Bearer YOUR_API_TOKEN'
YOUR_API_TOKEN
true
to pause monitoring — we won't notify you about downtime.
Set to false
to resume monitoring."25,465,587"
for smtp).["us", "eu", "as", "au"]
or any subset of these regions.{"data": {"id": "238","type": "endpoint","attributes": {"url": "https://betteruptime.com","pronounceable_name": "BetterUptime homepage","monitor_type": "keyword","monitor_group_id": "12345","last_checked_at": "2020-09-01T14:17:46.000Z","status": "up","required_keyword": "We call you","verify_ssl": true,"check_frequency": 30,"call": true,"sms": true,"email": true,"team_wait": null,"http_method": "get","request_timeout": 15,"recovery_period": 0,"request_body": "","paused_at": null,"created_at": "2020-02-18T13:38:16.586Z","updated_at": "2020-09-08T13:10:20.202Z","ssl_expiration": 7,"domain_expiration": 14,"regions": ["us", "eu", "as", "au"],"port": null}}}
{"errors": {"base": ["URL is invalid."]}}
curl --request POST \--url https://betteruptime.com/api/v2/monitors \--header 'Authorization: Bearer YOUR_API_TOKEN' \--header 'Content-Type: application/json' \--data '{"monitor_type": "status","url": "https://facebook.com","pronounceable_name": "Facebook homepage","email": true,"sms": true,"call": true,"check_frequency": 30}'
url
)YOUR_API_TOKEN
true
to pause monitoring — we won't notify you about downtime.
Set to false
to resume monitoring."25,465,587"
for smtp).["us", "eu", "as", "au"]
or any subset of these regions.{"data": {"id": "2","type": "monitor","attributes": {"url": "https://betteruptime.com","pronounceable_name": "BetterUptime homepage","monitor_type": "keyword","monitor_group_id": "12345","last_checked_at": "2020-09-01T14:17:46.000Z","status": "up","required_keyword": "We call you","verify_ssl": true,"check_frequency": 30,"call": true,"sms": true,"email": true,"team_wait": null,"http_method": "get","request_timeout": 15,"recovery_period": 0,"request_body": "","paused_at": null,"created_at": "2020-02-18T13:38:16.586Z","updated_at": "2020-09-08T13:10:20.202Z","ssl_expiration": 7,"domain_expiration": 14,"regions": ["us", "eu", "as", "au"],"port": null}}}
{"errors": {"base": ["URL is invalid."]}}
curl --request PATCH \--url https://betteruptime.com/api/v2/monitors/225493 \--header 'Authorization: Bearer YOUR_API_TOKEN' \--header 'Content-Type: application/json' \--data '{"check_frequency": 60}'
YOUR_API_TOKEN
curl --request DELETE \--url https://betteruptime.com/api/v2/monitors/225493 \--header 'Authorization: Bearer YOUR_API_TOKEN'