Update skills¶
Partially updates skills in the current workspace. Fields not provided retain their original values; instead of just updating the label, the update creates a new skill version and sets it as the current version.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}
Before you call¶
First Query skill details confirm the skill to be updated. Prepare the personal access token, target workspace ID, and skill ID that have access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$SKILL_ID: Skill ID to be updated.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"description": "更新后的说明",
"change_summary": "补充输出约定"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
The skill ID to update. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The workspace to which the skill belongs; can only be the current workspace or |
Request body¶
The fields in the request body are optional; fields not provided retain their original values.
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Basic definition of skill. The status can be |
|
string |
No |
Basic definition of skill. The status can be |
|
string |
No |
Basic definition of skill. The status can be |
|
string |
No |
Basic definition of skill. The status can be |
|
string |
No |
Basic definition of skill. The status can be |
|
string |
No |
Classification and display information. Providing |
|
string |
No |
Classification and display information. Providing |
|
string[] |
No |
Classification and display information. Providing |
|
string |
No |
Classification and display information. Providing |
|
string |
No |
Classification and display information. Providing |
|
object |
No |
Route summary, directives, and dependency requirements. |
|
object |
No |
Route summary, directives, and dependency requirements. |
|
object |
No |
Route summary, directives, and dependency requirements. |
|
object |
No |
Input Schema and output convention. |
|
object |
No |
Input Schema and output convention. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
object |
No |
Market metadata, tags, annotations, and extended metadata. |
|
string |
No |
Change description for the new version. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
The updated skill must still retain the instruction body or route summary and satisfy the validation rules for skill dependency references.
Successful response¶
Returns 200 and the updated skill on success.
{
"code": 0,
"data": {
"id": "skill_01",
"workspace_id": "ws_01",
"name": "摘要技能",
"description": "更新后的说明",
"status": "active",
"source_type": "custom",
"instruction": {
"body": "总结用户提供的内容。"
},
"version": 3,
"updated_at": "2026-01-03T10:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Skill ID and workspace. |
|
string |
Skill ID and workspace. |
|
string |
Updated basic definition. |
|
string |
Updated basic definition. |
|
string |
Updated basic definition. |
|
object |
Updated directive, routing summary and dependency requirements. |
|
object |
Updated directive, routing summary and dependency requirements. |
|
object |
Updated directive, routing summary and dependency requirements. |
|
integer |
Current version; remains unchanged only when updating tags. |
|
string |
Last updated time, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request field, dependency reference, or updated skill definition is invalid. |
Check field values, directive or route summaries, and dependent resources. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to update skills. |
Check workspace authorization. |
|
|
Specify system skills as read-only. |
Do not modify system skills; create or update your own skills in the current workspace. |
|
|
The skill does not exist in the specified workspace. |
Check skill ID and |
|
|
Skill services or authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the same resource identifier Query skill details to confirm the update result.