Skip to content

Health Endpoints

Health endpoints for monitoring API status. No authentication required.


Overall health check for the API.

Response (200 OK):

{
"status": "Healthy"
}

Response (503 Service Unavailable):

{
"status": "Unhealthy",
"details": "Database connection failed"
}

Readiness probe for load balancers. Returns 200 when the service is ready to accept traffic.

Response (200 OK):

{
"status": "Ready"
}

Response (503 Service Unavailable):

{
"status": "NotReady",
"details": "Warming up"
}

Use this endpoint for:

  • Kubernetes readiness probes
  • Load balancer health checks
  • Deployment verification

Liveness probe to confirm the application is running.

Response (200 OK):

{
"status": "Alive"
}

Use this endpoint for:

  • Kubernetes liveness probes
  • Basic uptime monitoring
  • Container orchestration

apiVersion: v1
kind: Pod
spec:
containers:
- name: app
livenessProbe:
httpGet:
path: /health/live
port: 80
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /health/ready
port: 80
initialDelaySeconds: 5
periodSeconds: 5
Terminal window
# Check if API is ready for traffic
curl -f https://api.terrascale.io/health/ready || exit 1
#!/bin/bash
# Simple uptime check
response=$(curl -s -o /dev/null -w "%{http_code}" https://api.terrascale.io/health)
if [ "$response" = "200" ]; then
echo "API is healthy"
else
echo "API is unhealthy: HTTP $response"
# Send alert
fi

EndpointHealthy ResponseUnhealthy Response
/healthHealthyUnhealthy
/health/readyReadyNotReady
/health/liveAliveDead

  1. Use appropriate endpoints - /live for container restarts, /ready for traffic routing
  2. Set reasonable timeouts - Health checks should complete within 5 seconds
  3. Monitor response times - Slow health checks may indicate issues
  4. Don’t over-check - Every 10-30 seconds is usually sufficient