---
title: "Detailed health"
method: GET
path: "/api/health"
tags: ["Health"]
---

# Detailed health

`GET /api/health`

## Request

- Base URL: `https://market-api.metadao.fi`
- URL: `https://market-api.metadao.fi/api/health`
- Auth: one of:
  - none
  - API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/metadao/apis/futarchy-external-api/docs/api/health/get.ts> (a function with typed inputs; its response is checked against the schema)

Served-database connectivity, data-contract and freshness checks. Returns 200 when `status` is "healthy" and 503 with the same body when it is "degraded".

## Response `200`

Healthy.

- DetailedHealth
  - `status` 'healthy' | 'degraded', required
  - `message` string: Reason, present when degraded.
  - `timestamp` string, date-time, required
  - `uptime` number, required: Process uptime in seconds.
  - `servedDatabase` object, required
    - `connected` boolean, required
    - `servedDataContract` object, required
      - `ok` boolean, required
      - `checkedAt` string, date-time, required
      - `missing` string[], required: Missing tables/columns, or ["connection"].
    - `freshness` object, nullable, required: Newest served swap; null when disconnected or the check failed.
      - `latestSwapAt` string, date-time, nullable, required
      - `ageSeconds` number, nullable, required

## Other responses

- `401`: Unknown `X-API-Key` (`INVALID_API_KEY`), or missing/invalid metrics bearer token on `/metrics`.
- `429`: Rate limit exceeded (`RATE_LIMITED`).
- `503`: Degraded (same body, `status: "degraded"` with a `message`), or `REQUEST_TIMEOUT` (`Error` body) if the checks took longer than the request timeout.

---

[API](https://skmtc.dev/metadao/apis/futarchy-external-api.md) - [All operations](https://skmtc.dev/metadao/apis/futarchy-external-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metadao/apis/futarchy-external-api/revisions/27b09f0a2750?raw)
