# update_secret

`tools/call` · `POST /clanker/v1/secrets:update`

Rename a secret, or clear its value in some environments. Clearing writes an empty version you can restore from. Production is cleared only by admins and owners. Returns each environment's outcome without values. Needs write access.

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

## Inputs

- `product` (string, required): The product's slug, such as storefront.
- `name` (string, required): The secret's name, such as DATABASE_URL.
- `newName` (string): A new name, such as DATABASE_URL_PRIMARY.
- `clear` (array of strings): Slugs of the environments whose value to clear, such as staging.

## Request

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_secret",
    "arguments": {
      "product": "storefront",
      "name": "LEGACY_TOKEN",
      "clear": [
        "staging"
      ]
    }
  }
}
```

## 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/secrets:update \
  -H "Authorization: Bearer $CLANKER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "product": "storefront",
    "name": "LEGACY_TOKEN",
    "clear": [
      "staging"
    ]
  }'
```
