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