Skip to content
RateStack
API cookbook

Verify the audit hash chain

Schedule the chain verification endpoint from your monitoring stack. Treat any break as a security incident.

RTBy RateStack TeamPublishedReviewed
beginnercURL · Bash
# Run from Cron / monitoring; expects { ok: true, checked: N, firstBreakAt: null }
RES=$(curl -fsS -H "X-API-Key: $ADMIN_KEY" \
  https://api.ratestack.com/v1/admin/audit/verify)
echo "$RES" | jq -e '.ok == true' >/dev/null || {
  echo "AUDIT CHAIN BREAK: $RES" >&2
  exit 1
}

On break, the response carries firstBreakAt — the row id that fails to hash to its successor's previous_hash. That row is the starting point for an investigation.

Verify the audit hash chain — API cookbook | RateStack