Heartbeat Monitoring API Documentation
Learn how to send heartbeats from your cron jobs and scheduled tasks
Base URL
https://api.watchflow.io/heartbeatAuthentication
You can authenticate using your API Key in two ways. The workspace is automatically resolved from your API key.
x-api-key: wf_live_abc123xyz...?api_key=wf_live_abc123xyz...💡 No headers needed! Perfect for simple cron jobs and quick tests.
Zero-Config Monitor Creation
No manual setup required! Simply send a ping request with your monitor key and interval, and watchflow will automatically create the monitor for you.
This means you can start monitoring your cron jobs immediately without any configuration. Just add a single curl command to your script, and you're done. The monitor will be created on the first ping and will start tracking your job's health automatically.
Example: Auto-create a monitor with a single request
curl "https://api.watchflow.io/heartbeat/ping?key=my-job&api_key=wf_live_abc123xyz..."Job Status Types
/ping/start)/ping)/ping/fail)API Endpoints
/pingPOSTGETMark job as successful (supports GET for one-liners)
/ping/startPOSTStart job tracking (for duration measurement)
/ping/failPOSTMark job as failed with error message
Request Parameters
keyrequiredUnique identifier for your monitor (e.g., "daily-backup", "email-sender")
intervaloptionalExpected heartbeat interval (e.g., "5m", "1h", "24h", "7d"). Default: 24h
nameoptionalHuman-readable name for your monitor
dataoptionalCustom metrics or metadata (JSON object)
erroroptional(only for /ping/fail)Error message describing why the job failed
Code Examples
Simple GET (One-Liner) - No Headers Needed! 🚀
💡 Use api_key as query parameter - perfect for cron jobs where setting headers is difficult!
POST Success (with data)
Start/Fail Pattern (with Duration Tracking)
Bash Wrapper Script
Python with Error Handling
Node.js
Response
Success (200)