Check Health
Check that the API is ready: it reaches the database with a SELECT 1, answers 200 while the database answers and 503 as soon as it does not. No authentication, so an uptime monitor can poll it every minute.
get
/healthcurl --request GET \
--url 'https://api.tries.care/health'const response = await fetch("https://api.tries.care/health");
const data = await response.json();{
"status": "ok",
"version": "6d649b3612c4e0f1a8b2d9c7e5f30a4b1c2d3e4f",
"checks": {
"database": true,
"stripe": true
}
}{
"status": "unavailable",
"version": "6d649b3612c4e0f1a8b2d9c7e5f30a4b1c2d3e4f",
"checks": {
"database": false,
"stripe": true
}
}Responses
- 200The API is ready: its database answers.application/json
statusenum<string>requiredversionstringnullablerequiredThe commit the running build was made from, or null outside a deployed build.
checksobjectrequiredProperties (2)
databasebooleanrequiredWhether the database answered a SELECT 1.
stripebooleanrequiredWhether a Stripe key is configured. No call is made to Stripe, and this check never makes the API unavailable.
- 503The API is not ready: its database did not answer, or the probe itself failed.application/json
statusenum<string>requiredversionstringnullablerequiredThe commit the running build was made from, or null outside a deployed build.
checksobjectrequiredProperties (2)
databasebooleanrequiredWhether the database answered a SELECT 1.
stripebooleanrequiredWhether a Stripe key is configured. No call is made to Stripe, and this check never makes the API unavailable.