Skip to content

Monitors API

Uptime monitors run periodic HTTP checks against a URL and record a heartbeat each time. Heartbeat data is time-bucketed in Postgres. You can attach alert rules that fire on status, latency, status code, error rate, or SSL expiry.

Concept guide: Uptime monitors.

All routes require authentication; role floors are noted per endpoint.

Monitor:

FieldTypeNotes
idnumber
namestring | null
urlstring | nullTarget URL.
projectIdnumber | nullOptional linked project.
organizationIdstring
intervalnumber | nullCheck interval, seconds.
retriesnumber | null
timeoutnumber | nullms.
httpMethodstring | null
statusrunning | pause | null
statusCodesstring[] | nullAccepted status codes.
keywordstring | nullBody keyword to assert.
headersarray | null{ name, value }[].
httpBodystring | null
expireCertNotifyboolean | nullNotify on cert expiry.
ignoreTlsErrorboolean | null
sslobject | null{ subject, validTo, issuer, daysUntilExpiry }.
createdAtstring | null
uptimePercentnumber | nullLast 24h.
lastHeartbeatobject | null{ status, responseTime, time }.

GET /v1/monitors

Auth: any member. Response: Monitor[].

Terminal window
curl https://api.pandastack.io/v1/monitors \
-H "Authorization: Bearer $PANDASTACK_TOKEN"

POST /v1/monitors

Auth: member. Body (CreateMonitorInput):

FieldTypeRequiredNotes
namestringyes1–120 chars.
urlstringyesMust be a valid URL.
projectIdnumbernoPositive int; link to a project.
intervalnumberno30–86400 s, default 60.
timeoutnumberno1000–60000 ms, default 10000.
retriesnumberno0–10, default 1.
httpMethodGET | HEAD | POSTnoDefault GET.
statusCodesstring[]noAccepted codes.
keywordstringnoMax 500; assert body contains it.
headers{ name, value }[]noRequest headers.
httpBodystringno
expireCertNotifybooleanno
ignoreTlsErrorbooleanno

Response: Monitor.

Terminal window
curl -X POST https://api.pandastack.io/v1/monitors \
-H "Authorization: Bearer $PANDASTACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "API health",
"url": "https://api.example.com/health",
"interval": 60,
"timeout": 10000,
"retries": 2,
"httpMethod": "GET",
"keyword": "ok"
}'

GET /v1/monitors/:id

Auth: any member. Response: Monitor.

PATCH /v1/monitors/:id

Auth: member. Body (UpdateMonitorInput) — all optional: name (1–120), url, interval (30–86400), timeout (1000–60000), retries (0–10), httpMethod, statusCodes, keyword (max 500, nullable), headers, httpBody (nullable), expireCertNotify, ignoreTlsError. Response: Monitor.

POST /v1/monitors/:id/pause (member) — returns Monitor.

POST /v1/monitors/:id/resume (member) — returns Monitor.

DELETE /v1/monitors/:id

Auth: member. Response: { deleted: true }.


GET /v1/monitors/:id/heartbeats

Recent heartbeats for a monitor.

Auth: any member. Query: ?limit (default 70). Response: Heartbeat[] — each { status (UP|DOWN|PAUSE), responseTime, message, time (ISO) }.

Terminal window
curl "https://api.pandastack.io/v1/monitors/12/heartbeats?limit=70" \
-H "Authorization: Bearer $PANDASTACK_TOKEN"

GET /v1/monitors/:id/aggregate

Time-bucketed uptime aggregate.

Auth: any member. Query: ?hours (default 24). Response (MonitorAggregate):

FieldTypeNotes
monitorIdnumber
windowHoursnumber
uptimePercentnumber | null
bucketsarrayEach { bucket (ISO), upCount, downCount, pausedCount, avgResponseTime, status }.

Alert rules attach to a monitor and fire when a metric crosses a threshold.

GET /v1/monitors/:id/alerts

Auth: any member. Response: Alert[].

Alert:

FieldTypeNotes
idnumber
monitorIdnumber
organizationIdstring
metricenum | stringstatus | response_time | status_code | error_rate | ssl_expiry.
conditionenum | stringgt | lt | eq | neq.
thresholdnumber
durationnumber | nullSustained minutes before firing.
severityenum | nullinfo | warning | error | critical.
notificationsobject | null{ email?, slack?, webhook? }.
statusenum | nullactive | triggered | inactive.
acknowledgedboolean | null
lastTriggeredstring | null
createdAtstring | null

POST /v1/monitors/:id/alerts

Auth: member. Body (CreateAlertInput):

FieldTypeRequiredNotes
metricenumyesstatus | response_time | status_code | error_rate | ssl_expiry.
conditionenumyesgt | lt | eq | neq.
thresholdnumberyes
durationnumberno1–60, default 1.
severityenumnoDefault warning.
notificationsobjectno{ email (default true), slack (default false), webhook (default false) }.
webhookUrlstringnoValid URL.
slackWebhookstringnoValid URL.

Response: Alert.

Terminal window
curl -X POST https://api.pandastack.io/v1/monitors/12/alerts \
-H "Authorization: Bearer $PANDASTACK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"metric": "response_time",
"condition": "gt",
"threshold": 2000,
"duration": 5,
"severity": "warning",
"notifications": { "email": true, "slack": false, "webhook": false }
}'

DELETE /v1/alerts/:alertId

Auth: member. Response: { deleted: true }.