Developer REST API & SDKs

WakeMetrics API Documentation

Programmatically create probes, trigger on-demand consensus checks, query real-time uptime metrics, and ping cron heartbeats via our REST API.

1. Authentication

All REST API requests must include your organization API key inside the Authorization HTTP header with the Bearer prefix.

Authorization: Bearer wm_live_your_secret_api_key

2. Create Synthetic Monitor (`POST /api/monitors`)

Add an HTTP/HTTPS API probe, TCP port check, or SSL certificate monitor programmatically.

curl -X POST https://wakemetrics.com/api/monitors \
  -H "Authorization: Bearer wm_live_secret_key_12345" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Payment Gateway",
    "type": "api",
    "url": "https://api.yourcompany.com/v1/health",
    "method": "GET",
    "interval_seconds": 15,
    "failure_threshold": 3,
    "timeout_ms": 5000
  }'

3. Cronjob Heartbeat Pings (Dead-Man Switch)

Monitor background jobs, database backups, and cron workers. When your job completes, ping your unique token URL:

curl -fsS -m 10 https://wakemetrics.com/h/your_heartbeat_token

4. Webhook Incident JSON Payload

When a service state changes from UP to DOWN, WakeMetrics delivers a cryptographically signed JSON webhook:

{
  "event": "incident.opened",
  "monitor": {
    "id": "mon_01h9x42...",
    "name": "Production Payment Gateway",
    "url": "https://api.yourcompany.com/v1/health"
  },
  "incident": {
    "status": "OPEN",
    "reason": "HTTP 502 Bad Gateway detected via 3-region consensus",
    "started_at": "2026-10-03T01:00:00.000Z",
    "duration_seconds": 0
  }
}