Set as default version¶
Set the executable agent version as the default version.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agents/{agent_id}/versions/{version}/default
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region. First query the agent version and confirm that you want to set it as the default version number. Prepare the personal access token, target workspace ID, agent ID, and version number that can access the target workspace.
Request parameters¶
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/versions/$VERSION/default" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Current workspace ID. |
|
string |
Yes |
agent ID. |
|
string |
Yes |
The version number to set as the default version. |
Successful response¶
{
"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"
}
}
When successful, 200 is returned, and data is the updated version information.
Field |
Type |
Description |
|---|---|---|
|
integer |
0 on success. |
|
string |
The workspace and agent ID to which the agent belongs. |
|
string |
The workspace and agent ID to which the agent belongs. |
|
string |
The version currently used by the agent by default. |
|
string |
The creation time of the agent version record, using RFC 3339 format. |
|
string |
The default version last modification time, using RFC 3339 format. |
Error response¶
Version or run-binding changes may have been committed and subsequent failure to log a business audit would still cause the request to return an error. An error response does not guarantee that the change has been rolled back. Query the version or binding status first to avoid direct repeated writing.
{
"code": 1500,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status |
Error code |
Common cause |
Recommended action |
|---|---|---|---|
400 |
|
Invalid request field, workspace, or operation precondition. |
Fix the request parameters and submit again. |
401 |
|
Missing or invalid authentication credentials. |
Check the credential type, expiration, and authentication header. |
403 |
|
The current identity or active role does not have permission for this operation. |
Use an authorized identity or contact an administrator to grant access. |
404 |
|
The target object or required reference was not found. |
Verify the object identifier, workspace, and current status. |
409 |
|
Conflict in resource state, request payload, or concurrent modification. |
Re-read the current state and version, then handle according to the latest result. |
503 |
|
A business, runtime, or authorization dependency is temporarily unavailable. |
After the dependency recovers, check existing results first instead of blindly repeating writes. |