> ## 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.

# Update a vault

> Change a vault config's name or provider settings.

Partially updates a vault config. Only the fields you send are changed. To replace the stored service account token, use [Rotate the token](/computer-use-agents/vaults/rotate-token) instead.

Returns the updated [vault object](/computer-use-agents/vaults/retrieve).

***

## Path parameters

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

***

## Request body

<ParamField body="name" type="string">
  New label for the config.
</ParamField>

<ParamField body="provider_config" type="object">
  Replacement provider settings: `provider` (optional, defaults `onepassword`) and `op_vault_id` (required when provided).
</ParamField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://agp.eu.hcompany.ai/api/v2/vaults/f47ac10b-58cc-4372-a567-0e02b2c3d479 \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"name": "prod-1password-eu"}'
  ```

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

  client = Client()

  vault = client.vaults.update_vault(
      vault_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
      name="prod-1password-eu",
  )
  print(vault.name)
  ```

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

  const client = new HaiAgentsClient();

  const vault = await client.vaults.updateVault({
    vaultId: "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    name: "prod-1password-eu",
  });
  console.log(vault.name);
  ```
</CodeGroup>

***

## Errors

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