Health Status
GET /v1/health/status
A simple health check endpoint that returns the current system status. Use this for monitoring dashboards, alerting systems, or pre-flight checks before making other API calls.
When to Use Thisβ
- Uptime monitoring β Set up automated checks with Pingdom, UptimeRobot, etc.
- Circuit breakers β Check before making requests to avoid cascading failures
- Status pages β Display real-time API status to your users
- Debugging β Verify connectivity before troubleshooting other issues
Requestβ
Headersβ
No headers requiredβthis is a public endpoint.
Example Requestβ
curl -X GET https://api.verriflo.com/v1/health/status
Responseβ
Healthy (200)β
{
"success": true,
"message": "System is healthy",
"data": {
"status": "healthy",
"healthy": true,
"timestamp": "2024-01-15T09:00:00.000Z",
"version": "1.0.0"
}
}
Degraded (200)β
Some services are experiencing issues, but the API is still functional:
{
"success": true,
"message": "System is degraded",
"data": {
"status": "degraded",
"healthy": false,
"timestamp": "2024-01-15T09:00:00.000Z",
"version": "1.0.0"
}
}
Unhealthy (503)β
The system is experiencing critical issues:
{
"success": true,
"message": "System is unhealthy",
"data": {
"status": "unhealthy",
"healthy": false,
"timestamp": "2024-01-15T09:00:00.000Z"
}
}
Response Fieldsβ
| Field | Type | Description |
|---|---|---|
status | string | "healthy", "degraded", or "unhealthy" |
healthy | boolean | Quick boolean check for healthy status |
timestamp | string | Current server time (ISO format) |
version | string | API version (may be omitted during issues) |
HTTP Status Codesβ
| Code | Status | Meaning |
|---|---|---|
| 200 | healthy | Everything is working normally |
| 200 | degraded | Some issues, but core functionality works |
| 503 | unhealthy | Critical issues, API may not work correctly |
Examplesβ
JavaScript: Pre-flight Checkβ
async function checkAPI() {
try {
const response = await fetch("https://api.verriflo.com/v1/health/status");
const { data } = await response.json();
if (!data.healthy) {
console.warn("Verriflo API is experiencing issues:", data.status);
// Maybe show a banner to users or delay non-critical operations
}
return data.healthy;
} catch (error) {
console.error("Cannot reach Verriflo API");
return false;
}
}
// Use before critical operations
async function startClass(roomId) {
const apiHealthy = await checkAPI();
if (!apiHealthy) {
showWarning("Video service may be experiencing issues. Proceed anyway?");
}
// Continue with class creation...
}
Python: Monitoring Scriptβ
import requests
import time
def monitor_health(interval_seconds: int = 60):
"""Continuously monitor API health."""
while True:
try:
response = requests.get(
'https://api.verriflo.com/v1/health/status',
timeout=5
)
data = response.json()['data']
if not data['healthy']:
send_alert(f"β οΈ Verriflo API is {data['status']}")
print(f"[{data['timestamp']}] Status: {data['status']}")
except requests.exceptions.RequestException as e:
send_alert(f"π¨ Verriflo API unreachable: {e}")
time.sleep(interval_seconds)
Shell: Simple Checkβ
#!/bin/bash
# health-check.sh - Exit 0 if healthy, 1 otherwise
STATUS=$(curl -s https://api.verriflo.com/v1/health/status | jq -r '.data.status')
if [ "$STATUS" = "healthy" ]; then
echo "β
API is healthy"
exit 0
else
echo "β οΈ API status: $STATUS"
exit 1
fi
Best Practicesβ
- Don't over-poll β Check every 30-60 seconds, not every second
- Use timeouts β Set a 5-10 second timeout on health checks
- Alert on patterns β Don't alert on single failures; wait for 2-3 consecutive failures
- Cache the result β If checking before each request, cache for a few seconds
Uptime Monitoring Setupβ
UptimeRobot / Pingdomβ
| Setting | Value |
|---|---|
| URL | https://api.verriflo.com/v1/health/status |
| Method | GET |
| Expected Status | 200 |
| Check Interval | 1-5 minutes |
| Keyword Check | "healthy":true |
Note: This endpoint is rate-limited to prevent abuse. Reasonable monitoring (< 1 request/second) is fine.