Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sagar-grv/ayush-synapse/llms.txt

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

Ayush Synapse exposes two health check endpoints used by Docker containers, load balancers, and external monitoring systems. Both endpoints are unauthenticated and always return 200 OK regardless of internal state — the status field in the body reflects the actual health signal.

GET /health — Basic Health Check

Method: GET
Path: /health
Auth: None
A lightweight liveness probe that confirms the application process is running and data has been loaded.

Response Fields

status
string
Always "healthy" when the process is running.
timestamp
string
UTC timestamp in ISO 8601 format at the time the request was handled (e.g. "2025-01-15T10:30:00.123456").
demo_mode
boolean
Whether the application is running in demo mode. Controlled by the DEMO_MODE environment variable.
namaste_codes_count
integer
Number of NAMASTE codes currently loaded in memory.
mappings_count
integer
Number of concept mappings currently loaded in memory.

Example

curl -X GET http://localhost:5000/health
Response
{
  "status": "healthy",
  "timestamp": "2025-01-15T10:30:00.123456",
  "demo_mode": true,
  "namaste_codes_count": 100,
  "mappings_count": 85
}

GET /health/detailed — Detailed Health Check

Method: GET
Path: /health/detailed
Auth: None
A readiness probe that performs per-component checks across data loading and service availability. Use this endpoint for monitoring dashboards and alerting pipelines.

Response Fields

status
string
"healthy" if all component checks pass, or "degraded" if one or more checks fail.
timestamp
string
UTC timestamp in ISO 8601 format.
demo_mode
boolean
Whether demo mode is active.
data
object
Boolean flags for each data loading check.
services
object
Boolean flags for each service availability check.
counts
object
Raw integer counts for loaded data.

Example

curl -X GET http://localhost:5000/health/detailed
Response
{
  "status": "healthy",
  "timestamp": "2025-01-15T10:30:00.123456",
  "demo_mode": true,
  "data": {
    "namaste_codes": true,
    "concept_maps": true,
    "sample_data_loaded": true
  },
  "services": {
    "csv_parser_service": true,
    "who_api_service": true,
    "auth_service": true
  },
  "counts": {
    "namaste_codes": 100,
    "concept_maps": 85
  }
}

Status Values

ValueMeaning
healthyAll data and service checks passed.
degradedOne or more data or service checks failed. The application is running but may not be fully operational.

Docker Health Check Configuration

The Dockerfile configures a health check using the basic /health endpoint:
Dockerfile
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:5000/health || exit 1
The docker-compose.yml overrides the timing to allow a longer startup window:
docker-compose.yml
healthcheck:
  test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 40s

Build docs developers (and LLMs) love