Skip to main content

Monitors API

List Monitors

GET /api/v1/monitors
Response:
{
  "monitors": [
    {
      "id": "mon_abc123",
      "name": "Production API",
      "type": "http",
      "url": "https://api.example.com/health",
      "status": "up",
      "check_interval": 60,
      "regions": ["nyc", "london", "singapore"],
      "last_check_at": "2024-01-15T10:30:00Z",
      "response_time_ms": 145
    }
  ]
}

Create Monitor

POST /api/v1/monitors
Request:
{
  "name": "Production API",
  "type": "http",
  "url": "https://api.example.com/health",
  "check_interval": 60,
  "regions": ["nyc", "london", "singapore"],
  "expected_status": 200,
  "timeout": 10,
  "headers": {
    "Authorization": "Bearer token123"
  }
}

Get Monitor

GET /api/v1/monitors/:id
Response:
{
  "id": "mon_abc123",
  "name": "Production API",
  "type": "http",
  "url": "https://api.example.com/health",
  "status": "up",
  "check_interval": 60,
  "regions": ["nyc", "london", "singapore"],
  "last_check_at": "2024-01-15T10:30:00Z",
  "response_time_ms": 145,
  "uptime": {
    "24h": 100.0,
    "7d": 99.95,
    "30d": 99.90
  }
}

Update Monitor

PUT /api/v1/monitors/:id
Request:
{
  "check_interval": 30,
  "regions": ["nyc", "london", "singapore", "sydney"]
}

Delete Monitor

DELETE /api/v1/monitors/:id

Pause Monitor

POST /api/v1/monitors/:id/pause

Resume Monitor

POST /api/v1/monitors/:id/resume

Get Check History

GET /api/v1/monitors/:id/checks
Query Parameters:
  • since - Start time (ISO 8601)
  • until - End time (ISO 8601)
  • region - Filter by region
  • status - Filter by status (up, down)
Response:
{
  "checks": [
    {
      "id": "chk_xyz789",
      "region": "nyc",
      "status": "up",
      "response_time_ms": 145,
      "status_code": 200,
      "checked_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 100,
    "total": 1440
  }
}