Heartbeat
curl --request GET \
--url https://app.larm.dev/api/heartbeat/{token}import requests
url = "https://app.larm.dev/api/heartbeat/{token}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.larm.dev/api/heartbeat/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.larm.dev/api/heartbeat/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.larm.dev/api/heartbeat/{token}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.larm.dev/api/heartbeat/{token}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.larm.dev/api/heartbeat/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "ok"
}
Heartbeat
Heartbeat
Monitor cron jobs, scheduled tasks, and background workers
GET
/
api
/
heartbeat
/
{token}
Heartbeat
curl --request GET \
--url https://app.larm.dev/api/heartbeat/{token}import requests
url = "https://app.larm.dev/api/heartbeat/{token}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://app.larm.dev/api/heartbeat/{token}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.larm.dev/api/heartbeat/{token}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.larm.dev/api/heartbeat/{token}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.larm.dev/api/heartbeat/{token}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.larm.dev/api/heartbeat/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "ok"
}
string
required
Heartbeat monitor token, found in monitor settings
Endpoint
ANY https://app.larm.dev/api/heartbeat/{token}
No
Authorization header is needed. The token in the URL is the authentication.Response
Every call returns200 {"status": "ok"}. This is deliberate — invalid tokens, missing monitors, and rate-limited pings all return the same response to prevent token enumeration.
{
"status": "ok"
}
Rate limiting
To bound storage from abusive ping rates, Larm records at most one heartbeat per token within a window ofinterval_seconds × 100 milliseconds — roughly 10 pings per expected interval. Pings beyond that within the same window still return 200 {"status": "ok"} but are not stored. Extra pings never cause an alert.
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"))