Add a heartbeat
add_heartbeatCreate a heartbeat for a job the user runs (cron job, backup script, scheduled task, CI job). Returns its ping URL: the job requests it when it succeeds (e.g. your-job && curl -fsS -m 10 --retry 3 <pingUrl>), and <pingUrl>/fail to report a failure (a POST body is kept with the ping). No ping within period + grace, or a failure, alerts the user at once; a new heartbeat waits for its first ping and never alerts before it. Adds the site's Heartbeats monitor with the first one. Plan limits per account: Free 2, Pro 20, Business 100, Agency 500.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tz | No | The cron expression's IANA time zone, e.g. Europe/Bucharest (default UTC) | |
| cron | No | Instead of a period: the job's cron expression (five fields, e.g. "0 3 * * *" or "*/15 * * * 1-5"; @daily, @hourly … work too). A ping is then due by each time it fires plus the grace | |
| name | Yes | What the job is, e.g. "Nightly backup" | |
| siteId | Yes | The site's id | |
| graceSec | No | How late a ping may be before it counts as missed, in seconds (60 to 604800 = 7 days; default 3600) | |
| periodSec | No | How often the job runs, in seconds (60 to 2678400 = 31 days; default 86400 = daily). Ignored when `cron` is set |