Links

Monitors API

Manage your monitors using simple HTTP API.

Do you need help with the integration?

Let us know at [email protected].

Obtaining an API token

get
https://betteruptime.com
/api/v2/monitors
Listing all existing monitors
Example cURL
Example: Filter by URL
curl --request GET \
--url https://betteruptime.com/api/v2/monitors \
--header 'Authorization: Bearer YOUR_API_TOKEN'
curl --request GET \
--url https://betteruptime.com/api/v2/monitors?url=https://google.com \
--header 'Authorization: Bearer YOUR_API_TOKEN'
get
https://betteruptime.com
/api/v2/monitors/:monitor_id
Getting a single monitor
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/monitors/123456789 \
--header 'Authorization: Bearer YOUR_API_TOKEN'
get
https://betteruptime.com
/api/v2/monitors/:monitor_id/response-times
Getting monitor's response times
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/monitors/123456789/response-times \
--header 'Authorization: Bearer YOUR_API_TOKEN'
get
https://betteruptime.com
/api/v2/monitors/:monitor_id/sla
Getting monitor's availability summary
Example cURL
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'
post
https://betteruptime.com
/api/v2/monitors
Creating a new monitor
Example cURL
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,
"request_headers": [
{
"name": "X-Custom-Header",
"value": "custom header value"
}
]
}'
patch
https://betteruptime.com
/api/v2/monitors/:monitor_id
Updating an existing monitor
Example cURL — Change check_frequency only
Example cURL - Manage Custom Request Headers
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
}'
curl --request PATCH \
--url https://betteruptime.com/api/v2/monitors/225493 \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"request_headers": [
{ "name": "X-Create-New-Header", "value": "New Header Value" },
{ "id": "123", "name": "X-Update-Existing-Header-Name" },
{ "id": "456", "_destroy": true }
]
}'
delete
https://betteruptime.com
/api/v2/monitors/:monitor_id
Deleting an existing monitor
Example cURL
curl --request DELETE \
--url https://betteruptime.com/api/v2/monitors/225493 \
--header 'Authorization: Bearer YOUR_API_TOKEN'