CronHook

Developer Documentation

Documentation

HTTP ping API, webhook alerts, and framework integration guides.

Quick start

How HTTP Heartbeat Monitoring Works

1

Create a monitor

Define your job's expected schedule period (e.g., every 5 minutes) and grace buffer in your dashboard.

2

Append curl ping

Append a simple HTTP GET request to the end of your script or background task execution.

3

Get alerted on missed pings

If your job crashes, hangs, or fails to execute, CronHook sends alert webhooks to your configured channels.

Terminal / Crontab
*/5 * * * * /app/backup.sh && curl -fsS https://cronhook.site/ping/YOUR_CHECK_ID

API Reference

HTTP Ping & Management Endpoints

Works with any HTTP client — curl, wget, fetch, or requests.

GET /ping/:checkId

Send a success ping to reset your monitor's countdown timer.

curl -fsS https://cronhook.site/ping/chk_12345
GET /ping/:checkId/fail

Send an instant failure signal to trigger alerts immediately without waiting for schedule timeout.

curl -fsS https://cronhook.site/ping/chk_12345/fail
POST /ping/:checkId/start

Signal the execution start of a batch job to track execution duration.

curl -X POST https://cronhook.site/ping/chk_12345/start
POST /api/checks

Create a new monitor programmatically via JSON API (requires auth token).

curl -X POST https://cronhook.site/api/checks \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name": "Backup Job", "period": 300, "grace": 600}'

Alert Webhooks

Webhook Payload Specification

When a monitor goes DOWN or RECOVERS, CronHook posts JSON payloads to your custom webhooks.

POST /your-webhook-endpoint Content-Type: application/json
{
  "event": "monitor.down",
  "monitor_id": "chk_987654321",
  "monitor_name": "Database Backup Job",
  "status": "down",
  "expected_period_seconds": 300,
  "grace_buffer_seconds": 600,
  "last_ping_at": 1770940800,
  "triggered_at": 1770941700,
  "incident_id": "inc_12345"
}

Webhook Delivery Guarantees

  • Fast dispatch: Webhooks trigger directly from Cloudflare Durable Object alarm handlers.
  • Automatic Retries: Failed webhook endpoints (5xx or timeout) are retried 3 times with exponential backoff.
  • HMAC Signature Verification: Validate webhook payloads using your secret signing token.