Skip to content

Check diagnostics

All four operations require checks:history and an owned check ID. Paths are relative to /api/v1. days accepts seven or 30, default 30. MCP uses the same parameters in a tool argument object.

GET /checks/:id/history / get_check_history.

Returns id, start_at, end_at, retention_days, and days, an array of:

Daily field Meaning
date UTC calendar date
run_count Recorded activity count
average_duration_ms Mean measured duration or null
incident_count Incidents starting on that date

The window starts at UTC midnight days-1 calendar days before today, ending now. An empty day is still represented; absence of measurements is not zero latency.

GET /checks/:id/runs / list_check_runs. Accepts days, limit, cursor.

Returns id, start_at, end_at, items, next_cursor. Each run has: id, received_at, nullable duration_ms, nullable probe_id, and nullable resolver_id. Runs are paged by underlying ID, not by descending time.

No payloads, sender IPs or credentials are returned. Retention limits samples even if the requested window is longer.

GET /checks/:id/metrics / get_check_metrics. Website, DNS and TCP only; other kinds return invalid_kind. Accepts days and at most one of probe_id or resolver_id. Use IDs from this check’s run results; foreign sources are not accepted.

Result Meaning
id, start_at, end_at Check and UTC calendar window
run_count All selected recorded runs
measurement_count Runs with nonnegative measured duration
probe_id, resolver_id Selected source or null
min_duration_ms, average_duration_ms Minimum and arithmetic mean, or null
p50_duration_ms, p95_duration_ms Percentiles of available durations, or null
max_duration_ms Maximum measured duration or null

Statistics pool selected samples, not per-location averages. They are not availability estimates. A run can exist without a latency measurement.

GET /checks/:id/uptime / get_check_uptime. Accepts days.

Returns id, start_at, end_at, window_seconds, downtime_seconds, nullable uptime_percentage, basis: "incident_free_time" and paused_and_pending_history_available: false.

This is a rolling days-long interval ending now, clipped to check creation. Downtime merges/clips overlapping incidents, including ongoing episodes. Degraded and down both contribute incident time.

No recorded activity or incident evidence means the API percentage is null. Historical paused/pending periods cannot be reconstructed; do not label this as continuously verified uptime through those periods.

Terminal window
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer $PINGSTACK_TOKEN" \
"$PINGSTACK_BASE_URL/api/v1/checks/$PINGSTACK_CHECK_ID/uptime?days=7"

Set PINGSTACK_CHECK_ID from a check response. A daily count, latency distribution and incident-free percentage answer different questions.