> ## Documentation Index
> Fetch the complete documentation index at: https://supahooks.ar27111994.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /health and /ready — liveness and readiness probes

> GET /health and GET /ready are liveness and readiness probes for Webhook Debugger & Logger. Both are rate-limited but never require authentication.

The server exposes two probe endpoints for container orchestrators, load balancers, and uptime monitors. Both are **rate-limited** but **never auth-protected**, even when `authKey` is configured. This allows infrastructure tooling to probe the service without credentials.

## GET /health

Liveness probe. Returns `200 OK` when the server process is running. Use this to detect whether the process needs to be restarted.

### Response example

```json theme={null}
{
  "status": "healthy",
  "uptime": 3600,
  "timestamp": "2026-01-30T12:00:00.000Z",
  "memory": {
    "heapUsed": 50,
    "heapTotal": 100,
    "rss": 140,
    "unit": "MB"
  }
}
```

<ResponseField name="status" type="string">
  Always `healthy` when the process is responsive.
</ResponseField>

<ResponseField name="uptime" type="number">
  Process uptime in seconds.
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp of the response.
</ResponseField>

<ResponseField name="memory" type="object">
  Current Node.js memory usage. All values are in megabytes (`unit: "MB"`).
</ResponseField>

***

## GET /ready

Readiness probe. Returns `200 OK` when the service is ready to handle traffic — specifically, when DuckDB and the webhook manager are initialized. Use this to hold traffic away from an instance that is still starting up or is mid-shutdown.

### Response example (ready)

```json theme={null}
{
  "status": "ready",
  "timestamp": "2026-01-30T12:00:00.000Z",
  "checks": {
    "database": {
      "status": "ok"
    },
    "webhooks": {
      "status": "ok",
      "message": "1 active webhook(s)"
    }
  }
}
```

### Response example (not ready — 503)

When any dependency check fails, the route returns `503 Service Unavailable` and changes the top-level status to `not_ready`. The `checks` map shows which subsystem failed.

```json theme={null}
{
  "status": "not_ready",
  "timestamp": "2026-01-30T12:00:00.000Z",
  "checks": {
    "database": {
      "status": "error",
      "message": "DuckDB not initialized"
    },
    "webhooks": {
      "status": "ok",
      "message": "1 active webhook(s)"
    }
  }
}
```

<ResponseField name="status" type="string">
  `ready` when all checks pass; `not_ready` when any check fails.
</ResponseField>

<ResponseField name="checks" type="object">
  Per-subsystem check results. Each entry has a `status` of `ok` or `error` and an optional `message`.
</ResponseField>

## Graceful shutdown behavior

During intentional shutdown, the HTTP listener is drained before internal services wind down. This means probe traffic never reaches a partially torn-down state — the server stops accepting new connections cleanly before shutting down.
