Disable agent version¶
Deactivate a non-default version so that it can no longer be used as a runnable version.
POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/versions/{version}/disable
Preparation before calling¶
First query the agent version and confirm the version number to be disabled. 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 deactivate, asversionin the path.
The default version cannot be deactivated; an already deactivated version cannot be deactivated again.
Request example¶
curl -X POST "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/versions/$VERSION/disable" \
-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 deactivate. |
Successful response¶
When successful, 200 is returned, and data is the updated version record.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"version": "v3",
"status": "disabled",
"disabled_by": "user_01",
"disabled_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 version belongs. |
|
string |
The workspace and agent ID to which the version belongs. |
|
string |
Deactivated version number. |
|
string |
|
|
string |
The user ID that performed the deactivation operation. |
|
string |
Decommissioning time, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The path parameter is invalid, the target version is the default version, or the target version has been deactivated. |
Check the version identification; if you need to disable the default version, first set another runnable version as the default 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 version list first. |
|
|
Version service, operation record service or authorization dependency are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the same agent ID Query the agent version to confirm the version status, or Query agent details to view the current default version.