Update running strategy

Partially updated run policy configuration. Each successful update increments the policy version and only affects subsequent runs that are allowed to execute.

HTTP
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/runtime-policy-profiles/{policy_id}

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 running policy configuration details to confirm the policy to be updated. Prepare the personal access token, target workspace ID, and policy ID that can access the target workspace.

Request body

Replace $WORKSPACE_ID, $POLICY_ID, $CLOUDSIGMA_API_KEY in the example with actual values.

Shell
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/runtime-policy-profiles/$POLICY_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "budgets": {
    "max_steps": 30
  },
  "retry": {
    "max_attempts": 2
  }
}'

Parameter

Type

Required

Description

workspace_id

string

Yes

Current workspace ID.

policy_id

string

Yes

Run policy ID.

Request body

Field

Type

Required

Description

name

string or null

No

Policy name and description.

description

string or null

No

Policy name and description.

status

string or null

No

Policy status and scope.

scope_type

string or null

No

Policy status and scope.

scope_ref

string or null

When not in workspace

Required when in non-workspace scope, provide non-null reference.

admission

object or null

No

Admission, budgeting, and retry configuration.

budgets

object or null

No

Admission, budgeting, and retry configuration.

retry

object or null

No

Admission, budgeting, and retry configuration.

data_policy

object or null

No

Data, Product and Provider Restrictions.

artifact_policy

object or null

No

Data, Product and Provider Restrictions.

provider_constraints

object or null

No

Data, Product and Provider Restrictions.

labels

object or null

No

Additional tags, annotations and metadata.

annotations

object or null

No

Additional tags, annotations and metadata.

metadata

object or null

No

Additional tags, annotations and metadata.

The values labels and annotations only support strings or null. Other configuration objects can contain legal JSON extension fields. When created, the configuration object cannot be null.

When updating, omit the field or fill in null to retain the original value, and clear the object when filling in {}. An empty update will also increment the version. This interface does not check whether old versions have changed.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "policy_01",
    "workspace_id": "",
    "name": "默认运行限制",
    "status": "active",
    "scope_type": "workspace",
    "budgets": {
      "max_steps": 30
    },
    "retry": {
      "max_attempts": 2
    },
    "version": 2,
    "created_at": "2026-08-21T07:00:00Z",
    "updated_at": "2026-08-21T07:00:00Z"
  }
}

Field

Type

Description

data.id

string

Run policy ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.name

string

Updated policy name, status, and scope type.

data.description

string

Description.

data.status

string

Updated policy name, status, and scope type. Values: draft, active, disabled, archived.

data.scope_type

string

Updated policy name, status, and scope type. Values: workspace, role, agent, provider_profile.

data.scope_ref

string

Scope object reference.

data.admission

object

Admission configuration.

data.budgets

object

Updated budget and retry configuration. Only returned if there is a value.

data.retry

object

Updated budget and retry configuration. Only returned if there is a value.

data.data_policy

object

Data strategy.

data.artifact_policy

object

Product strategy.

data.provider_constraints

object

Provider constraints.

data.version

integer

Updated policy version.

data.labels

object

Tag mapping.

data.annotations

object

Annotation mapping.

data.metadata

object

Extended metadata.

data.created_by

string

Creator.

data.updated_by

string

Last updated by.

data.created_at

string

Creation time. RFC 3339 time.

data.updated_at

string

Update time. RFC 3339 time.

Error response

JSON
{
  "code": 2,
  "message": "运行策略参数无效"
}

Field

Type

Description

code

integer

error code.

message

string

Error message for the caller.

Last updated on