Skip to main content

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:

FieldTypeRequiredDefaultDescription
namestringYesMonitor display name (max 255 chars)
urlstringYesURL to monitor
methodstringNoGETHTTP method (GET, POST, PUT, PATCH, DELETE, HEAD)
check_intervalintegerNo5Check interval in minutes (1, 5, 10, 30, 60)
timeout_msintegerNo30000Request timeout in milliseconds
expected_status_codeintegerNo200Expected response status (100-599)
body_containsstringNonullString that must appear in response body
failure_thresholdintegerNo2Consecutive failures before down (1-10)
headersobjectNo{}Custom request headers
bodystringNonullRequest body
email_enabledbooleanNotrueSend email alerts
slack_enabledbooleanNofalseSend 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
}