> ## Documentation Index
> Fetch the complete documentation index at: https://docs.memorylake.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 停用或恢复知识条目

> 在不删除的前提下停用一条知识条目，或让它重新生效

```
POST /openapi/memorylake/api/v3/workspaces/{workspaceId}/analysis-models/{modelId}/entries/{entryId}/disable
```

在不删除的前提下停用一条知识条目，或让它重新生效。停用的条目及其内容仍保留在模型中，但不再参与回答，也不会出现在[按 keyword 检索](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/list-knowledge-entries.md)的结果里。无论停用还是恢复，条目的 `updated_at` 都会更新。

有些类型不能停用，例如通用知识。

> [!NOTE]
>
> **所需权限：** `analysis_model:modify`

### 路径参数

**workspaceId** `string` *required*

工作空间 ID

**modelId** `string` *required*

分析模型 ID

**entryId** `string` *required*

知识条目 ID

### 请求体

**disabled** `boolean` *required*

`true` 表示让条目不再参与回答，`false` 表示让它重新参与

**entity\_type** `string`

条目创建时的类型，例如 `few_shot`。有些类型仅凭 ID 无法定位。

```bash Disable theme={null}
curl -X POST 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e/entries/5d2e7b9cb31d11f1a7c35e9b2d4f6a81/disable' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "disabled": true,
    "entity_type": "few_shot"
  }'
```

```bash Restore theme={null}
curl -X POST 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e/entries/5d2e7b9cb31d11f1a7c35e9b2d4f6a81/disable' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "disabled": false,
    "entity_type": "few_shot"
  }'
```

### 响应

**success** `boolean`

表示请求是否成功

**message** `string`

人类可读的状态消息

```json Success (200) theme={null}
{
  "success": true,
  "message": "Operation completed successfully"
}
```


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