Health & Status API

Monitor Hookbase service availability and destination delivery health.

Endpoints

MethodPathDescription
GET/healthBasic health check
GET/api/organizations/{orgId}/analytics/destinations/healthDestination health metrics

Basic Health Check

Returns a simple status confirming the API worker is running. No authentication required.

curl https://api.hookbase.app/health

Response

{
  "status": "ok",
  "timestamp": "2026-03-08T12:00:00.000Z"
}
FieldTypeDescription
statusstringok when the worker is running
timestampstringISO 8601 timestamp of the response

Status Codes

CodeMeaning
200Service is running

Tip

This is a lightweight check that confirms the Cloudflare Worker is responding. It does not verify database connectivity or other dependencies.

Destination Health Metrics

Returns delivery health metrics for all destinations in your organization. Requires authentication.

curl https://api.hookbase.app/api/organizations/{orgId}/analytics/destinations/health \
  -H "Authorization: Bearer whr_your_api_key"

Query Parameters

ParameterTypeDefaultDescription
rangestring24hTime range: 1h, 24h, or 7d

Response

{
  "range": "24h",
  "destinations": [
    {
      "destinationId": "dst_abc123",
      "deliveryCount": 150,
      "successRate": 98.5,
      "avgLatency": 245,
      "p95Latency": 892,
      "healthScore": 95
    },
    {
      "destinationId": "dst_def456",
      "deliveryCount": 42,
      "successRate": 100,
      "avgLatency": 120,
      "p95Latency": 340,
      "healthScore": 99
    }
  ]
}

Destination Health Object

FieldTypeDescription
destinationIdstringDestination identifier
deliveryCountnumberTotal deliveries in the time range
successRatenumberPercentage of successful deliveries (0–100)
avgLatencynumberAverage delivery latency in milliseconds
p95Latencynumber95th percentile latency in milliseconds
healthScorenumberComposite health score (0–100)

Health Score Calculation

The healthScore is a weighted composite:

healthScore = (successRate × 0.7) + (latencyScore × 0.3)

Where latencyScore scales from 100 (instant) to 0 (5000ms+). Lower latency produces a higher score.

Examples

Check health over the last hour:

curl "https://api.hookbase.app/api/organizations/{orgId}/analytics/destinations/health?range=1h" \
  -H "Authorization: Bearer whr_your_api_key"

Check health over the last 7 days:

curl "https://api.hookbase.app/api/organizations/{orgId}/analytics/destinations/health?range=7d" \
  -H "Authorization: Bearer whr_your_api_key"

Uptime Monitoring

Integration with External Monitors

Use the basic health endpoint with your preferred monitoring service:

UptimeRobot / Pingdom / Better Uptime:

  • URL: https://api.hookbase.app/health
  • Method: GET
  • Expected status: 200
  • Check interval: 60 seconds

Alerting on Unhealthy Destinations

Poll the destination health endpoint and alert when any destination's health score drops:

# Check for destinations with low health scores
curl -s "https://api.hookbase.app/api/organizations/{orgId}/analytics/destinations/health" \
  -H "Authorization: Bearer whr_your_api_key" \
  | jq '.destinations[] | select(.healthScore < 80) | {destinationId, healthScore, successRate}'

See Also