Update automated tasks

Partially update the configuration of the automation task. Fields not provided remain unchanged.

HTTP
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-automation-tasks/{automation_task_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 automation task details confirm the current configuration of the task and obtain the task ID. Prepare a personal access token and target workspace ID that can access the target workspace.

Request body

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

Shell
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-automation-tasks/$TASK_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "disabled"
}'

Parameter

Type

Required

Description

workspace_id

string

Yes

workspace ID.

automation_task_id

string

Yes

Automation task ID.

Request body

Field

Type

Required

Description

name

string or null

No

Task name and description.

description

string or null

No

Task name and description.

agent_workspace_id

string or null

No

agent source workspace. Current workspace or system, not limited when filtering is omitted.

agent_id

string or null

No

The workspace and agent ID to which the agent belongs. agentworkspace can only be the current workspace or system workspace.

model

string or null

No

Model name and LLM backend ID.

llm_backend_id

integer or null

No

Model name and LLM backend ID.

instruction_text

string or null

No

Fixed instructions used for each run.

trigger

object or null

No

Trigger configuration.

trigger.mode

string

When the object is provided

processing mode. Values: cron, api, callback.

trigger.cron_expression

string

No

Cron expressions.

trigger.result_mode

string

No

How to handle results.

trigger.input_schema

object or null

No

Input field structure.

trigger.config

object or null

No

Configuration.

auth_policy

object or null

No

Certification policies and references to tools, operations, and approval policies.

output_contract

object or null

No

Structured output constraints.

status

string or null

No

Task status. Values: draft, creating, active, failed, disabled, archived.

labels

object or null

No

Label and annotation key-value pairs.

annotations

object or null

No

Label and annotation key-value pairs.

The workspace, operator, time and run summary are maintained by the server and cannot be specified in the request. trigger.service_name is generated by the server.

After the API is deployed, read the call information from api_summary. This request does not support configuring policy references that have not yet been accessed.

When updating, fill in null to retain the original value, and fill in {} to clear the object. trigger will also be replaced as a whole.

version is only added when the definition changes. Modification status, labels, annotations, or empty update will not increase the definition version. The archived task cannot be restored, and mode restrictions must still be met to convert the callback mode.

This interface cannot clear the original auth_policy, so the API task cannot be changed to cron. Filling in null will retain the authentication policy.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "task_01",
    "workspace_id": "ws_01",
    "agent_workspace_id": "",
    "name": "",
    "agent_id": "",
    "instruction_text": "",
    "trigger": {
      "mode": "cron"
    },
    "status": "disabled",
    "version": 2,
    "execution": {
      "type": "agent",
      "system_flow_id": ""
    },
    "created_at": "2026-08-21T07:00:00Z",
    "updated_at": "2026-08-21T07:00:00Z"
  }
}

Field

Type

Description

data.id

string

Task ID and workspace ID.

data.workspace_id

string

Task ID and workspace ID.

data.agent_workspace_id

string

agent source workspace. Current workspace or system, not limited when filtering is omitted.

data.name

string

Name.

data.description

string

Description.

data.agent_id

string

agent ID.

data.model

string

model.

data.llm_backend_id

integer

Model backend ID.

data.instruction_text

string

Task instructions.

data.trigger

object

Updated triggering, authentication and output configuration. Does not return if not set.

data.trigger.mode

string

processing mode. Values: cron, api, callback.

data.trigger.cron_expression

string

Cron expressions.

data.trigger.result_mode

string

How to handle results.

data.trigger.service_name

string

Service name.

data.trigger.input_schema

object or null

Input field structure.

data.trigger.config

object or null

Configuration.

data.auth_policy

object

Updated triggering, authentication and output configuration. Does not return if not set.

data.output_contract

object

Updated triggering, authentication and output configuration. Does not return if not set.

data.status

string

Updated status and task version. Values: draft, creating, active, failed, disabled, archived.

data.version

integer

Updated status and task version.

data.next_trigger_at

string

Next trigger time. RFC 3339 time.

data.api_summary

object

Summary of API calls.

data.api_summary.agent_automation_invoke

object

Automated call configuration.

data.api_summary.agent_automation_invoke.method

string

HTTP method.

data.api_summary.agent_automation_invoke.path

string

path.

data.api_summary.agent_automation_invoke.body_example

object

Request body example.

data.api_summary.agent_automation_invoke.body_example.service_name

string

Service name.

data.api_summary.agent_automation_invoke.body_example.payload

object or null

content.

data.last_run_summary

object

Summary of recent runs.

data.last_run_summary.run_id

string

Run ID.

data.last_run_summary.status

string

status. Values: queued, running, input_required, pending_approval, succeeded, failed, canceled, expired.

data.last_run_summary.trigger_type

string

Trigger type. Values: cron, api, manual, callback.

data.last_run_summary.automation_task_version

integer

Automated task version.

data.last_run_summary.output_validation_status

string

Output verification status.

data.last_run_summary.created_at

string

Creation time.

data.last_run_summary.updated_at

string

Update time.

data.last_run_summary.completed_at

string

Completion time.

data.last_run_summary.error_code

string

error code.

data.last_run_summary.error_message

string

error message.

data.labels

object

Tag mapping.

data.annotations

object

Annotation mapping.

data.execution

object

Updated task execution plan.

data.execution.type

string

type. Value: agent, deterministic_system_flow.

data.execution.system_flow_id

string

System process ID.

data.execution.parameters

object or null

Parameter definition.

data.execution.steps

array of object

Planning steps.

data.execution.steps[].id

string

logo.

data.execution.steps[].worker_id

string

Worker ID.

data.execution.steps[].workitem_id

string

Work item ID.

data.execution.steps[].operation

string

operation.

data.execution.steps[].repetition

string

Number of repetitions.

data.execution.steps[].parameters

object or null

Parameter definition.

data.created_at

string

Creation time. RFC 3339 time.

data.updated_at

string

Last updated, using RFC 3339 format. RFC 3339 time.

Error response

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

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

The request body, workspace scope, trigger configuration, authentication policy, or status fields are invalid. Recommendation: Check the configuration corresponding to JSON and triggering methods.

401

6(UNAUTHENTICATED)

Valid identity credentials are missing. Recommendation: Check the API Key.

403

5(PERMISSION_DENIED)

The current identity has not been verified for workspace access and valid roles. Recommendation: Use an identity and a valid role with workspace access.

404

3(NOT_FOUND)

The task or updated target agent does not exist. Recommendation: Check the task and agent identification.

409

4(ALREADY_EXISTS)

The update conflicts with the current state or concurrent version of the task. Suggestion: After refreshing the task details, resubmit the update based on the current version.

503

15(UNAVAILABLE)

Execution plan, workflow or task services are temporarily unavailable. Suggestion: Check the current status first. Do not automatically resubmit.

Last updated on