> ## 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.

# 輪換密鑰

> 為 Webhook 生成新的簽名密鑰。舊密鑰將立即失效。

## 路徑參數

<ParamField path="id" type="string" required>
  Webhook 的 UUID。
</ParamField>

## 行為說明

生成一個經密碼學隨機算法產生的 32 字節十六進制簽名密鑰,以靜態加密方式(AES-256-GCM)存儲,並立即使舊密鑰失效。之後的所有投遞都將使用新密鑰進行簽名。

**請在輪換後立即更新你的驗證代碼** —— 任何仍在傳輸中、以舊密鑰簽名的投遞,都將在你這一端驗證失敗。

## 示例

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

### 響應

```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>
  新密鑰只會顯示**一次**。如果丟失,你需要再次執行輪換。
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.