Monitors API Reference

Possible Values for fields

Monitor Location

ValueDescription
US_EAST_1N. Virginia
EU_CENTRAL_1Frankfurt
AP_NORTHEAST_1Tokyo
AP_SOUTHEAST_2Sydney

Monitor Alert Types

ValueDescription
INCIDENTIncident alert
EMAILEmail alert
SMSSMS alert
SLACKSlack alert
DISCORDDiscord alert
MICROSOFT_TEAMSMicrosoft Teams alert
PHONE_CALLPhone call alert
WEBHOOKWebhook alert

Check Inserted Logs

Endpoint:

GET /monitors/check_inserted_logs

Example request

GET /monitors/check_inserted_logs

Example response

{
"message": "10 logs inserted in the last five minutes"
}

Get Monitors

You can use this endpoint to find and navigate through a list of all the existing monitors.

Endpoint:

GET /:page_id/monitors

Query Parameters

ParameterTypeDefault ValueDescription
limitnumber100The number of monitors per page.
searchstringnullSearch term for filtering results.
statusenumnullStatus filter ('UP', 'DOWN', 'UNKNOWN', 'DEGRADED').

Example request

GET /1/monitors?limit=3&page=2&status=DOWN

Example response

{
"monitors": [
{...monitor objects}
],
total: 10,
page: 3,
totalPages: 5,
limit: 2
}

Create a Monitor

Endpoint:

POST /monitors

Example request

{
"pageId": "page123",
"url": "https://example.com",
"httpMethod": "GET",
"body": null,
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"queryParams": {
"search": "test",
"limit": "10"
},
"basicAuth": {
"username": "user",
"password": "password"
},
"type": "HTTP",
"assertions": [
{
"id": "assertion1",
"type": "STATUS_CODE",
"comparison": "EQUALS",
"selector": null,
"value": "200"
}
],
"alerts": ["alert-id-1", "alert-id-2"],
"name": "Example Monitor",
"locations": "US_EAST_1",
"checksInterval": 300,
"createComponent": true,
"createMetric": true,
"onFail": {
"createIncident": true,
"createOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
},
"onRecover": {
"resolveIncident": true,
"resolveOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
}
}

Example response

{
"monitor": {
"pageId": "page123",
"url": "https://example.com",
"httpMethod": "GET",
"body": null,
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"queryParams": {
"search": "test",
"limit": "10"
},
"basicAuth": {
"username": "user",
"password": "password"
},
"type": "HTTP",
"assertions": [
{
"id": "assertion1",
"type": "STATUS_CODE",
"comparison": "EQUALS",
"selector": null,
"value": "200"
}
],
"alerts": ["alert1", "alert2"],
"name": "Example Monitor",
"locations": "US_EAST_1",
"checksInterval": 300,
"createComponent": true,
"createMetric": true,
"onFail": {
"createIncident": true,
"createOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
},
"onRecover": {
"resolveIncident": true,
"resolveOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
},
"createdAt": "2023-08-08T12:00:00Z",
"updatedAt": "2023-08-08T12:00:00Z"
},
"message": "Monitor created successfully"
}

Update a Monitor

Endpoint:

PUT /monitors/:id

Example request

{
"url": "https://updated.com",
"name": "Updated Monitor Name"
}

Example response

{
"monitor": {
"pageId": "page123",
"url": "https://updated.com",
"httpMethod": "GET",
"body": null,
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer token"
},
"queryParams": {
"search": "test",
"limit": "10"
},
"basicAuth": {
"username": "user",
"password": "password"
},
"type": "HTTP",
"assertions": [
{
"id": "assertion1",
"type": "STATUS_CODE",
"comparison": "EQUALS",
"selector": null,
"value": "200"
}
],
"alerts": ["alert1", "alert2"],
"name": "Updated Monitor Name",
"locations": "US_EAST_1",
"checksInterval": 300,
"createComponent": true,
"createMetric": true,
"onFail": {
"createIncident": true,
"createOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
},
"onRecover": {
"resolveIncident": true,
"resolveOutageDuration": true,
"publishIncident": true,
"notifySubscribers": true
},
"createdAt": "2023-08-08T12:00:00Z",
"updatedAt": "2023-08-08T12:00:00Z"
},
"message": "Monitor created successfully"
}

Delete a Monitor

Endpoint:

DELETE /monitors/:id

Example request

DELETE /monitors/monitor-id-1

Example response

{
"message": "Monitor deleted successfully."
}

Get Monitor Logs

Endpoint:

GET /monitors/:id/logs

Query Parameters

ParameterTypeDefault ValueDescription
limitnumber100The number of items per page. Cannot exceed 1000.
pagenumber1The page number to retrieve.
monitorIdstring-The ID of the monitor.
locationstringnullThe location of the monitor.
createdAtstring | object | numbernullThe creation date. Can be a string, a number, or an object with gte and lte fields.
isSuccessfulbooleannullWhether the check was successful.
isSSLCheckbooleannullWhether the check is an SSL check.
httpStatusCodestringnullThe HTTP status code of the response.
status('UP', 'DOWN', 'UNKNOWN', 'DEGRADED')nullThe status of the monitor.
dnsTimestring | number | objectnullTime taken for DNS resolution.
tcpTimestring | number | objectnullTime taken for TCP connection.
tlsTimestring | number | objectnullTime taken for TLS handshake.
firstByteTimestring | number | objectnullTime taken for the first byte to be received.
downloadTimestring | number | objectnullTime taken for the download.
responseTimestring | number | objectnullTotal response time.
performanceTimestring | number | objectnullPerformance time.
accessabilityScorestring | number | objectnullAccessibility score.
seoScorestring | number | objectnullSEO score.
bestPracticesScorestring | number | objectnullBest practices score.
successfulAssertionsstring | number | objectnullNumber of successful assertions.
sortstringchronologicallyField to sort by.

Example request

GET /monitors/monitor-id-1/logs?limit=100&page=1

Example response

{
"monitorLogs": [
// {monitor log object},
// {monitor log object 2}
],
"total": 478,
"page": 1,
"totalPages": 5,
"limit": 100
}

Run Monitor Check by ID

Endpoint:

GET /monitors/:id/run

Query Parameters

ParameterTypeDefault ValueDescription
location'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2'-The location of the monitor. Must be one of the specified values.
retrybooleanfalseIndicates whether the operation should be retried. Optional.
monitorLogIdstringnullThe unique identifier of the monitor log. Optional.

Example request

GET /monitors/monitor-id-1/run?monitorId=abc123&location=US_EAST_1&retry=true&monitorLogId=log456

Example response

{
"status": "success",
"message": "Monitor check run successfully."
}

Create Monitor Alert

Endpoint:

POST /monitor-alerts

Example request

{
"type": "EMAIL",
"pageId": "page123",
"recipient": "user@example.com",
"recipientWorkspace": "workspace123",
"whenFails": true,
"whenRecovers": true,
"whenDegrades": false,
"whenSslExpires": true,
"sslExpiresInDays": 30,
"monitors": ["monitor1", "monitor2"],
"metadata": "Additional information about the alert"
}

Example response

{
"monitor": {
"id": "alert123",
"siteId": "site123",
"type": "EMAIL",
"recipient": "user@example.com",
"whenFails": true,
"whenRecovers": true,
"whenDegrades": false,
"whenSslExpires": true,
"sslExpiresInDays": 30,
"monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
"createdAt": "2023-08-08T12:00:00Z",
"updatedAt": "2023-08-08T12:00:00Z",
"metadata": "Additional information about the alert"
},
"message": "Monitor Alert created successfully"
}

Update Monitor Alert

Endpoint:

PUT /monitor-alerts/:id

Example request

{
"type": "EMAIL",
"monitors": ["monitor-1-id", "monitor-2-id", "monitor-3-id"]
}

Example response

{
"monitor": {
"type": "EMAIL",
"pageId": "page123",
"recipient": "user@example.com",
"recipientWorkspace": "workspace123",
"whenFails": true,
"whenRecovers": true,
"whenDegrades": false,
"whenSslExpires": true,
"sslExpiresInDays": 30,
"monitors": ["monitor-1-id", "monitor-2-id"],
"metadata": "Additional information about the alert"
},
"message": "Monitor alert updated successfully."
}

Get Monitor Alerts

Endpoint:

GET /:page_id/monitor-alerts

Query Parameters

ParameterTypeDefault ValueDescription
limitnumber100The number of items per page.
pagenumber1The page number to retrieve.

Example request

GET /1/monitor-alerts?limit=2&page=3

Example response

{
"monitorAlerts": [
{...monitor alert objects}
],
total: 27,
page: 3,
totalPages: 14,
limit: 2
}

Delete Monitor Alert

Endpoint:

DELETE /monitor-alerts/:id

Example request

DELETE /monitor-alerts/alert-id-1

Example response

{
"message": "Monitor alert deleted successfully."
}

Create Monitor Group

Endpoint:

POST /monitors-groups

Example request

{
"pageId": "page123",
"name": "Example Name",
"childId": "child456"
}

Example response

{
"monitor": {
"id": "group123",
"name": "Example Name",
"siteId": "site123",
"collapsed": false,
"monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
"groupId": "parentGroup123",
"children": [
{ "id": "childGroup1", "name": "Child Group 1" },
{ "id": "childGroup2", "name": "Child Group 2" }
],
"order": 1,
"createdAt": "2023-08-08T12:00:00Z",
"updatedAt": "2023-08-08T12:00:00Z",
"parents": ["parent1", "parent2"],
"componentId": "component123"
},
"message": "Monitor group created successfully."
}

Update Monitor Group

Endpoint:

PUT /monitors-groups/:id

Example request

{
"name": "Updated Monitor Group Name"
}

Example response

{
"monitor": {
"id": "group123",
"name": "Updated Monitor Group Name",
"siteId": "site123",
"collapsed": true,
"monitors": [{ "id": "monitor1" }, { "id": "monitor2" }],
"groupId": "parentGroup123",
"children": [
{ "id": "childGroup1", "name": "Child Group 1" },
{ "id": "childGroup2", "name": "Child Group 2" }
],
"order": 1,
"createdAt": "2023-08-08T12:00:00Z",
"updatedAt": "2023-08-08T12:00:00Z",
"parents": ["parent1", "parent2"],
"componentId": "component123"
},
"message": "Monitor group updated successfully."
}

Delete Monitor Group

Endpoint:

DELETE /monitors-groups/:id

Example request

DELETE /monitors-groups/group-id-1

Example response

{
"message": "Monitor group deleted successfully."
}

Add Monitors to Group

Endpoint:

POST /monitors-groups/:id/monitors

Example request

{
"monitors": ["monitor1", "monitor2", "monitor3"]
}

Example response

{
"message": "Monitors added to the group successfully."
}

Run Monitor Group Check

Endpoint:

GET /monitors-groups/:id/run

Query Parameters

ParameterTypeDefault ValueDescription
location'US_EAST_1', 'EU_CENTRAL_1', 'AP_NORTHEAST_1', 'AP_SOUTHEAST_2'-The location of the monitor. Must be one of the specified values.
retrybooleanfalseIndicates whether the operation should be retried. Optional.
monitorLogIdstringnullThe unique identifier of the monitor log. Optional.

Example request

GET /monitors-groups/group-id-1/run

Example response

{
"result": "OK",
"monitorLogId": "monitor-log-id-1"
}