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

# Health check

> Public, no customer data. Reports the deployed version (the deploy tag, else the Worker version id) and whether a Postgres round trip through the Worker's own Hyperdrive binding succeeded within about 2 seconds and showed the app role holding the write privileges the API needs. 503 with `db: unavailable` when it did not; the cause is logged, never returned.



## OpenAPI

````yaml /openapi.json get /health
openapi: 3.1.0
info:
  title: Moonbounce Decisions API
  version: 0.0.0
  description: >-
    Moonbounce decisions: evaluate items against a decision spec (features
    combined by aggregators), record feedback and seed examples, review a ranked
    queue, and improve the spec through suggestions that ship as code diffs,
    each with a preview (backtest) and an evidence label.


    **Authentication.** Send an API key as `Authorization: Bearer <key>` on
    every operation except `GET /health` and `POST /v1/specs/hash`. Call the API
    from a server, never a browser: a key must not reach one, and the API sends
    no CORS headers. A key belongs to one organization and one environment:
    production, or test for a key with the `env:test` permission. Test traffic
    never counts as production traffic.


    **Requests.** JSON bodies (`Content-Type: application/json`) of at most 1
    MB, parsed strictly: duplicate keys, lone surrogates, integers outside
    ±(2^53 - 1), `__proto__` keys, U+0000 and nesting deeper than 64 are a 400.


    **Retries.** Send an `Idempotency-Key` on every POST under /v1 that takes
    one (all but `POST /v1/specs/hash`). Keep it for the request's retries. The
    same key with the same request returns the first stored result, marked
    `Idempotent-Replayed: true`, for 24 hours (410 if that result was since
    deleted); with another request it is 422 IDEMPOTENCY_KEY_REUSED. Keys are
    scoped to the organization and environment across every operation, so use a
    fresh key per request. A request that failed before its result was stored
    runs again when retried. 429 and 503 under /v1 may carry `Retry-After`
    (seconds); a daily QUOTA_EXCEEDED cap instead names its reset time.


    **Errors.** Every error under /v1 is `{"error": {"type", "message",
    "reason"?, "param"?, "details"?}}` (ErrorBody); `GET /health` answers its
    own shape. Every response carries a `Request-Id` header. Rate limits apply
    per key and per client IP, counted per Cloudflare location.
servers:
  - url: https://api.moonbounce.ai
    description: Production
security: []
paths:
  /health:
    get:
      tags:
        - health
      summary: Health check
      description: >-
        Public, no customer data. Reports the deployed version (the deploy tag,
        else the Worker version id) and whether a Postgres round trip through
        the Worker's own Hyperdrive binding succeeded within about 2 seconds and
        showed the app role holding the write privileges the API needs. 503 with
        `db: unavailable` when it did not; the cause is logged, never returned.
      operationId: getHealth
      responses:
        '200':
          description: The service is up and the database answered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthResponse'
        '503':
          description: The database did not answer in time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HealthResponse'
      security: []
components:
  schemas:
    HealthResponse:
      type: object
      properties:
        ok:
          type: boolean
        version:
          type: string
          example: 5f3a9c1d2e4b
        db:
          type: string
          enum:
            - ok
            - unavailable
      required:
        - ok
        - version
        - db

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.