Skip to main content
GET
/
v1
/
stats
cURL
curl --request GET \
  --url https://api.pegana.xyz/v1/stats
{
  "alerts_24h": 123,
  "assets_in_drift": 123,
  "assets_tracked": 123,
  "by_state": {},
  "delivery_health": {
    "failed_24h": 123,
    "sent_24h": 123,
    "last_failure_error": "<string>"
  }
}

Response

200 - application/json

Aggregate counters + delivery rollup

alerts_24h
integer<int64>
required
assets_in_drift
integer<int64>
required

Count of active assets whose most recent state is DRIFT. Derived from by_state so it never disagrees, but surfaced top-level so the home/ trust strip can render a single risk number without parsing the map.

assets_tracked
integer<int64>
required
by_state
object
required

Per-state asset counts keyed by the engine's state enum (PEGGED / DRIFT / DEPEG / CRITICAL / BLACK_SWAN / UNKNOWN). Empty buckets are omitted, not zero-filled.

delivery_health
object
required

Delivery-pipeline health rollup. Surfaced so the dashboard can show a degraded badge when notifications are silently failing — historically MarkdownV2 escape bugs caused alert_deliveries.status='failed' rows to pile up without any user-visible signal, breaking trust.