Check health
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"error": {}
}Vaults
Check health
Probe a vault’s provider connection to confirm the stored token works before a session needs it.
GET
/
api
/
v2
/
vaults
/
{vault_id}
/
health
Check health
curl --request GET \
--url https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health \
--header 'Authorization: Bearer <token>'import requests
url = "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://agp.eu.hcompany.ai/api/v2/vaults/{vault_id}/health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"ok": true,
"error": {}
}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 the health object below.
Path parameters
string
required
The vault config’s
id (UUID).Response
boolean
true if the provider accepted the stored token and the vault is reachable.string | null
Short reason when
ok is false, otherwise null.Examples
curl "https://agp.eu.hcompany.ai/api/v2/vaults/f47ac10b-58cc-4372-a567-0e02b2c3d479/health" \
-H "Authorization: Bearer $HAI_API_KEY"
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)
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);
}
Response
{
"ok": true,
"error": null
}
Errors
| Status | Cause |
|---|---|
404 | Vault not found or you don’t have access. |
Was this page helpful?