Monitor Groups API

Manage your monitor groups using a simple HTTP API.

Do you need help with the integration?

Let us know at hello@betteruptime.com.

Obtaining an API token

Please, see Obtaining an API token.

get
Listing all existing monitor groups

https://betteruptime.com/api/v2/monitor-groups
Returns a list of all your monitor groups.
Request
Response
Request
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
200: OK
Returns list of existing monitor groups
{
"data": [
{
"id": "95251342",
"type": "monitor_group",
"attributes": {
"name": "Backend services",
"sort_index": null,
"created_at": "2020-10-03T20:20:43.547Z",
"updated_at": "2020-10-03T20:20:43.547Z",
"paused": true
}
}
],
"pagination": {
"first": "https://betteruptime.com/api/v2/monitor-groups?page=1",
"last": "https://betteruptime.com/api/v2/monitor-groups?page=1",
"prev": null,
"next": null
}
}
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/monitor-groups \
--header 'Authorization: Bearer YOUR_API_TOKEN'

get
Getting a single monitor group

https://betteruptime.com/api/v2/monitor-groups/:monitor_group_id
Returns a single monitor group
Request
Response
Request
Path Parameters
monitor_group_id
required
string
The ID of the monitor group you want to get.
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
200: OK
Returns a single monitor group
{
"data": {
"id": "95251342",
"type": "monitor_group",
"attributes": {
"name": "Backend services",
"sort_index": null,
"created_at": "2020-10-03T20:20:43.547Z",
"updated_at": "2020-10-03T20:20:43.547Z",
"paused": true
}
}
}
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/monitor-groups/95251342 \
--header 'Authorization: Bearer YOUR_API_TOKEN'

get
Getting all monitors of a monitor group

https://betteruptime.com/api/v2/monitor-groups/:monitor_group_id/monitors
Returns monitors belonging to the given monitor group.
Request
Response
Request
Path Parameters
monitor_group_id
required
string
The ID of the parent monitor group.
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
200: OK
{
"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
}
}
],
"pagination": {
"first": "https://betteruptime.com/api/v2/monitor-groups/95251342/monitors?page=1",
"last": "https://betteruptime.com/api/v2/monitor-groups/95251342/monitors?page=16",
"prev": null,
"next": "https://betteruptime.com/api/v2/monitor-groups/95251342/monitors?page=2"
}
}
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/monitor-groups/95251342/monitors \
--header 'Authorization: Bearer YOUR_API_TOKEN'

post
Creating a new monitor group

https://betteruptime.com/api/v2/monitor-groups
Returns a newly created monitor group or validation errors.
Request
Response
Request
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Content-Type
required
string
application/json
Form Data Parameters
paused
optional
boolean
Set to true to pause monitoring for any existing monitors in the group — we won't notify you about downtime. Set to false to resume monitoring for any existing monitors in the group.
name
optional
string
A name of the group that you can see in the dashboard.
sort_index
optional
integer
Set sort_index to specify how to sort your monitor groups.
Response
200: OK
Returns newly created monitor
{
"data": {
"id": "95251342",
"type": "monitor_group",
"attributes": {
"name": "Backend services",
"sort_index": null,
"created_at": "2020-10-03T20:20:43.547Z",
"updated_at": "2020-10-03T20:20:43.547Z",
"paused": true
}
}
}
Example cURL
Example cURL
curl --request POST \
--url https://betteruptime.com/api/v2/monitor-groups \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "Backend services"
}'

patch
Updating an existing monitor group

https://betteruptime.com/api/v2/monitor-groups/:monitor_group_id
Update the attributes of an existing monitor group. Send only parameters you wish to change (eg. name)
Request
Response
Request
Path Parameters
monitor_group_id
required
string
The ID of the monitor group you want to update
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Content-Type
required
string
application/json
Form Data Parameters
paused
optional
boolean
Set to true to pause monitoring for any existing monitors in the group — we won't notify you about downtime. Set to false to resume monitoring for any existing monitors in the group.
name
optional
string
A name of the group that you can see in the dashboard
sort_index
optional
integer
Set sort_index to specify how to order your monitor groups.
Response
200: OK
Returns updated monitor data
{
"data": {
"id": "95251342",
"type": "monitor_group",
"attributes": {
"name": "Backend services 2",
"sort_index": null,
"created_at": "2020-10-03T20:20:43.547Z",
"updated_at": "2020-10-03T20:20:43.547Z",
"paused": true
}
}
}
Example cURL — Change name only
Example cURL — Change name only
curl --request PATCH \
--url https://betteruptime.com/api/v2/monitor-groups/95251342 \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"name": "Backend services 2"
}'

delete
Deleting an existing monitor group

https://betteruptime.com/api/v2/monitor-groups/:monitor_group_id
Permanently deletes an existing monitor group.
Request
Response
Request
Path Parameters
monitor_group_id
required
string
The ID of the monitor group you want to delete All monitors in this group will be kept intact
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
200: OK
Returns empty body
Example cURL
Example cURL
curl --request DELETE \
--url https://betteruptime.com/api/v2/monitor-groups/95251342 \
--header 'Authorization: Bearer YOUR_API_TOKEN'