Skip to main content

Overview

Returns the current health status of the API server and validates that all required dependencies are properly configured. This endpoint is useful for monitoring, load balancer health checks, and troubleshooting.
curl -X GET https://api.zcombinator.io/health

Response

status
string
Always returns “healthy” when the endpoint is reachable
timestamp
string
ISO 8601 timestamp of when the health check was performed
environment
object
Configuration status for required dependencies
environment.hasRPC
boolean
Whether RPC_URL environment variable is configured
environment.hasConfig
boolean
Whether CONFIG_ADDRESS environment variable is configured
environment.hasPinata
boolean
Whether PINATA_JWT environment variable is configured
environment.hasStorage
boolean
Whether storage system is configured

Success Response

{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "environment": {
    "hasRPC": true,
    "hasConfig": true,
    "hasPinata": true,
    "hasStorage": true
  }
}

Degraded Response

If some optional dependencies are missing:
{
  "status": "healthy",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "environment": {
    "hasRPC": true,
    "hasConfig": false,
    "hasPinata": false,
    "hasStorage": true
  }
}

HTTP Status Codes

The API server is running and responding normally. This doesn’t guarantee all features will work if dependencies are missing.
The health endpoint itself failed, indicating a serious server issue.

Environment Variables Checked

The health endpoint validates these environment variables:
RPC_URL - Required for all blockchain operations
  • ✅ Present: Token launch and claims will work
  • ❌ Missing: All endpoints will fail with configuration errors
CONFIG_ADDRESS - Optional protocol configuration
  • ✅ Present: Advanced protocol features available
  • ❌ Missing: Basic functionality still works
PINATA_JWT - Required for metadata uploads
  • ✅ Present: Automatic IPFS metadata uploads work
  • ❌ Missing: Token launch may require external metadata URLs
Storage - Required for token tracking and claims
  • ✅ Present: Claims system and token verification work
  • ❌ Missing: Claims endpoints will fail

Rate Limiting

This endpoint is subject to the same rate limiting as other endpoints:
  • 8 requests per IP per 2-minute window
  • Returns HTTP 429 when limit exceeded

Use Cases

Configure your load balancer to periodically check this endpoint:
health_check:
  path: /health
  interval: 30s
  timeout: 5s
  healthy_threshold: 2
  unhealthy_threshold: 3
Monitor the environment flags to alert on configuration issues:
const health = await fetch('/health').then(r => r.json());

if (!health.environment.hasRPC) {
  alert('RPC configuration missing - API will not function');
}

if (!health.environment.hasStorage) {
  alert('Storage configuration missing - claims disabled');
}
Check API availability before making requests:
async function isAPIHealthy() {
  try {
    const response = await fetch('/health');
    return response.ok && response.status === 200;
  } catch {
    return false;
  }
}

if (await isAPIHealthy()) {
  // Proceed with API calls
} else {
  // Show maintenance message
}

Security Considerations

Important: The health endpoint does not expose sensitive configuration values, only boolean flags indicating presence. Actual environment variable values are never returned.

Troubleshooting

Common scenarios and their meanings:
The server is running but completely unconfigured. No API functions will work.
Critical error - no blockchain connectivity. All token operations will fail.
Claims system disabled. Token launch may work but verification and claims won’t.
Metadata uploads disabled. Manual IPFS URLs required for token launch.
I