GET
/
api
/
messaging
/
sessions
/
health
Sessions API health check
curl --request GET \
  --url http://localhost:3000/api/messaging/sessions/health
{
  "status": "healthy",
  "activeSessions": 123,
  "timestamp": "2023-11-07T05:31:56Z",
  "expiringSoon": 123,
  "invalidSessions": 123,
  "uptime": 123
}
This endpoint provides real-time health metrics for the Sessions API service, including active session counts and service uptime.

Response

status
string
Service health status: “healthy”, “degraded”, or “unhealthy”
activeSessions
number
Number of currently active (non-expired) sessions
timestamp
string
ISO timestamp of the health check
expiringSoon
number
Number of sessions that are within their warning threshold
invalidSessions
number
Number of corrupted or invalid sessions detected (only shown if > 0)
uptime
number
Service uptime in seconds

Example Response

{
  "status": "healthy",
  "activeSessions": 42,
  "timestamp": "2024-01-15T10:30:45.123Z",
  "expiringSoon": 3,
  "uptime": 3600.5
}

Health Status Meanings

  • healthy: Service is operating normally
  • degraded: Service is operational but experiencing issues (e.g., invalid sessions detected)
  • unhealthy: Service is not operational or experiencing critical issues

Usage

This endpoint is useful for:
  • Monitoring service availability
  • Tracking session volume
  • Detecting memory leaks (via active session count)
  • Setting up health check probes in orchestration systems
  • Dashboard metrics and alerting

Response

200 - application/json

Sessions API is healthy

status
enum<string>
Available options:
healthy,
degraded,
unhealthy
activeSessions
integer

Number of currently active sessions

timestamp
string<date-time>
expiringSoon
integer

Number of sessions near expiration

invalidSessions
integer

Number of invalid sessions detected (only shown if > 0)

uptime
number

Service uptime in seconds