Skip to main content

GET /api/health

Verifies the health status of the server and its connected services. This endpoint provides real-time information about the database connection, system resources, and overall server health.

Endpoint

GET /api/health
Authentication: None (Public endpoint)

Response Fields

success
boolean
required
Indicates if the health check completed successfully
status
string
required
Overall health status of the server
  • healthy: All services are operational
  • degraded: One or more services are not functioning properly
timestamp
string
required
ISO 8601 timestamp of when the health check was performed
uptime
string
required
Server uptime in seconds (e.g., “3600s”)
services
object
required
Status of connected services
system
object
required
System resource information

Response Examples

{
  "success": true,
  "status": "healthy",
  "timestamp": "2025-11-27T12:00:00.000Z",
  "uptime": "3600s",
  "services": {
    "database": {
      "status": "connected",
      "connected": true
    }
  },
  "system": {
    "nodeVersion": "v18.19.0",
    "memory": {
      "heapUsed": "45MB",
      "heapTotal": "65MB",
      "rss": "85MB"
    }
  }
}

Status Codes

CodeDescription
200Server is healthy and all services are operational
503Server is degraded (typically due to database disconnection)

Example Request

curl http://localhost:3001/api/health

Use Cases

  • Monitoring: Use in health check monitoring systems to verify server availability
  • Load Balancers: Configure load balancers to route traffic only to healthy instances
  • CI/CD: Verify deployment success by checking health status
  • Debugging: Quickly identify service connectivity issues

Build docs developers (and LLMs) love