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

# 更新分析模型

> 修改分析模型的名称或描述

```
PATCH /openapi/memorylake/api/v3/workspaces/{workspaceId}/analysis-models/{modelId}
```

部分更新分析模型。未传入的字段保持不变。

只能修改名称和描述。数据源、模板类型、自定义 ID 和派生来源在创建模型时就已确定。如需修改模型包含的知识，请使用[知识条目接口](https://docs.memorylake.cn/features/memorylake/api-reference/database/analysis-models/list-knowledge-entries.md)。

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

### 路径参数

**workspaceId** `string` *required*

工作空间 ID

**modelId** `string` *required*

分析模型 ID

### 请求体

**name** `string`

显示名称

**description** `string`

自由格式的描述

```bash cURL theme={null}
curl -X PATCH 'https://app.memorylake.cn/openapi/memorylake/api/v3/workspaces/ws-8001856949ad4f6a5b6226f415ffa877/analysis-models/am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Sales Q&A (orders)",
    "description": "Answers questions about orders, revenue and customers"
  }'
```

### 响应

返回更新后的分析模型。

**data** `object`

**分析模型对象**

**id** `string`

分析模型标识符，请把它当作不透明字符串处理。

**name** `string`

显示名称

**description** `string`

自由格式的描述

**type** `string`

模型遵循的模板，例如 `ASK_DATA`。它决定模型接受哪些类型的知识。

**schemas** `array`

模型覆盖的 schema，继承自其数据源

**custom\_id** `string`

您为这个模型设置的自定义标识符（如果设置过）

**db\_datasource\_id** `string`

模型所基于的数据源

**workspace\_id** `string`

模型所属的工作空间

**fork\_from** `string`

这个模型派生自的源模型。从零创建的模型不返回该字段。

**created\_at** `string`

创建时间戳

**updated\_at** `string`

最后更新时间戳

```json Success (200) theme={null}
{
  "success": true,
  "data": {
    "id": "am-9d3f7b1e5a2c4d8f6b0e3a7c9d1f5b2e",
    "name": "Sales Q&A (orders)",
    "description": "Answers questions about orders, revenue and customers",
    "type": "ASK_DATA",
    "schemas": ["sales"],
    "custom_id": "sales-qa",
    "db_datasource_id": "dbds-4b8e2f6a1c9d4e7b8a3f5c2d6e9b1a7c",
    "workspace_id": "ws-8001856949ad4f6a5b6226f415ffa877",
    "created_at": "2026-09-21T09:14:05.612Z",
    "updated_at": "2026-09-22T02:31:17.904Z"
  }
}
```


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