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.
The monitor object
Section titled “The monitor object”Monitor:
| Field | Type | Notes |
|---|---|---|
id | number | |
name | string | null | |
url | string | null | Target URL. |
projectId | number | null | Optional linked project. |
organizationId | string | |
interval | number | null | Check interval, seconds. |
retries | number | null | |
timeout | number | null | ms. |
httpMethod | string | null | |
status | running | pause | null | |
statusCodes | string[] | null | Accepted status codes. |
keyword | string | null | Body keyword to assert. |
headers | array | null | { name, value }[]. |
httpBody | string | null | |
expireCertNotify | boolean | null | Notify on cert expiry. |
ignoreTlsError | boolean | null | |
ssl | object | null | { subject, validTo, issuer, daysUntilExpiry }. |
createdAt | string | null | |
uptimePercent | number | null | Last 24h. |
lastHeartbeat | object | null | { status, responseTime, time }. |
List monitors
Section titled “List monitors”GET /v1/monitors
Auth: any member. Response: Monitor[].
curl https://api.pandastack.io/v1/monitors \ -H "Authorization: Bearer $PANDASTACK_TOKEN"Create a monitor
Section titled “Create a monitor”POST /v1/monitors
Auth: member. Body (CreateMonitorInput):
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | 1–120 chars. |
url | string | yes | Must be a valid URL. |
projectId | number | no | Positive int; link to a project. |
interval | number | no | 30–86400 s, default 60. |
timeout | number | no | 1000–60000 ms, default 10000. |
retries | number | no | 0–10, default 1. |
httpMethod | GET | HEAD | POST | no | Default GET. |
statusCodes | string[] | no | Accepted codes. |
keyword | string | no | Max 500; assert body contains it. |
headers | { name, value }[] | no | Request headers. |
httpBody | string | no | |
expireCertNotify | boolean | no | |
ignoreTlsError | boolean | no |
Response: Monitor.
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 a monitor
Section titled “Get a monitor”GET /v1/monitors/:id
Auth: any member. Response: Monitor.
Update a monitor
Section titled “Update a 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.
Pause / resume
Section titled “Pause / resume”POST /v1/monitors/:id/pause (member) — returns Monitor.
POST /v1/monitors/:id/resume (member) — returns Monitor.
Delete a monitor
Section titled “Delete a monitor”DELETE /v1/monitors/:id
Auth: member. Response: { deleted: true }.
Heartbeats
Section titled “Heartbeats”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) }.
curl "https://api.pandastack.io/v1/monitors/12/heartbeats?limit=70" \ -H "Authorization: Bearer $PANDASTACK_TOKEN"Uptime aggregate
Section titled “Uptime aggregate”GET /v1/monitors/:id/aggregate
Time-bucketed uptime aggregate.
Auth: any member. Query: ?hours (default 24). Response (MonitorAggregate):
| Field | Type | Notes |
|---|---|---|
monitorId | number | |
windowHours | number | |
uptimePercent | number | null | |
buckets | array | Each { bucket (ISO), upCount, downCount, pausedCount, avgResponseTime, status }. |
Alerts
Section titled “Alerts”Alert rules attach to a monitor and fire when a metric crosses a threshold.
List alerts
Section titled “List alerts”GET /v1/monitors/:id/alerts
Auth: any member. Response: Alert[].
Alert:
| Field | Type | Notes |
|---|---|---|
id | number | |
monitorId | number | |
organizationId | string | |
metric | enum | string | status | response_time | status_code | error_rate | ssl_expiry. |
condition | enum | string | gt | lt | eq | neq. |
threshold | number | |
duration | number | null | Sustained minutes before firing. |
severity | enum | null | info | warning | error | critical. |
notifications | object | null | { email?, slack?, webhook? }. |
status | enum | null | active | triggered | inactive. |
acknowledged | boolean | null | |
lastTriggered | string | null | |
createdAt | string | null |
Create an alert
Section titled “Create an alert”POST /v1/monitors/:id/alerts
Auth: member. Body (CreateAlertInput):
| Field | Type | Required | Notes |
|---|---|---|---|
metric | enum | yes | status | response_time | status_code | error_rate | ssl_expiry. |
condition | enum | yes | gt | lt | eq | neq. |
threshold | number | yes | |
duration | number | no | 1–60, default 1. |
severity | enum | no | Default warning. |
notifications | object | no | { email (default true), slack (default false), webhook (default false) }. |
webhookUrl | string | no | Valid URL. |
slackWebhook | string | no | Valid URL. |
Response: Alert.
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 an alert
Section titled “Delete an alert”DELETE /v1/alerts/:alertId
Auth: member. Response: { deleted: true }.
Related
Section titled “Related”- Metrics & analytics API — passive traffic telemetry.
- Projects API — link a monitor to a project via
projectId.