API Reference
Monitors

Monitors API

Create, read, update, and delete uptime monitors.

List Monitors

GET /api/v1/monitors

Retrieve all monitors for your organization.

Query Parameters

ParameterTypeDescription
activebooleanFilter by active status
limitintegerMaximum results (default: 50, max: 100)
offsetintegerPagination offset (default: 0)

Response

{
  "monitors": [
    {
      "id": "mon_abc123",
      "name": "Production API",
      "url": "https://api.example.com/health",
      "method": "GET",
      "checkType": "http",
      "frequency": 60,
      "timeout": 30,
      "expectedCode": 200,
      "active": true,
      "status": "up",
      "uptime24h": 99.95,
      "createdAt": "2024-01-01T00:00:00Z"
    }
  ],
  "count": 1
}

Example

curl -X GET "https://statly.live/api/v1/monitors?active=true" \
  -H "Authorization: Bearer sk_live_xxx"

Create Monitor

POST /api/v1/monitors

Create a new monitor.

Request Body

FieldTypeRequiredDescription
namestringYesDisplay name (max 100 chars)
urlstringYesURL to monitor
methodstringNoHTTP method (default: GET)
checkTypestringNohttp, tcp, dns, websocket, api
frequencyintegerNoCheck interval in seconds (60-3600)
timeoutintegerNoRequest timeout (1-120)
expectedCodeintegerNoExpected HTTP status (default: 200)
headersobjectNoCustom request headers
bodystringNoRequest body for POST/PUT
activebooleanNoEnable/disable (default: true)

Example

curl -X POST "https://statly.live/api/v1/monitors" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production API",
    "url": "https://api.example.com/health",
    "method": "GET",
    "frequency": 60,
    "timeout": 10,
    "expectedCode": 200
  }'

Response

{
  "id": "mon_abc123",
  "name": "Production API",
  "url": "https://api.example.com/health",
  "method": "GET",
  "checkType": "http",
  "frequency": 60,
  "timeout": 10,
  "expectedCode": 200,
  "active": true,
  "createdAt": "2024-01-15T12:00:00Z"
}

Get Monitor

GET /api/v1/monitors/{id}

Get details of a specific monitor, including recent heartbeats.

Path Parameters

ParameterTypeDescription
idstringMonitor ID

Response

{
  "id": "mon_abc123",
  "name": "Production API",
  "url": "https://api.example.com/health",
  "status": "up",
  "uptime24h": 99.95,
  "uptime7d": 99.90,
  "uptime30d": 99.85,
  "heartbeats": [
    {
      "timestamp": "2024-01-15T12:00:00Z",
      "status": "up",
      "responseTime": 145,
      "region": "us-east-1"
    }
  ]
}

Update Monitor

PATCH /api/v1/monitors/{id}

Update an existing monitor.

Request Body

All fields are optional. Only include fields you want to update.

curl -X PATCH "https://statly.live/api/v1/monitors/mon_abc123" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Name",
    "frequency": 120,
    "active": false
  }'

Response

Returns the updated monitor object.


Delete Monitor

DELETE /api/v1/monitors/{id}

Delete a monitor. This is a soft delete; the monitor is deactivated but data is retained.

Example

curl -X DELETE "https://statly.live/api/v1/monitors/mon_abc123" \
  -H "Authorization: Bearer sk_live_xxx"

Response

HTTP/1.1 204 No Content

Get Heartbeats

GET /api/v1/monitors/{id}/heartbeats

Get heartbeat history for a monitor.

Query Parameters

ParameterTypeDescription
fromstringStart time (ISO 8601)
tostringEnd time (ISO 8601)
limitintegerMax results (default: 100, max: 1000)

Example

curl -X GET "https://statly.live/api/v1/monitors/mon_abc123/heartbeats?limit=50" \
  -H "Authorization: Bearer sk_live_xxx"

Response

{
  "heartbeats": [
    {
      "timestamp": "2024-01-15T12:00:00Z",
      "status": "up",
      "responseTime": 145,
      "region": "us-east-1"
    },
    {
      "timestamp": "2024-01-15T11:59:00Z",
      "status": "up",
      "responseTime": 132,
      "region": "eu-west-1"
    }
  ],
  "count": 50
}