Docs
Last updated:
Everything beyond the basics: pings, creating checks from code, importing past counts, and webhooks. Questions: hello@normbeat.com.
Pings
Each check has a ping URL, https://ping.normbeat.com/p/KEY. GET and POST both work.
/p/KEY?count=48211: the job finished and loaded 48,211 rows (rows=works too)./p/KEY/start: the job started (optional)./p/KEY/fail: the job failed.
The Python client sends these for you: with normbeat.run("KEY") as r: r.count(rows).
Create checks from code (API)
With many jobs, let each one create its own check. Create an API key on the Account page in the dashboard. It's shown once; keep it secret like a password.
curl -X POST https://ping.normbeat.com/api/v1/checks \
-H "Authorization: Bearer $NORMBEAT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "orders load", "cron": "0 2 * * *", "tz": "Europe/Berlin"}'If a check with exactly that name exists, it's returned unchanged (200). Otherwise it's created (201). The answer includes ping_url and ping_key, so a job can call this at start-up every run.
Fields:
name(required).- A schedule, one of:
cron(5 fields), oreveryas"15m","6h","1d". - Optional:
tz(default UTC),minandmaxcounts,lateandmissedin minutes,no_late_alerts(true/false).
In Python (version 0.2.0 or newer), with NORMBEAT_API_KEY set:
key = normbeat.check("orders load", cron="0 2 * * *", tz="Europe/Berlin")
with normbeat.run(key) as r:
r.count(load_orders())Errors come back as JSON with an error message: 401 for a missing or wrong key, 400 for invalid fields, 403 when your plan's checks are all in use, 429 above 60 requests a minute. The Python client logs these and never raises.
Import past counts
normbeat learns each job's normal range from three or more earlier runs on the same weekday, which normally takes three weeks. If you already have past counts, in logs or your warehouse, paste them on the check's page under Import past counts and the range works from the next run.
2026-11-03 02:05, 48211
2026-11-04T02:04:00Z, 47390
2026-11-08, 9814- One run per line: when it finished, then the count. Comma, semicolon, tab or space between them.
- Times without a zone use the check's time zone. A date alone means noon that day.
- Up to 2,000 lines, from the last 10 weeks (older runs aren't used). A header line is skipped.
- Imported runs never cause alerts. Runs with a count of 0 are kept but not used for the normal range. Importing the same lines twice adds nothing.
A query like this produces the lines: SELECT loaded_at, row_count FROM load_log WHERE job = 'orders' AND loaded_at > now() - interval '10 weeks'.
Webhook alerts
Add a webhook on the Alerts page. normbeat POSTs each alert to your URL as JSON:
{
"event": "low",
"text": "[normbeat] orders load far fewer rows than usual ...",
"content": "(same text, for Discord)",
"subject": "[normbeat] orders load far fewer rows than usual",
"check": {"id": "...", "name": "orders load", "url": "https://app.normbeat.com/checks/..."},
"count": 312,
"expected": {"low": 3800, "high": 4500},
"run_at": "2026-12-06T02:03:00Z",
"sent_at": "2026-12-06T02:03:04Z"
}eventis one ofzero,low,high,failed,late,missed,recovered,cap(too many alerts in an hour), ortest.count,expectedandrun_atappear when they apply.- Because the body has
textandcontent, a Discord, Google Chat or Mattermost webhook URL works as it is. For PagerDuty, Opsgenie or similar, use their custom or generic webhook integration and mapeventandtext. - Any 2xx answer counts as delivered. Failed deliveries are retried. Redirects aren't followed. The URL must be https on port 443 and on the public internet.
Checking it's really from normbeat. Each request has X-Normbeat-Timestamp (Unix seconds) and X-Normbeat-Signature: v1=<hex>, an HMAC-SHA256 of timestamp + "." + body with your webhook's signing secret (shown on the Alerts page). In Python:
import hashlib, hmac, time
def is_from_normbeat(secret, timestamp, signature, body: bytes) -> bool:
if abs(time.time() - int(timestamp)) > 300:
return False
mac = hmac.new(secret.encode(), timestamp.encode() + b"." + body, hashlib.sha256)
return hmac.compare_digest("v1=" + mac.hexdigest(), signature)