> ## 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/skills/{id}/versions
```

用您已通过[申请技能包上传](/features/memorylake/api-reference/skills/create-package-upload)上传的包发布技能的新版本。新版本成为最新版本并进入安全审核；响应返回时 `security_status` 为 `pending`。

<Warning>
  在新版本通过审核之前，引用跟随最新版本的 Agent 无法带着这个技能创建或发布新版本。固定到旧版本号的 Agent 版本不受影响。参见[在 Agent 中引用技能](/features/memorylake/api-reference/skills/overview#在-agent-中引用技能)。
</Warning>

<Note>
  **所需权限：** `skill:modify`
</Note>

### 路径参数

<ParamField path="id" type="string" required>
  技能 ID
</ParamField>

### 请求体

<ParamField body="package_ref" type="object" required>
  已上传的技能包。

  <Expandable title="技能包引用">
    <ParamField body="package_ref.s3_uri" type="string" required>
      [申请技能包上传](/features/memorylake/api-reference/skills/create-package-upload)返回的 `s3_uri`，原样传入。请先把压缩包上传到对应的 `upload_url`。
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="changelog" type="string">
  该版本的发布说明。
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://app.memorylake.cn/openapi/memorylake/api/v3/skills/skill-2b0f5f9f4ea54767822f51f4940c8f24/versions' \
    -H 'Authorization: Bearer sk_xxxxxx' \
    -H 'Content-Type: application/json' \
    -d '{
      "package_ref": {
        "s3_uri": "s3://example-bucket/skill-packages/9d4e7a1b2c3f4e5d8a6b0c1d2e3f4a5b.zip"
      },
      "changelog": "Add analyst consensus to the summary table"
    }'
  ```
</RequestExample>

### 响应

<ResponseField name="data" type="object">
  <Expandable title="技能版本">
    <ResponseField name="skill_id" type="string">技能 ID</ResponseField>
    <ResponseField name="version" type="integer">分配给新版本的版本号</ResponseField>
    <ResponseField name="changelog" type="string">该版本的发布说明</ResponseField>
    <ResponseField name="security_status" type="string">该版本的安全审核状态。刚发布时为 `pending`。</ResponseField>
    <ResponseField name="created_at" type="string">该版本的发布时间</ResponseField>
  </Expandable>
</ResponseField>

### 错误

| 状态码 | 错误码 | 何时出现 |
| - | - | - |
| `400` | `INVALID_ARGUMENT` | `package_ref.s3_uri` 不是由申请技能包上传签发的、该地址上没有上传内容，或技能包为空或超过 10 MiB |

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "skill_id": "skill-2b0f5f9f4ea54767822f51f4940c8f24",
      "version": 3,
      "changelog": "Add analyst consensus to the summary table",
      "security_status": "pending",
      "created_at": "2026-09-30T02:41:07Z"
    }
  }
  ```
</ResponseExample>


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