Health
Each REST API SHOULD expose a health resource which returns the current availability status of the service.
When invoked without any access token, the resource simply returns its status.
The status code is either 200 OK when the service is up or partially available, or 503 Service Unavailable when the service is down or out of service.
Service is up
{
"status": "UP"
}
When invoked by a client with additional health-check permissions, the resource MAY return additional details on the status of its subsystems or components. This internal information should be hidden from external clients for security reasons.
Service is down, with additional details
{
"status": "DOWN",
"details": {
"datastore": {
"status": "DOWN",
"errorMessage": "connection timeout"
}
}
}
The health resource is specified in common-v1.yaml. Note that uppercase is used for the status values, which differs from the ???, in order to align with existing health checks provided by frameworks like Spring Boot and MicroProfile Health. The format of additional component-level details is not specified.
/health | Check the health status of the API. | |
Response | ||
body | The status of the service. Component-level details may be shown when the client has additional permissions. | |
Response codes | ||
OK | When service is | |
Service Unavailable | When service is | |
Status levels
The health resource returns one of the following status levels indicating the component or system:
| Status | Status Code | Description |
|---|---|---|
| UP | 200 | is functioning as expected. |
| DEGRADED | 200 | is partly unavailable but service can be continued with reduced functionality. |
| DOWN | 503 | is suffering unexpected failures |
The status property also allows custom strings for other use cases.