Health API Reference
Synentra exposes a health check endpoint that can be used for liveness and readiness probes, as well as for monitoring the overall health of the gateway and its dependencies.
The endpoint aggregates the status of various internal components and returns a summary, including the time taken to perform all checks.
Throughout this guide the base URL is assumed to be your running server, e.g. http://localhost:7080.
Replace <BASE_URL> in the examples with your actual server address.
Endpoint
GET <BASE_URL>/health
This endpoint does not require authentication and is intended for monitoring tools, orchestrators (e.g., Kubernetes), and load balancers.
Response
The response is a JSON object with two fields:
| Field | Type | Description |
|---|---|---|
status | string | Overall health status. Possible values: "Healthy" or "Unhealthy". |
healthCheckDuration | string | Time span (format: d.HH:mm:ss.fffffff) taken to execute all health checks. |
- If all registered health checks pass, the HTTP status code is
200 OKandstatusis"Healthy". - If any check fails (or times out), the HTTP status code is
503 Service Unavailableandstatusis"Unhealthy".
Example
- cURL
- JavaScript
- Python
curl "http://localhost:7080/health"
fetch('http://localhost:7080/health')
.then(res => res.json())
.then(console.log);
import requests
response = requests.get('http://localhost:7080/health')
print(response.json())
Response (200 OK):
{
"status": "Healthy",
"healthCheckDuration": "00:00:00.0123456"
}
Response (503 Service Unavailable):
{
"status": "Unhealthy",
"healthCheckDuration": "00:00:00.0456789"
}
Usage in Orchestrators
Kubernetes
The /health endpoint is ideal for both liveness and readiness probes:
livenessProbe:
httpGet:
path: /health
port: 7080
initialDelaySeconds: 10
periodSeconds: 10
Docker / Compose
You can use curl or a custom health check script:
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7080/health"]
interval: 30s
timeout: 5s
retries: 3