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

# Rotate Secret

> Generate a new signing secret for a webhook. The old secret is invalidated immediately.

## Path Parameters

<ParamField path="id" type="string" required>
  The webhook UUID.
</ParamField>

## Behavior

Generates a new cryptographically random 32-byte hex signing secret, encrypts it at rest (AES-256-GCM), and immediately invalidates the previous secret. All subsequent deliveries will be signed with the new secret.

**Update your verification code immediately after rotation** — any in-flight deliveries signed with the old secret will fail verification on your end.

## Example

```bash theme={null}
curl -X POST https://www.hitheo.ai/api/v1/webhooks/WEBHOOK_ID/rotate-secret \
  -H "Authorization: Bearer $THEO_API_KEY"
```

### Response

```json theme={null}
{
  "id": "a1b2c3d4-...",
  "signing_secret": "new_secret_hex_here...",
  "_note": "Save the new signing_secret — it will not be shown again. The old secret is now invalid."
}
```

<Warning>
  The new secret is shown **once**. If you lose it, you'll need to rotate again.
</Warning>
