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

# 删除知识条目

> 从分析模型中删除一条知识条目

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

从分析模型中删除一条知识条目。如果只想让条目不再生效但保留它，请改用[停用或恢复知识条目](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/disable-knowledge-entry.md)。

条目能否删除取决于它的类型。[列出分析模型模板](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/list-analysis-model-templates.md)为每种类型返回一个 `delete_validation`，条目不满足该条件时请求会被拒绝：

* `ANYWAY`：总是可以删除。
* `LEAF`：只有没有其他条目挂在它下面时才可以。
* `ISLAND`：只有它与任何条目都没有关联时才可以。

删除不存在或已删除的条目目前会返回 `400`。

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

### 路径参数

**workspaceId** `string` *required*

工作空间 ID

**modelId** `string` *required*

分析模型 ID

**entryId** `string` *required*

知识条目 ID

### 查询参数

**entity\_type** `string`

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

```bash cURL theme={null}
curl -X DELETE 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e/entries/5d2e7b9cb31d11f1a7c35e9b2d4f6a81?entity_type=few_shot' \
  -H 'Authorization: Bearer sk_xxxxxx'
```

### 响应

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