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/apiAll 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
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier |
| name | string | Display name |
| url | string | URL or host to monitor |
| type | string | http, tcp, ping, or dns |
| method | string | HTTP method (GET, POST, etc.) |
| interval | integer | Check interval in seconds |
| timeout | integer | Request timeout in seconds |
| status | string | operational, degraded, down, or pending |
| regions | array | Monitoring regions |
| alertThreshold | integer | Failures before alerting |
GET
/monitorsRetrieve 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
/monitorsCreate a new monitor
Request Body
| Parameter | Required | Description |
|---|---|---|
| name | Yes | Display name for the monitor |
| url | Yes | URL or host to monitor |
| type | No | http (default), tcp, ping, dns |
| method | No | GET (default), POST, PUT, etc. |
| interval | No | 60 (default), 30, 120, 180, 300 |
| timeout | No | 30 seconds (default) |
| expectedStatusCode | No | 200 (default) |
| headers | No | Custom HTTP headers object |
| body | No | Request body for POST/PUT |
| regions | No | ["us-east"] (default) |
| alertThreshold | No | 3 (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/:idRetrieve 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/:idUpdate 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/:idDelete 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 ID | Location | Availability |
|---|---|---|
| us-east | Virginia, USA | All plans |
| eu-west | Frankfurt, Germany | All plans |
| ap-southeast | Singapore | Pro+ |
Error Codes
| Code | Description |
|---|---|
| 400 | Invalid request body or parameters |
| 401 | Missing or invalid API key |
| 403 | Plan limit exceeded (PLAN_LIMIT_EXCEEDED) |
| 404 | Monitor not found |
| 500 | Internal server error |