> ## Documentation Index
> Fetch the complete documentation index at: https://figranium.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# HealthResource: Service Status Check

> Use the HealthResource to verify that a Figranium server is running and reachable. No authentication is required.

The `HealthResource` on `client.health` provides a lightweight liveness probe for any Figranium instance. Call `check()` to confirm the server is up, read its version, and verify that your SDK install and network path are working. No API key is required.

## Client setup

```kotlin HealthResource.kt theme={null}
import dev.figranium.sdk.Figranium

val client = Figranium()
```

## Methods

> [accordion] `check`
>
> ```kotlin theme={null}
> suspend fun check(options: RequestOptions = RequestOptions()): HealthStatus
> ```
>
> Performs a `GET /api/health` request and returns the server's health status. This is the fastest way to verify connectivity and SDK configuration.
>
> ### Returns
>
> `HealthStatus` with these fields:
>
> * `status`: a human-readable status string such as `"ok"`
> * `version`: the running Figranium server version
>
> ### Example: verify connectivity
>
> ```kotlin health_check.kt theme={null}
> val status = client.health.check()
> println(status.status)   // "ok"
> println(status.version)  // "0.14.4"
> ```
>
> ### Example: no authentication needed
>
> Because `check()` requires no authentication, you can call it before the user has signed in or provided an API key:
>
> ```kotlin health_no_auth.kt theme={null}
> val client = Figranium(baseUrl = "https://figranium.example")
> val status = client.health.check()
> println(status.status)
> ```
>
> ### Example: handle transport failures
>
> Wrap `check()` in a `try/catch` to detect network or DNS issues. Transport failures surface as `FigraniumException` with `code: "NETWORK_ERROR"`:
>
> ```kotlin health_transport.kt theme={null}
> val client = Figranium(baseUrl = "https://figranium.example")
>
> try {
>     val status = client.health.check()
>     println("Server is up: ${status.status}")
> } catch (error: FigraniumException) {
>     if (error.code == "NETWORK_ERROR") {
>         println("Cannot reach the Figranium server. Check the baseUrl and network.")
>     }
>     throw error
> }
> ```
>
> > [!NOTE]
> >
> > The `check()` method accepts the standard `RequestOptions` as its `options` argument, so you can pass custom `headers` or a per-request `timeout` when needed.

## Related resources

> [card] [Errors](https://figranium.dev/docs/sdk/kotlin/errors.md)
>
> Handle `FigraniumException` responses, including `NETWORK_ERROR`.

> [card] [Request options](https://figranium.dev/docs/sdk/kotlin/request-options.md)
>
> Pass custom `headers` and per-request `timeout` overrides.

> [card] [Client configuration](https://figranium.dev/docs/sdk/kotlin/client-configuration.md)
>
> Configure `baseUrl`, timeouts, and default headers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.