Set the current skill version¶
Set the existing skill version as the current version. Request to use the current version number for concurrent verification to avoid overwriting the updates just completed by other callers.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/skills/{skill_id}/versions/{version}/current
Before you call¶
First query skill version to get the target version number, and query skill details to get the current version number]. 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.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/skills/$SKILL_ID/versions/2/current" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"expected_current_version": 1
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Skill ID. |
|
integer |
Yes |
Positive integer version number to be set to the current version. |
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¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
integer |
Yes |
The current version number read must be a positive integer. When the target version is not yet the current version, the service will use it for concurrent verification. |
Successful response¶
On success, 200 and the switched skill definition are returned.
{
"code": 0,
"data": {
"id": "skill_01",
"workspace_id": "ws_01",
"name": "摘要技能",
"status": "active",
"version": 2,
"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 |
Basic information about current skills. |
|
string |
Basic information about current skills. |
|
integer |
The current version number after switching. |
|
string |
Switching time, using RFC 3339 format. |
Error response¶
{
"code": 4,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The version number or |
Use a valid version number after reading the version list. |
|
|
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. |
Create a manageable copy of the skill in the current workspace. |
|
|
Skill or target version does not exist. |
Check skill ID, version number and |
|
|
The current version has changed and |
Reread the skill details or version list before submitting. |
|
|
Skill services or authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
After setting, Query skill version or Query skill details to confirm the current version.