API

API: heartbeats

Ping URLs, start/fail/finish suffixes, payloads and creating heartbeats via the API.

Ping URL

Each heartbeat monitor has a ping URL:

https://ping.tenium.app/h/{heartbeatId}

No authentication; the ID is the secret. GET or POST. Returns 200 OK with body ok.

Suffixes

URLMeaning
/h/{id}Job finished successfully
/h/{id}/startJob started (enables duration tracking)
/h/{id}/finishSame as the bare URL
/h/{id}/failJob failed; opens an incident immediately

Query or body may include exit=<code> and up to 10 KB of text (e.g. the last log lines), shown in the incident.

Examples

Cron:

0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 https://ping.tenium.app/h/abc123 > /dev/null

With failure reporting:

0 3 * * * /usr/local/bin/backup.sh && curl -fsS https://ping.tenium.app/h/abc123 || curl -fsS https://ping.tenium.app/h/abc123/fail

systemd timer: add ExecStartPost=/usr/bin/curl -fsS https://ping.tenium.app/h/abc123 to the service.

Creating a heartbeat via the API

POST /monitors
{ "name": "nightly-backup", "type": "heartbeat", "cron": "0 3 * * *", "timezone": "Europe/Tallinn", "graceSec": 1800 }

Or with a period: "periodSec": 900, "graceSec": 300.

State

A heartbeat is up while pings arrive on time, late during the grace window, and down after it. /fail is down immediately.