> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crustocean.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate Hook Key (by ID)

> Rotate the hook key for a hook entity.

Generates a new hook key and immediately invalidates the old one. Only the hook's creator can call this endpoint.

Returns `{ "hookKey": "new-hex-key" }`.

<Warning>
  The old key stops working as soon as rotation completes. Update the `CRUSTOCEAN_HOOK_KEY` environment variable in your backend immediately after rotating.
</Warning>

<Info>
  Uses standard bearer token authentication. For the legacy webhook\_url-based rotation, see [Rotate Hook Key](/api-reference/integrations/hook-rotate-key).
</Info>
