Skip to content

Monitors API Reference

This guide provides detailed information about the Monitors API endpoints.

List Monitors

Retrieve a list of all monitors.

http
GET /monitors

Query Parameters

ParameterTypeDescription
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 20)
statusstringFilter by status (active/inactive)

Response

json
{
  "data": [
    {
      "id": "mon_123",
      "name": "Website Uptime",
      "type": "http",
      "status": "active",
      "url": "https://example.com",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 1
  }
}

Create Monitor

Create a new monitor.

http
POST /monitors

Request Body

json
{
  "name": "Website Uptime",
  "type": "http",
  "url": "https://example.com",
  "interval": 60,
  "regions": ["us-east", "eu-west"]
}

Response

json
{
  "data": {
    "id": "mon_123",
    "name": "Website Uptime",
    "type": "http",
    "status": "active",
    "url": "https://example.com",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Get Monitor

Retrieve details of a specific monitor.

http
GET /monitors/:id

Response

json
{
  "data": {
    "id": "mon_123",
    "name": "Website Uptime",
    "type": "http",
    "status": "active",
    "url": "https://example.com",
    "created_at": "2024-01-01T00:00:00Z",
    "last_check": {
      "status": "up",
      "response_time": 150,
      "checked_at": "2024-01-01T00:01:00Z"
    }
  }
}

Update Monitor

Update an existing monitor.

http
PUT /monitors/:id

Request Body

json
{
  "name": "Updated Monitor Name",
  "interval": 120,
  "regions": ["us-east", "eu-west", "ap-south"]
}

Response

json
{
  "data": {
    "id": "mon_123",
    "name": "Updated Monitor Name",
    "type": "http",
    "status": "active",
    "url": "https://example.com",
    "created_at": "2024-01-01T00:00:00Z"
  }
}

Delete Monitor

Delete a monitor.

http
DELETE /monitors/:id

Response

json
{
  "data": {
    "id": "mon_123",
    "deleted": true
  }
}

Error Codes

CodeDescription
monitor_not_foundThe specified monitor does not exist
invalid_requestThe request parameters are invalid
rate_limitToo many requests

Next Steps