Vaults
Check vault health
Check that a vault’s stored token still works before a session needs it.
GET
/
api
/
v2
/
vaults
/
{vault_id}
/
health
from hai_agents import Client
client = Client()
health = client.vaults.vault_health(vault_id=vault_id)
if not health.ok:
print("vault unhealthy:", health.error)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const health = await client.vaults.vaultHealth({ vaultId });
if (!health.ok) {
console.log("vault unhealthy:", health.error);
}
curl "https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID/health" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"ok": true,
"error": null
}
Behavior
The endpoint returns200 even when the provider is unreachable, so branch on the ok field, not the HTTP status. An H-hosted vault has no external provider and always reports ok: true.
Path parameters
string
required
The vault config’s
id (UUID).Response
200 with the health result.
boolean
true if the provider accepted the stored token and the vault is reachable.string | null
Short reason when
ok is false, otherwise null.from hai_agents import Client
client = Client()
health = client.vaults.vault_health(vault_id=vault_id)
if not health.ok:
print("vault unhealthy:", health.error)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const health = await client.vaults.vaultHealth({ vaultId });
if (!health.ok) {
console.log("vault unhealthy:", health.error);
}
curl "https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID/health" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"ok": true,
"error": null
}
Errors
| Status | Cause |
|---|---|
404 | Not found, or not in your organization. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
health = client.vaults.vault_health(vault_id=vault_id)
if not health.ok:
print("vault unhealthy:", health.error)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const health = await client.vaults.vaultHealth({ vaultId });
if (!health.ok) {
console.log("vault unhealthy:", health.error);
}
curl "https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID/health" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"ok": true,
"error": null
}