# Health Monitoring API

**Page:** api/code/health-monitoring

[Download Raw Markdown](./api/code/health-monitoring.md)

---

{/* AUTO-GENERATED — Do not edit manually. Regenerate with: npm run docs:api:generate */}



## Health Monitoring

The Health Monitoring API provides lightweight diagnostics for Hoody Code instances. Use these endpoints to verify service availability, inspect runtime metrics, and detect available updates. The health check endpoint is excluded from heartbeat activity, so monitoring systems can poll it without extending the active lifetime of a Hoody Code process.

---

### `GET /api/v1/code/health`

Returns standardized service health status with process and runtime info. This endpoint does not count towards heartbeat activity, allowing health checks without keeping Hoody Code artificially alive.

This endpoint takes no parameters.



```bash
curl -X GET "https://api.hoody.com/api/v1/code/health" \
  -H "Authorization: Bearer <token>"
```


```typescript
const result = await client.code.health.check();
```


```json
{
  "status": "ok",
  "service": "hoody-code",
  "built": "2026-04-13T14:30:00Z",
  "started": "2026-04-13T15:00:00Z",
  "memory": {
    "rss": 134217728,
    "heap": 62914560
  },
  "fds": 47,
  "pid": 1284,
  "ip": "198.51.100.42",
  "userAgent": "HoodyMonitor/1.0"
}
```



#### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `status` | string | Service status. Always `"ok"` when healthy. |
| `service` | string | Service identifier. Always `"hoody-code"`. |
| `built` | string \| null | ISO 8601 build timestamp (mtime of the compiled entry file), or `null` if unavailable. |
| `started` | string | ISO 8601 timestamp when the process started. |
| `memory` | object \| null | Process memory usage. Contains `rss` (integer, bytes) and `heap` (integer \| null, V8 heap used in bytes). |
| `fds` | integer \| null | Open file descriptor count (from `/proc/self/fd`), or `null` if unavailable. |
| `pid` | integer | Process ID. |
| `ip` | string | Remote peer IP (`req.socket.remoteAddress`, never `X-Forwarded-For`). |
| `userAgent` | string \| null | Request `User-Agent` header. |

---

### `GET /api/v1/code/update/check`

Checks for available Hoody Code updates. This endpoint queries the GitHub releases API (unless disabled with `--disable-update-check`) and caches results for 6 hours, notifying clients at most once per week.

This endpoint takes no parameters.



```bash
curl -X GET "https://api.hoody.com/api/v1/code/update/check" \
  -H "Authorization: Bearer <token>"
```


```typescript
const result = await client.code.health.checkUpdate();
```


```json
{
  "current": "4.0.0",
  "latest": "4.1.0",
  "updateAvailable": true
}
```



#### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `current` | string | Currently installed version (e.g. `"4.0.0"`). |
| `latest` | string | Latest available version (e.g. `"4.1.0"`). |
| `updateAvailable` | boolean | Whether a newer version is available. |