Health Check API
Public endpoint to monitor API health, database connectivity, and service status.
No authentication required. This endpoint is publicly accessible and does not require an API key.
Endpoints
GET /api/healthQuick check (~1-2s) that tests database connectivity.
GET /api/health?detailed=trueComprehensive check (~5-10s) that tests all API endpoints.
Quick Health Check
The quick health check returns a fast response indicating if the API and database are operational.
Request
curl https://mentibus.xyz/api/health
Response
{
"status": "operational",
"timestamp": "2025-10-20T20:15:05.432Z",
"responseTime": 1250,
"services": {
"database": "operational",
"api": "operational"
}
}Response Fields
statusOverall system status: operational or errortimestampISO 8601 timestamp of the checkresponseTimeCheck duration in millisecondsservicesIndividual service statusesDetailed Health Check
The detailed health check tests all critical API endpoints and returns comprehensive status information.
Request
curl "https://mentibus.xyz/api/health?detailed=true"
Response
{
"status": "operational",
"operational": true,
"timestamp": "2025-10-20T20:15:11.249Z",
"responseTime": 593,
"services": {
"database": "operational",
"api": "operational"
},
"endpoints": [
{
"name": "Companies API",
"status": "operational",
"responseTime": 38
},
{
"name": "People API",
"status": "operational",
"responseTime": 17
},
{
"name": "Investors API",
"status": "operational",
"responseTime": 20
},
{
"name": "Search API",
"status": "operational",
"responseTime": 15
}
]
}Additional Response Fields
operationalBoolean indicating if all critical endpoints are functionalendpointsArray of individual endpoint checks with status and response timesCode Examples
JavaScript / TypeScript
// Quick check
const response = await fetch('https://mentibus.xyz/api/health');
const health = await response.json();
if (health.status === 'operational') {
console.log('✅ API is healthy');
} else {
console.log('❌ API has issues');
}
// Detailed check
const detailedResponse = await fetch('https://mentibus.xyz/api/health?detailed=true');
const detailedHealth = await detailedResponse.json();
console.log(`Operational: ${detailedHealth.operational}`);
console.log(`Response time: ${detailedHealth.responseTime}ms`);
detailedHealth.endpoints.forEach(endpoint => {
console.log(`${endpoint.name}: ${endpoint.status} (${endpoint.responseTime}ms)`);
});Python
import requests
# Quick check
response = requests.get('https://mentibus.xyz/api/health')
health = response.json()
if health['status'] == 'operational':
print('✅ API is healthy')
else:
print('❌ API has issues')
# Detailed check
detailed_response = requests.get('https://mentibus.xyz/api/health?detailed=true')
detailed_health = detailed_response.json()
print(f"Operational: {detailed_health['operational']}")
print(f"Response time: {detailed_health['responseTime']}ms")
for endpoint in detailed_health['endpoints']:
print(f"{endpoint['name']}: {endpoint['status']} ({endpoint['responseTime']}ms)")cURL
# Quick check curl https://mentibus.xyz/api/health # Detailed check with pretty-printed JSON curl "https://mentibus.xyz/api/health?detailed=true" | jq . # Check if operational (returns exit code) curl -s "https://mentibus.xyz/api/health?detailed=true" | jq -e '.operational'
Use Cases
• Uptime monitoring with tools like UptimeRobot or Pingdom
• Building public status pages
• Setting up alerting systems
• Pre-deployment health checks in CI/CD pipelines
HTTP Status Codes
| Status Code | Meaning | Response |
|---|---|---|
| 200 | All systems operational | status: "operational" |
| 503 | Service unavailable or degraded | status: "error" or "degraded" |
Best Practices
Check Intervals
Quick check: every 30-60 seconds. Detailed check: every 5-10 minutes.
Timeouts
Set 5-10 second timeout for quick checks, 15-30 seconds for detailed checks.
Monitoring
Use quick checks for frequent monitoring, detailed checks for investigation.