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

# Check health

> Probe a vault's provider connection.

Probes the provider behind a vault config to confirm the stored token still works. Use it before a run that depends on the vault, since a token can be revoked or expire on the provider side.

The endpoint returns `200` whenever the provider is reachable, so branch on the `ok` field, not the HTTP status.

Returns a health object with `ok` and an optional `error`.

***

## Path parameters

<ParamField path="vault_id" type="string" required>
  The vault config's `id` (UUID).
</ParamField>

***

## Response

<ResponseField name="ok" type="boolean">
  `true` if the provider accepted the stored token and the vault is reachable.
</ResponseField>

<ResponseField name="error" type="string | null">
  Short reason when `ok` is `false`; `null` otherwise.
</ResponseField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://agp.eu.hcompany.ai/api/v2/vaults/f47ac10b-58cc-4372-a567-0e02b2c3d479/health" \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  health = client.vaults.vault_health(vault_id="f47ac10b-58cc-4372-a567-0e02b2c3d479")
  if not health.ok:
      print("vault unhealthy:", health.error)
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const health = await client.vaults.vaultHealth({ vaultId: "f47ac10b-58cc-4372-a567-0e02b2c3d479" });
  if (!health.ok) {
    console.log("vault unhealthy:", health.error);
  }
  ```
</CodeGroup>

```json Response theme={null}
{
  "ok": true,
  "error": null
}
```

***

## Errors

| Status | Cause                                     |
| ------ | ----------------------------------------- |
| `404`  | Vault not found or you don't have access. |
