๐ Heartbeat API
Send a Heartbeat Pingโ
Report that your job/service is running successfully.
Endpointโ
GET /heartbeat/{token}
POST /heartbeat/{token}
Parametersโ
| Parameter | Location | Description |
|---|---|---|
token | URL path | The unique heartbeat token (from your monitor's settings) |
Exampleโ
# GET request
curl https://your-monitron.com/heartbeat/abc123def456
# POST request
curl -X POST https://your-monitron.com/heartbeat/abc123def456
Responseโ
{
"status": "ok",
"message": "Heartbeat recorded"
}
What Happensโ
- The monitor's
last_checked_atis updated to now - Status is set to Up
- Consecutive failures are reset to 0
- If there was an active incident, it's automatically resolved
Report a Heartbeat Failureโ
Explicitly report that your job/service has failed.
Endpointโ
POST /heartbeat/{token}/fail
Parametersโ
| Parameter | Location | Description |
|---|---|---|
token | URL path | The unique heartbeat token |
Exampleโ
curl -X POST https://your-monitron.com/heartbeat/abc123def456/fail
Responseโ
{
"status": "ok",
"message": "Failure recorded"
}
What Happensโ
- Status is set to Down
- Consecutive failures are incremented
- An incident is created (if one isn't already open)
- Notifications are dispatched to configured contacts
๐ Finding Your Tokenโ
- Go to Monitors โ click your Heartbeat monitor โ View
- The Heartbeat URL is shown prominently in the monitor details
- The token is the last part of the URL:
/heartbeat/{this-part}