Skip to main content
GET
/
api
/
heartbeat
/
{token}
Heartbeat
curl --request GET \
  --url https://app.larm.dev/api/heartbeat/{token}
{
  "status": "ok",
  "state": "up"
}
token
string
required
Heartbeat monitor token, found in monitor settings
Heartbeat monitors work by expecting a periodic ping. If the ping stops arriving within the configured interval, Larm marks the monitor as down and fires alerts.

Endpoint

ANY https://app.larm.dev/api/heartbeat/{token}
Accepts any HTTP method (GET, POST, HEAD, etc.). The token is found in your heartbeat monitor’s settings in the dashboard.
No Authorization header is needed. The token in the URL is the authentication.

Responses

{
  "status": "ok",
  "state": "up"
}
StatusDescription
200Ping received. state is one of pending, up, down, or stale.
404Token doesn’t match any heartbeat monitor.
429Rate limited — maximum 6 pings per minute per token.

Examples

Cron job

Ping after your job completes. If the job fails or hangs, the ping never arrives and Larm alerts you.
# Add to the end of your crontab entry
0 * * * * /usr/local/bin/backup.sh && curl -sf https://app.larm.dev/api/heartbeat/YOUR_TOKEN

curl

curl https://app.larm.dev/api/heartbeat/YOUR_TOKEN

Python

import requests

requests.get("https://app.larm.dev/api/heartbeat/YOUR_TOKEN")

Node.js

fetch("https://app.larm.dev/api/heartbeat/YOUR_TOKEN");

Ruby

require "net/http"

Net::HTTP.get(URI("https://app.larm.dev/api/heartbeat/YOUR_TOKEN"))