Skip to main content

๐Ÿ’“ Heartbeat API

Send a Heartbeat Pingโ€‹

Report that your job/service is running successfully.

Endpointโ€‹

GET /heartbeat/{token}
POST /heartbeat/{token}

Parametersโ€‹

ParameterLocationDescription
tokenURL pathThe 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โ€‹

  1. The monitor's last_checked_at is updated to now
  2. Status is set to Up
  3. Consecutive failures are reset to 0
  4. 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โ€‹

ParameterLocationDescription
tokenURL pathThe unique heartbeat token

Exampleโ€‹

curl -X POST https://your-monitron.com/heartbeat/abc123def456/fail

Responseโ€‹

{
"status": "ok",
"message": "Failure recorded"
}

What Happensโ€‹

  1. Status is set to Down
  2. Consecutive failures are incremented
  3. An incident is created (if one isn't already open)
  4. Notifications are dispatched to configured contacts

๐Ÿ”— Finding Your Tokenโ€‹

  1. Go to Monitors โ†’ click your Heartbeat monitor โ†’ View
  2. The Heartbeat URL is shown prominently in the monitor details
  3. The token is the last part of the URL: /heartbeat/{this-part}