Set as default version¶
Set the runnable version as the default version for the agent lineage.
POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/versions/{version}/default
Preparation before calling¶
First query the agent version and confirm that you want to set it as the default version number. Prepare a personal access token with access to the target workspace, target workspace ID, agent ID, and version number.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and asworkspace_idin the path.$AGENT_ID: Target agent ID, asagent_idin the path.$VERSION: The version number to set as the default version, asversionin the path.
Request example¶
curl -X POST "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/versions/$VERSION/default" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The current workspace ID. |
|
string |
Yes |
Agent ID. |
|
string |
Yes |
The version number to set as the default version. |
Successful response¶
Returns 200 on success. data is the updated version pedigree.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"default_version": "v3",
"created_at": "2026-01-15T10:00:00Z",
"updated_at": "2026-01-15T10:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
The workspace and agent ID to which the agent belongs. |
|
string |
The workspace and agent ID to which the agent belongs. |
|
string |
The default version used by the current agent lineage. |
|
string |
Version lineage creation time, using RFC 3339 format. |
|
string |
The last modification time of the default version, using RFC 3339 format. |
Error response¶
{
"code": 1500,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is empty or has an invalid format, or the target version cannot be used as the default version. |
Check the workspace, agent and version identification; select a runnable version. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current caller does not have permission to update the agent. |
Check the agent authorization in the workspace. |
|
|
The agent or version does not exist. |
Query the agent version first. |
|
|
The agent resource service or its authorized dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the same agent ID Query the agent version to confirm the default version, or Query agent details to check the current effective configuration.