> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/sdks/backend-sdk/iad/technical_documentation/api_reference/management/health-check.md).

# Health check

Tells whether the service can handle evaluations. It is meant for the probes of orchestrators and load balancers.

* When the license is valid and the analysis engine responds, it returns HTTP 200 with `message` equal to `Healthy`.
* When the service cannot handle evaluations, it returns HTTP 503 (`ServiceUnavailable`) with `message` equal to `Service not initialized`, `Invalid license: <reason> (code: <code>)` or `Engine health check failed: <detail>`. When the license is not valid, the engine is not checked.

To stay cheap under frequent polling, the call reuses the result of the last engine check, successful or failed, while it is younger than `engine_health_max_age_seconds` (10 seconds by default). Once it is older, the engine is checked again with a single attempt, without the `engine_max_retries` retries and with a 5-second limit, so set probe timeouts above 5 seconds. Each engine check refreshes the `state.engine` snapshot published by `GET /api/v1/iad/metrics`.

The analysis engine runs as a separate process in the same container. When that process ends, the call answers 503 with `Engine health check failed: Engine process ended` at once, and the service stops with exit code 1 so that the restart policy of the container starts the service and the engine again.

```json
{"openapi":"3.0.1","info":{"title":"IAD Service REST API","version":"3.0.0"},"tags":[{"name":"Management","description":"Service management and monitoring endpoints"}],"servers":[{"url":"http://127.0.0.1:6982/"}],"security":[],"paths":{"/api/v1/iad/health":{"get":{"summary":"Health check","description":"Tells whether the service can handle evaluations. It is meant for the probes of orchestrators and load balancers.\n\n- When the license is valid and the analysis engine responds, it returns HTTP 200 with `message` equal to `Healthy`.\n- When the service cannot handle evaluations, it returns HTTP 503 (`ServiceUnavailable`) with `message` equal to `Service not initialized`, `Invalid license: <reason> (code: <code>)` or `Engine health check failed: <detail>`. When the license is not valid, the engine is not checked.\n\nTo stay cheap under frequent polling, the call reuses the result of the last engine check, successful or failed, while it is younger than `engine_health_max_age_seconds` (10 seconds by default). Once it is older, the engine is checked again with a single attempt, without the `engine_max_retries` retries and with a 5-second limit, so set probe timeouts above 5 seconds. Each engine check refreshes the `state.engine` snapshot published by `GET /api/v1/iad/metrics`.\n\nThe analysis engine runs as a separate process in the same container. When that process ends, the call answers 503 with `Engine health check failed: Engine process ended` at once, and the service stops with exit code 1 so that the restart policy of the container starts the service and the engine again.\n","operationId":"getHealth","tags":["Management"],"responses":{"200":{"description":"The service is healthy.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResult"}}}},"503":{"description":"The service cannot handle evaluations; `message` gives the reason.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceUnavailableResult"}}}}}}}},"components":{"schemas":{"HealthResult":{"type":"object","description":"Healthy service. It is only returned when the license is valid and the last analysis engine check succeeded.","properties":{"message":{"type":"string","description":"Always `Healthy`."},"initialized":{"type":"boolean","description":"Always `true`."},"engine":{"$ref":"#/components/schemas/EngineHealthSnapshot"}}},"EngineHealthSnapshot":{"type":"object","description":"Result of the last analysis engine check made by the service, which `GET /api/v1/iad/health` runs and reuses for up to `engine_health_max_age_seconds`.","properties":{"healthy":{"type":"boolean","description":"Whether the last check succeeded."},"lastHealthKnown":{"type":"boolean","description":"Whether the service has checked the analysis engine since startup. It is `false` until the first check."},"lastHealthCheckAt":{"type":"string","description":"UTC instant of the last check, in `%Y-%m-%dT%H:%M:%SZ` format. Empty until the first check."},"lastError":{"type":"string","description":"Reason of the last failed check, for example `Connection failed`, `Request timeout`, `Engine is unhealthy (503)` or `Engine process ended`. Empty when the last check succeeded. A license that is not valid is not recorded here."}}},"ServiceUnavailableResult":{"type":"object","description":"The service cannot handle the request right now. The capture endpoints return it when the analysis engine does not respond; `GET /api/v1/iad/health` returns it when the service cannot handle evaluations.","properties":{"status":{"type":"number"},"error":{"type":"string"},"message":{"type":"string","description":"Reason why the service is not available."},"timeStamp":{"$ref":"#/components/schemas/TimeStamp"}}},"TimeStamp":{"type":"string","description":"UTC date and time in `%Y-%m-%dT%H:%M:%SZ` format (second precision)."}}}}
```
