Update agent task template

Update the saved agent task template. Fields not provided retain their original values.

HTTP
PATCH $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-task-templates/{template_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. Prepare personal access token, workspace ID and template ID.

Request body

Shell
curl -X PATCH "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-task-templates/$TEMPLATE_ID" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "description": "用于工作流中的摘要节点"
  }'

Parameter

Type

Required

Description

workspace_id

string

Yes

Target workspace ID.

template_id

string

Yes

Template ID to update.

name

string

No

Template name.

agent_id

string

No

The agent ID to be called.

description

string

No

Template description.

message_template

object

No

Task message template.

input_schema

object

No

Enter the structure definition.

default_context_refs

array

No

Default context reference.

runtime_policy_ref

string

No

Run policy reference.

idempotency_policy

object

No

Idempotent strategy.

output_contract

object

No

Output format convention.

status

string

No

Template status.

labels

object

No

Tag key-value pairs.

annotations

object

No

Annotation key-value pairs.

message_template.role

string

No

Message role, user is used when omitted.

message_template.template

string

Conditional

Non-empty message template text. and non-empty parts provide at least one item.

message_template.parts

array of objects or null

Conditional

Message components. Each item can be an object or null.

message_template.variables

object or null

No

Template variables.

default_context_refs[].type

string

Required when there is a citation

Context resource type.

default_context_refs[].id

string

Conditional

Resource ID. Provide at least one item with uri.

default_context_refs[].uri

string

Conditional

Resource address. Provide at least one item with id.

default_context_refs[].version

string

No

Resource version.

default_context_refs[].config

object or null

No

Resource allocation.

idempotency_policy.mode

string

No

none, workflow_case or custom.

idempotency_policy.key_template

string

Required when custom

Non-empty idempotent key template.

idempotency_policy.window_seconds

integer

No

Idempotent window seconds. Negative values ​​are handled as 0.

The type, ID, address, and version of the context reference cannot have leading or trailing whitespace, and the ID cannot contain path separators. The service only verifies the reference format and does not check whether each resource exists. Use workflow_case when idempotent strategy is omitted. When updating, the idempotent object is replaced as a whole, an empty object resets the default policy, and null retains the original configuration.

Successful response

JSON
{
  "code": 0,
  "data": {
    "id": "template_01",
    "workspace_id": "workspace_example",
    "agent_id": "agent_01",
    "name": "摘要任务",
    "description": "用于工作流中的摘要节点",
    "message_template": {
      "role": "user",
      "template": "请总结输入内容"
    },
    "idempotency_policy": {
      "mode": "workflow_case"
    },
    "status": "draft",
    "version": 2,
    "created_at": "2026-10-14T00:00:00Z",
    "updated_at": "2026-10-14T00:00:00Z"
  }
}

Field

Type

Description

code

integer

0 when the request is processed successfully.

data

object

response data.

data.id

string

Object ID.

data.workspace_id

string

The workspace ID to which it belongs.

data.agent_id

string

The associated agent ID.

data.name

string

Name.

data.description

string

Description. Can be omitted if not set.

data.message_template

object

Message template.

data.input_schema

object

JSON Schema of the input parameters. Can be omitted if not set.

data.default_context_refs

array of object

Default context resource reference. Can be omitted if not set.

data.default_context_refs[].id

string

Object ID.

data.runtime_policy_ref

string

Run policy reference. Can be omitted if not set.

data.idempotency_policy

object

Idempotent strategy.

data.idempotency_policy.mode

string

Strategy or scope pattern. Values: none, workflow_case, custom.

data.idempotency_policy.key_template

string

Custom idempotent key template. Can be omitted if not set.

data.idempotency_policy.window_seconds

integer

Idempotent window, in seconds. Can be omitted if not set.

data.output_contract

object

Output convention. Can be omitted if not set.

data.status

string

Current status. Values: draft, active, disabled, archived.

data.version

integer

Current version number.

data.labels

object

Tag key-value pairs. Can be omitted if not set.

data.annotations

object

Extended annotations. Can be omitted if not set.

data.created_by

string

Creator ID. Can be omitted if not set.

data.updated_by

string

Last updated by identifier. Can be omitted if not set.

data.created_at

string

Creation time, in RFC 3339 format.

data.updated_at

string

Last updated in RFC 3339 format.

data.message_template.role

string

Message role.

data.message_template.template

string

Message template text. Can be omitted when using parts.

data.message_template.parts

array or null

Structured messages are composed of items, and the content is retained by the template.

data.message_template.variables

object or null

Template variables.

data.default_context_refs[].type

string

Context resource type.

data.default_context_refs[].uri

string

Resource address. Can be omitted when using id.

data.default_context_refs[].version

string

Resource version. Omitted if not set.

data.default_context_refs[].config

object or null

Resource allocation. Omitted if not set.

Error response

JSON
{
  "code": 3,
  "message": "agent task template not found"
}

Common HTTP errors

HTTP status code

error code

Description

400

2

Common reasons: The request body is invalid. Recommended Action: Check the fields to be updated.

404

3

Common reasons: The template does not exist. Recommended Action: Check the template ID.

Last updated on