Skip to content

Developers

Heartbeats, badges, and a status API.

Everything programmable in Latensy, in one place. Plain HTTPS, no SDK to install. The full reference with a live playground is inside the app under Public API.

Cron jobs and scheduled tasks

Monitor anything that is supposed to run.

Heartbeat monitors are the inverse of every other check: Latensy fetches nothing. Your job pings a URL when it finishes, and an incident opens when the ping stops arriving.

  1. 1Add a service of type Cron Job (Heartbeat) and set how often it should run, plus a grace period.
  2. 2Copy the Heartbeat Ping URL from the service page. The monitor id in it is the secret, so keep the URL private.
  3. 3Call it at the end of the job with any HTTP method. Up to 60 pings per minute per monitor are accepted.

crontab

# crontab: run the nightly export, then tell Latensy it finished.
# If the ping stops arriving (interval + grace period), an incident opens.
0 2 * * * /usr/local/bin/export.sh && curl -fsS --retry 3 \
  https://api.latensy.io/functions/v1/heartbeat-ping/<monitor-id> > /dev/null

application code

// At the end of any scheduled job (Node.js shown; any HTTP client works)
await fetch('https://api.latensy.io/functions/v1/heartbeat-ping/<monitor-id>', { method: 'POST' });

Missed heartbeats go through the same confirmation rules as every other check, so a single slow run does not page anyone.

Status badges

Live SVG badges for any service.

Embed a service's current status, uptime percentage, or response time in a README, a client portal, or an internal wiki. Badges are public, cached briefly, and rate-limited to 120 requests per minute per client.

type
status uptime response-time
style
flat flat-square plastic for-the-badge
period
Days for uptime badges. Default 30.
Where to get it
Status Badges in the app builds the URL for you.

url

https://api.latensy.io/functions/v1/badge-generator/<monitor-id>?type=status&style=flat

markdown

![Status](https://api.latensy.io/functions/v1/badge-generator/<monitor-id>?type=status&style=flat)
![Uptime](https://api.latensy.io/functions/v1/badge-generator/<monitor-id>?type=uptime&period=30&style=flat)

html

<img src="https://api.latensy.io/functions/v1/badge-generator/<monitor-id>?type=response-time&style=for-the-badge" alt="Response time">

Public status API

Status page data as JSON.

Every public status page exposes read-only JSON endpoints: the same data the page shows, for your own dashboards, client portals, and integrations. No authentication, CORS enabled, 60 requests per minute per client.

Base URL: https://app.latensy.io/api

EndpointReturnsQuery parameters
GET/v1/status/:slug Complete status page data: monitors, incidents, and maintenance windows. —
GET/v1/status/:slug/monitors Only the monitors, with current status and 24-hour metrics. —
GET/v1/status/:slug/incidents Recent incidents with their public messages.
days Days to look back (max 90)
limit Max incidents to return (max 100)
GET/v1/status/:slug/uptime Uptime statistics per monitor, including P95 response time.
days Days to calculate (max 90)

GET /v1/status/:slug/uptime

curl -s https://app.latensy.io/api/v1/status/acme/uptime?days=30

{
  "period_days": 30,
  "overall_uptime_percentage": 99.87,
  "monitors": [
    {
      "id": "uuid",
      "name": "API Server",
      "uptime_percentage": 99.95,
      "avg_response_time_ms": 142,
      "p95_response_time_ms": 380,
      "total_checks": 8640
    }
  ],
  "generated_at": "2025-01-15T12:00:00Z"
}

GET /v1/status/:slug

{
  "status_page": { "title": "Acme Corp Status", "slug": "acme", "description": "Service status for Acme Corp" },
  "overall_status": "operational",
  "monitors": [
    { "id": "uuid", "name": "API Server", "status": "up", "uptime_24h": 99.95, "avg_response_time_ms": 142, "total_checks_24h": 288 }
  ],
  "incidents": [
    { "id": "uuid", "monitor_name": "API Server", "status": "resolved", "started_at": "2025-01-15T10:30:00Z", "resolved_at": "2025-01-15T11:00:00Z", "message": "Brief API latency spike" }
  ],
  "maintenance": [
    { "id": "uuid", "name": "Database upgrade", "start_time": "2025-01-20T02:00:00Z", "end_time": "2025-01-20T04:00:00Z", "is_active": false }
  ],
  "generated_at": "2025-01-15T12:00:00Z"
}

Timestamps are ISO 8601 in UTC. A status page must be set to public for its endpoints to respond.

Webhook alerts

Incidents, delivered to your own endpoint.

Add a webhook alert channel with a URL, an HTTP method, and any headers you need, such as an authorization token. Latensy posts a JSON payload when an incident is confirmed and again when it recovers. Send a test alert from Notifications before relying on it.

  • alert_type is down or up.
  • monitor identifies the service; incident carries timing, cause, and status.
  • Slack channels receive the same event as a formatted message; email channels receive a branded email.

payload

POST https://hooks.example.com/latensy   (method and headers are configurable per channel)
Content-Type: application/json

{
  "alert_type": "down",
  "monitor": {
    "id": "uuid",
    "name": "Checkout API",
    "url": "https://shop.example.com/api/checkout",
    "type": "rest-api",
    "status": "down"
  },
  "incident": {
    "id": "uuid",
    "started_at": "2025-01-15T14:04:11Z",
    "resolved_at": null,
    "duration": null,
    "cause": "HTTP 503",
    "status": "ongoing"
  }
}

Add your first heartbeat in two minutes.

Create a Cron Job (Heartbeat) service on the Free plan, paste one curl line into your crontab, and stop wondering whether last night's job ran.