Back to Documentation

Monitors API

Create, update, and manage uptime monitors programmatically. Monitor HTTP endpoints, TCP ports, DNS records, and more.

Base URL
https://wakestack.co.uk/api

All endpoints require authentication. See Authentication for details.

The Monitor Object
Represents an uptime monitor configuration and status
{
  "id": "mon_a1b2c3d4e5f6",
  "name": "API Health Check",
  "url": "https://api.example.com/health",
  "type": "http",
  "method": "GET",
  "interval": 60,
  "timeout": 30,
  "expectedStatusCode": 200,
  "headers": {"Authorization": "Bearer token"},
  "body": null,
  "regions": ["us-east", "eu-west"],
  "alertThreshold": 3,
  "enabled": true,
  "status": "operational",
  "lastCheckedAt": "2024-01-15T10:30:00Z",
  "lastResponseTime": 145,
  "consecutiveFailures": 0,
  "uptimePercentage": 99.95,
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Attributes

FieldTypeDescription
idstringUnique identifier
namestringDisplay name
urlstringURL or host to monitor
typestringhttp, tcp, ping, or dns
methodstringHTTP method (GET, POST, etc.)
intervalintegerCheck interval in seconds
timeoutintegerRequest timeout in seconds
statusstringoperational, degraded, down, or pending
regionsarrayMonitoring regions
alertThresholdintegerFailures before alerting
GET/monitors
Retrieve all monitors for your organization

Request

curl -X GET https://wakestack.co.uk/api/monitors \
  -H "Authorization: Bearer wsk_live_your_api_key"

Response

[
  {
    "id": "mon_a1b2c3d4e5f6",
    "name": "API Health Check",
    "url": "https://api.example.com/health",
    "type": "http",
    "status": "operational",
    "uptimePercentage": 99.95,
    ...
  },
  {
    "id": "mon_g7h8i9j0k1l2",
    "name": "Database Connection",
    "url": "db.example.com:5432",
    "type": "tcp",
    "status": "operational",
    "uptimePercentage": 100,
    ...
  }
]
POST/monitors
Create a new monitor

Request Body

ParameterRequiredDescription
nameYesDisplay name for the monitor
urlYesURL or host to monitor
typeNohttp (default), tcp, ping, dns
methodNoGET (default), POST, PUT, etc.
intervalNo60 (default), 30, 120, 180, 300
timeoutNo30 seconds (default)
expectedStatusCodeNo200 (default)
headersNoCustom HTTP headers object
bodyNoRequest body for POST/PUT
regionsNo["us-east"] (default)
alertThresholdNo3 (default)

Example: HTTP Monitor

curl -X POST https://wakestack.co.uk/api/monitors \
  -H "Authorization: Bearer wsk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Health Check",
    "url": "https://api.example.com/health",
    "type": "http",
    "method": "GET",
    "interval": 60,
    "expectedStatusCode": 200,
    "regions": ["us-east", "eu-west"],
    "alertThreshold": 3
  }'

Example: TCP Monitor

curl -X POST https://wakestack.co.uk/api/monitors \
  -H "Authorization: Bearer wsk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Database Connection",
    "url": "db.example.com:5432",
    "type": "tcp",
    "interval": 60
  }'

Response (201 Created)

{
  "id": "mon_a1b2c3d4e5f6",
  "name": "API Health Check",
  "url": "https://api.example.com/health",
  "type": "http",
  "status": "pending",
  "enabled": true,
  "createdAt": "2024-01-15T10:30:00Z",
  ...
}
GET/monitors/:id
Retrieve a specific monitor by ID

Request

curl -X GET https://wakestack.co.uk/api/monitors/mon_a1b2c3d4e5f6 \
  -H "Authorization: Bearer wsk_live_your_api_key"

Response

{
  "id": "mon_a1b2c3d4e5f6",
  "name": "API Health Check",
  "url": "https://api.example.com/health",
  "type": "http",
  "status": "operational",
  "lastResponseTime": 145,
  "uptimePercentage": 99.95,
  ...
}
PUT/monitors/:id
Update an existing monitor

Request

curl -X PUT https://wakestack.co.uk/api/monitors/mon_a1b2c3d4e5f6 \
  -H "Authorization: Bearer wsk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Health Check (Updated)",
    "interval": 30,
    "alertThreshold": 5
  }'

Response

{
  "id": "mon_a1b2c3d4e5f6",
  "name": "API Health Check (Updated)",
  "interval": 30,
  "alertThreshold": 5,
  "updatedAt": "2024-01-15T11:00:00Z",
  ...
}
DELETE/monitors/:id
Delete a monitor permanently

Request

curl -X DELETE https://wakestack.co.uk/api/monitors/mon_a1b2c3d4e5f6 \
  -H "Authorization: Bearer wsk_live_your_api_key"

Response (200 OK)

{
  "message": "Monitor deleted successfully"
}
Available Regions
Monitoring locations for geographic distribution
Region IDLocationAvailability
us-eastVirginia, USAAll plans
eu-westFrankfurt, GermanyAll plans
ap-southeastSingaporePro+
Error Codes
CodeDescription
400Invalid request body or parameters
401Missing or invalid API key
403Plan limit exceeded (PLAN_LIMIT_EXCEEDED)
404Monitor not found
500Internal server error