Uptime Monitors API
Create, manage, and query uptime monitors and their check history.
List monitors
GET /api/v1/uptime-monitors
curl https://app.hooklistener.com/api/v1/uptime-monitors \
-H "Authorization: Bearer hklst_your_api_key"
Response:
{
"data": [
{
"id": "mon_abc123",
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"status": "up",
"interval_seconds": 300,
"expected_status_code": 200,
"timeout_ms": 30000,
"last_checked_at": "2025-01-15T11:00:00Z",
"inserted_at": "2025-01-10T08:00:00Z",
"updated_at": "2025-01-10T08:00:00Z"
}
]
}
Create a monitor
POST /api/v1/uptime-monitors
curl -X POST https://app.hooklistener.com/api/v1/uptime-monitors \
-H "Authorization: Bearer hklst_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"uptime_monitor": {
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"check_interval": 5,
"expected_status_code": 200,
"timeout_ms": 30000
}
}'
Request body:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Monitor display name (max 255 chars) |
url | string | Yes | — | URL to monitor |
method | string | No | GET | HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD) |
check_interval | integer | No | 5 | Check interval in minutes (1, 5, 10, 30, 60) |
timeout_ms | integer | No | 30000 | Request timeout in milliseconds |
expected_status_code | integer | No | 200 | Expected response status (100-599) |
body_contains | string | No | null | String that must appear in response body |
failure_threshold | integer | No | 2 | Consecutive failures before down (1-10) |
headers | object | No | {} | Custom request headers |
body | string | No | null | Request body |
email_enabled | boolean | No | true | Send email alerts |
slack_enabled | boolean | No | false | Send Slack alerts |
note
The request body accepts check_interval in minutes, but the response returns interval_seconds (the computed value in seconds).
Response: 201 Created
{
"data": {
"id": "mon_abc123",
"name": "Production API",
"url": "https://api.example.com/health",
"method": "GET",
"status": "pending",
"interval_seconds": 300,
"expected_status_code": 200,
"timeout_ms": 30000,
"inserted_at": "2025-01-15T11:00:00Z",
"updated_at": "2025-01-15T11:00:00Z"
}
}
Get a monitor
GET /api/v1/uptime-monitors/:id
curl https://app.hooklistener.com/api/v1/uptime-monitors/mon_abc123 \
-H "Authorization: Bearer hklst_your_api_key"
Update a monitor
PUT /api/v1/uptime-monitors/:id
curl -X PUT https://app.hooklistener.com/api/v1/uptime-monitors/mon_abc123 \
-H "Authorization: Bearer hklst_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"uptime_monitor": {
"check_interval": 1
}
}'
Delete a monitor
DELETE /api/v1/uptime-monitors/:id
curl -X DELETE https://app.hooklistener.com/api/v1/uptime-monitors/mon_abc123 \
-H "Authorization: Bearer hklst_your_api_key"
Response: 204 No Content
List checks
GET /api/v1/uptime-monitors/:id/checks
curl "https://app.hooklistener.com/api/v1/uptime-monitors/mon_abc123/checks?page=1&page_size=50" \
-H "Authorization: Bearer hklst_your_api_key"
Response:
{
"data": [
{
"id": "chk_def456",
"status": "up",
"response_status": 200,
"response_time_ms": 145,
"error": null,
"checked_at": "2025-01-15T11:00:00Z"
}
],
"page": 1,
"page_size": 50,
"total": 288
}