/api/health
GETHealth check endpoint that returns the current status of the QMail service. Use this endpoint to verify that the API is operational and responsive.
Description
The /api/health endpoint provides a quick health check for the QMail service. It returns basic service information including status, service name, version, and timestamp.
System Monitoring
This endpoint is ideal for:
- Uptime monitoring and health checks
- Service discovery and version verification
- Load balancer health probes
- API connectivity testing
Interactive API Tester
Test this Endpoint
Parameters
This endpoint requires no parameters.
Response
Success Response Properties
status
string
Service status indicator. Typically "ok" when service is healthy.
service
string
Name of the service (e.g., "qmail-api").
version
string
Current version of the QMail service.
timestamp
integer
Unix timestamp (in seconds) when the response was generated.
Success Response Example
{
"status": "ok",
"service": "qmail-api",
"version": "1.0.0",
"timestamp": 1735689845
}
Examples
cURL
curl "http://localhost:8080/api/health"
JavaScript (fetch)
const response = await fetch('http://localhost:8080/api/health');
const result = await response.json();
console.log(result);
Use Cases
- Service Monitoring: Regularly check if the QMail API is operational
- Version Verification: Confirm which version of the API is running
- Load Balancer Health Checks: Use as a health probe endpoint
- Startup Validation: Verify service is ready before making other API calls
Important Notes
Public Endpoint
This is a public endpoint that requires no authentication. It's designed to be lightweight and respond quickly for monitoring purposes.
Timestamp Format
The timestamp is returned as a Unix timestamp in seconds (not milliseconds). To convert to a JavaScript Date object: new Date(timestamp * 1000)