Health check
GET
https://app.speybooks.com/api/v1/health/Check the operational status of all SpeyBooks subsystems. Performs four subsystem checks in sequence:
- API — always operational if this endpoint responds (latency fixed at 0)
- Database — executes
SELECT 1with a 3-second timeout. Marked degraded if latency exceeds 1000ms, outage if the query fails or times out - Email (SES) — calls AWS SES
GetSendQuotawith a 5-second timeout. This verifies both credentials and service connectivity. Timeout without error is degraded; credential or connection failure is outage - Auth — self-check POST to the login endpoint with dummy credentials. Expects 400 or 401 as proof the auth pipeline is operational. 429 (rate limited) is also accepted. Other status codes are degraded; connection failure or abort is outage
The response includes per-service latency in milliseconds, the current API version, and a UTC timestamp.
Degraded example:
{
"success": true,
"data": {
"status": "degraded",
"services": {
"api": { "status": "operational", "latency": 0 },
"database": { "status": "degraded", "latency": 1523, "message": "Slow response" },
"email": { "status": "operational", "latency": 310 },
"auth": { "status": "operational", "latency": 45 }
}
}
}
Outage example (HTTP 503):
{
"success": true,
"data": {
"status": "outage",
"services": {
"api": { "status": "operational", "latency": 0 },
"database": { "status": "outage", "message": "Connection failed" },
"email": { "status": "operational", "latency": 200 },
"auth": { "status": "operational", "latency": 50 }
}
}
}
Monitoring integration: This endpoint is designed for uptime services (e.g. UptimeRobot, Pingdom). Alert on HTTP 503 for outages. For degraded detection, parse the JSON body and check per-service statuses.
Response
200 All services operational or degraded. Returns individual service status, latency, and an overall rollup.
Show response fields
services objectIndividual service health checks.
Show child attributes
api objectShow child attributes
latency integerResponse time in milliseconds. Always 0 for the API service itself.
status stringAPI process status. Always operational if this response is returned.
auth objectShow child attributes
latency integerAuth endpoint response time in milliseconds.
message string nullableHuman-readable status message when degraded or outage.
status stringAuthentication service status. Verified by probing the login endpoint.
database objectShow child attributes
latency integerDatabase query response time in milliseconds.
message string nullableHuman-readable status message when degraded or outage.
status stringPostgreSQL connection status. Degraded if latency exceeds 1000ms.
email objectShow child attributes
latency integerSES GetSendQuota response time in milliseconds.
message string nullableHuman-readable status message when degraded or outage.
status stringAWS SES email service status.
status stringOverall system status. Outage if any service is down; degraded if any service is slow.
operationaldegradedoutagetimestamp string date-timeISO 8601 timestamp of the health check.
version stringAPI version string.
Error codes
503 One or more services are in outage.