# Shred a realm's secrets

> Destroy the realm's secrets key, so every secret in the realm's own vault becomes unreadable for good, in every copy and backup.

When the organization's secrets must be gone for certain, finding and deleting every copy isn't enough: backups and
replicas keep them. Destroying the realm's secrets key makes every secret in the realm's vault unreadable at once,
wherever a copy of the database sits.

**Before you start:** you are a realm administrator holding `RealmOwner` in this realm or a realm above it, signed in
with your session in `$CVYUH_SESSION` ([Call the API](/develop/api/) shows how). This reaches the realm's own vault,
and one-time shares, which are sealed under the realm's key too. Each user's and group's secrets are under their own
keys, which are destroyed when that user or group is deleted. Hand on anything others still need from the realm's
vault first.

<Aside type="danger" title="This can't be undone">
  Every version of the key is destroyed. Nothing in the realm's vault can be opened again.
</Aside>

## Destroy the key

<Steps>

1. Destroy it, saying so explicitly:

   ```sh
   curl -X DELETE "https://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryption?shred=true" \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

   The realm answers `200` with the versions destroyed. Without `?shred=true` the call is refused (`400`), so it can't
   be made by mistake.

2. Record when and why you did it. Destroying the realm's secrets key isn't on the realm's audit trail yet.

</Steps>

## Check it worked

Any call to the realm's vault now answers `503`, saying the realm has no secrets key, and so does making or reading a
one-time share. The realm's other data, its users' and groups' vaults, and grants on them, are untouched.

## Related

- [Crypto-shredding](/secrets-store/keys-and-protection/crypto-shredding/): every key the store destroys, and when.
- [Offboard someone](/secrets-store/guides/offboard-someone/): a user's key, destroyed with their account.
