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

# 獲取、更新或刪除偏好設置

> 獲取、修改或徹底刪除單個路由工作室（Routing Studio）偏好設置。

獲取、修改或徹底刪除單個路由工作室（Routing Studio）偏好設置。可見範圍：創建者本人或所屬組織的任意成員。非成員將收到 `404`，以確保團隊偏好設置的存在性不會被泄露。

## 身份驗證

需要攜帶具有 `billing` API 密鑰作用域的 Bearer 令牌。

## GET

獲取完整的偏好設置快照。

```bash theme={null}
curl https://www.hitheo.ai/api/v1/routing-preferences/{id} \
  -H "Authorization: Bearer $THEO_API_KEY"
```

```typescript theme={null}
const pref = await theo.routingPreferences.get(id);
```

## PATCH

更新現有偏好設置中的字段。發送 `rules` 或 `examples` 會替換整個集合——兩者在保存時都被視為單一文檔。至少需要提供一個字段。

<ParamField body="name" type="string">偏好設置名稱（1–128 個字符）。</ParamField>
<ParamField body="description" type="string">自由文本描述（≤512 個字符）。</ParamField>
<ParamField body="rules" type="object[]">替換用的規則集（≤50 條規則）。</ParamField>
<ParamField body="examples" type="object[]">替換用的少樣本（few-shot）示例（≤30 個）。</ParamField>
<ParamField body="confidence_floor_overrides" type="object">替換用的按模式設置的置信度下限。</ParamField>
<ParamField body="enabled" type="boolean">在不刪除的情況下暫停/恢復。</ParamField>
<ParamField body="is_default" type="boolean">設為/取消默認。每個作用域內只能有一個默認項。</ParamField>

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

```typescript theme={null}
await theo.routingPreferences.update(id, { enabled: false });
```

團隊作用域的偏好設置需要在當前活動組織上具有 `manageWebhooks` 權限。

## DELETE

徹底刪除。級聯移除所有指向此偏好設置的密鑰綁定——之前綁定的密鑰將回退到解析級聯鏈（組織默認 → 用戶默認 → 無）。

```bash theme={null}
curl -X DELETE https://www.hitheo.ai/api/v1/routing-preferences/{id} \
  -H "Authorization: Bearer $THEO_API_KEY"
```

```typescript theme={null}
await theo.routingPreferences.delete(id);
```

## 錯誤

* `400 routing_preference_invalid` — PATCH 時的校驗失敗。
* `404 not_found` — 偏好設置不存在，或調用方不可見。
* `409 conflict` — 違反了默認項唯一性約束。


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