Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/danizd/geoviable/llms.txt

Use this file to discover all available pages before exploring further.

The /health endpoint reports whether the GeoViable API is running and whether it can reach the PostgreSQL/PostGIS database. On each call it executes a lightweight SELECT 1 query against the database and returns the result. It is used by Docker healthchecks to determine container readiness and by uptime monitoring tools to detect outages. Method and path: GET /api/v1/health

Request

No parameters. No request body.
curl https://geoviable.movilab.es/api/v1/health

Response — 200 OK (Healthy)

Returned when the API is running and the database connection is active.
{
  "status": "healthy",
  "database": "connected",
  "version": "1.0.0"
}

Response — 503 Service Unavailable (Unhealthy)

Returned when the API process is running but cannot reach the database.
{
  "status": "unhealthy",
  "database": "disconnected",
  "version": "1.0.0"
}

Response Fields

status
string
Overall service health. "healthy" when the database is reachable; "unhealthy" when the database connection fails.
database
string
Database connectivity state. Either "connected" or "disconnected".
version
string
Current API version string (e.g., "1.0.0").

Docker Healthcheck Configuration

The following Docker Compose healthcheck configuration polls this endpoint every 30 seconds:
healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/health"]
  interval: 30s
  timeout: 10s
  retries: 3
Docker marks the container as unhealthy after 3 consecutive failed checks, at which point a restart policy (if configured) will attempt to recover the service.
A 503 response means the API process is alive but the database container is down or unreachable. To investigate, run docker compose ps to check container states and docker compose logs geoviable-db to inspect the database container logs for startup errors or crashes.

Build docs developers (and LLMs) love