Set as default version

Set the executable agent version as the default version.

HTTP
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

Shell
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

workspace_id

string

Yes

Current workspace ID.

agent_id

string

Yes

agent ID.

version

string

Yes

The version number to set as the default version.

Successful response

JSON
{
  "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

code

integer

0 on success.

data.workspace_id

string

The workspace and agent ID to which the agent belongs.

data.agent_id

string

The workspace and agent ID to which the agent belongs.

data.default_version

string

The version currently used by the agent by default.

data.created_at

string

The creation time of the agent version record, using RFC 3339 format.

data.updated_at

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.

JSON
{
  "code": 1500,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status

Error code

Common cause

Recommended action

400

2

Invalid request field, workspace, or operation precondition.

Fix the request parameters and submit again.

401

6

Missing or invalid authentication credentials.

Check the credential type, expiration, and authentication header.

403

5

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

3

The target object or required reference was not found.

Verify the object identifier, workspace, and current status.

409

4

Conflict in resource state, request payload, or concurrent modification.

Re-read the current state and version, then handle according to the latest result.

503

15

A business, runtime, or authorization dependency is temporarily unavailable.

After the dependency recovers, check existing results first instead of blindly repeating writes.

Last updated on