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