# update_vault_key

`tools/call` · `POST /clanker/v1/vault-keys:update`

Replace a vault key's name and the products and production environments it may pull from; its token stays the same. Returns the key. Needs write access, and your person must be a workspace owner or admin.

- Area: Vault
- Needs the write grant. Idempotent.

## Inputs

- `key` (string, required): The vault key's ID from list_vault_keys, such as Vk2pR7mXq4Ln.
- `name` (string, required): The key's name, 1 to 100 characters, such as Storefront runtime.
- `productIds` (array of strings, required): IDs of the products it may pull. At least one.
- `environmentIds` (array of strings, required): IDs of the production environments it may pull from. At least one.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_vault_key",
    "arguments": {
      "key": "Vk2pR7mXq4Ln",
      "name": "Storefront runtime",
      "productIds": [
        "Pr6tW3kLq8Mz"
      ],
      "environmentIds": [
        "En1vB5nRx7Kp"
      ]
    }
  }
}
```

## HTTP request

The same call over the clanker HTTP API, with a clanker OAuth access token:

```bash
curl -X POST https://api.clankership.com/clanker/v1/vault-keys:update \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "Vk2pR7mXq4Ln",
    "name": "Storefront runtime",
    "productIds": [
      "Pr6tW3kLq8Mz"
    ],
    "environmentIds": [
      "En1vB5nRx7Kp"
    ]
  }'
```
