Query the agent version¶
Lists the loaded versions of an agent, including status, runtime bindings, and the current default version. Resource versions produced by ordinary agent creation or updates do not appear here.
GET https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agents/{agent_id}/versions
Preparation before calling¶
First query the agent list to obtain the agent ID. Prepare the personal access token, target workspace ID, and agent 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 through theX-Workspace-IDHeader and asworkspace_idin the path.$AGENT_ID: Target agent ID, asagent_idin the path.
Request example¶
curl "https://api.moi.matrixorigin.cn/v5/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/versions" \
-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. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
The workspace to which the agent belongs; if not passed, the workspace in the path will be used. |
Successful response¶
Returns 200 on success. data.items is the list of loaded agent package versions, and data.lineage summarizes their workspace, agent, and current default version. Resource versions produced by ordinary agent creation or updates do not appear here.
{
"code": 0,
"data": {
"items": [
{
"workspace_id": "ws_01",
"agent_id": "agent_01",
"version": "v3",
"status": "runnable",
"source_digest": "sha256:9f2b7c4a1d5e8f0a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f70819",
"loaded_at": "2026-01-15T10:00:00Z"
}
],
"total": 1,
"lineage": {
"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 |
|
|
array |
The version record of the current agent lineage. |
|
string |
Workspace where the loaded version belongs. |
|
string |
Agent ID for the loaded version. |
|
string |
Version number. |
|
string |
Version status; can be |
|
string |
A summary of the contents of the loaded version. |
|
string |
Version load time, using RFC 3339 format. |
|
integer |
Number of loaded versions matching the query. |
|
object |
Summary of the workspace, agent, and current default loaded version. |
|
string |
The current default version. |
|
string |
Time when the pedigree was created and last updated, using RFC 3339 format. |
|
string |
Time when the pedigree was created and last updated, using RFC 3339 format. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 1500,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid path parameter or |
Check workspace and agent identification. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current caller does not have permission to read the agent. |
Check the agent authorization in the workspace. |
|
|
The agent’s version or version lineage was not found. |
First query the agent list and confirm that its version is loaded. |
|
|
Version services or authorization dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
After selecting a version, you can Set as default version; if you no longer use the version, you can Disable agent version.