Vaults
Update a vault
Update a vault config’s name or provider settings, keeping the stored token.
PATCH
/
api
/
v2
/
vaults
/
{vault_id}
from hai_agents import Client
client = Client()
vault = client.vaults.update_vault(
vault_id=vault_id,
name="prod-1password-eu",
)
print(vault.name)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const vault = await client.vaults.updateVault({
vaultId,
name: "prod-1password-eu",
});
console.log(vault.name);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "prod-1password-eu"}'
Behavior
Only the fields you send change. To replace the stored service account token, use Rotate token.Path parameters
string
required
The vault config’s
id (UUID).Request body
string
New label for the config.
object
Replacement provider settings, in the same shape as on create.
provider cannot change: delete the vault and create a new one to switch. For a 1Password vault, the stored token is health-checked against the new op_vault_id before anything is saved.Response
200 with the updated vault object.
from hai_agents import Client
client = Client()
vault = client.vaults.update_vault(
vault_id=vault_id,
name="prod-1password-eu",
)
print(vault.name)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const vault = await client.vaults.updateVault({
vaultId,
name: "prod-1password-eu",
});
console.log(vault.name);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "prod-1password-eu"}'
Errors
| Status | Cause |
|---|---|
400 | provider_config.provider differs from the vault’s provider, or 1Password rejected the stored token for the new op_vault_id. |
404 | Not found, or not in your organization. |
409 | Another vault in your organization already has this name. |
422 | Body failed validation. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
vault = client.vaults.update_vault(
vault_id=vault_id,
name="prod-1password-eu",
)
print(vault.name)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const vault = await client.vaults.updateVault({
vaultId,
name: "prod-1password-eu",
});
console.log(vault.name);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/vaults/$VAULT_ID \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "prod-1password-eu"}'