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

# 更新钩子

> 启用或禁用钩子，或更改其冷却时间与配置。

## 路径参数

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

## 请求

所有字段均为可选 — 只需包含你想更改的字段。

<ParamField body="enabled" type="boolean">
  启用或禁用该钩子。禁用的钩子永远不会触发。
</ParamField>

<ParamField body="cooldown_minutes" type="number">
  两次触发之间的最短间隔时间，以分钟为单位（1–1440）。
</ParamField>

<ParamField body="config" type="object">
  特定于该钩子的配置覆盖项。
</ParamField>

## 响应

```json theme={null}
{ "updated": true }
```

## 身份验证

需要具有 `completions` 权限范围的 API 密钥。

## 示例

<CodeGroup>
  ```bash curl theme={null}
  curl -X PATCH https://www.hitheo.ai/api/v1/hooks/HOOK_ID \
    -H "Authorization: Bearer $THEO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "enabled": false }'
  ```

  ```typescript SDK theme={null}
  await theo.updateHook("HOOK_ID", { enabled: false });
  ```
</CodeGroup>


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