Update agent task template¶
Update the saved agent task template. Fields not provided retain their original values.
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¶
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 |
|---|---|---|---|
|
string |
Yes |
Target workspace ID. |
|
string |
Yes |
Template ID to update. |
|
string |
No |
Template name. |
|
string |
No |
The agent ID to be called. |
|
string |
No |
Template description. |
|
object |
No |
Task message template. |
|
object |
No |
Enter the structure definition. |
|
array |
No |
Default context reference. |
|
string |
No |
Run policy reference. |
|
object |
No |
Idempotent strategy. |
|
object |
No |
Output format convention. |
|
string |
No |
Template status. |
|
object |
No |
Tag key-value pairs. |
|
object |
No |
Annotation key-value pairs. |
|
string |
No |
Message role, user is used when omitted. |
|
string |
Conditional |
Non-empty message template text. and non-empty parts provide at least one item. |
|
array of objects or null |
Conditional |
Message components. Each item can be an object or null. |
|
object or null |
No |
Template variables. |
|
string |
Required when there is a citation |
Context resource type. |
|
string |
Conditional |
Resource ID. Provide at least one item with uri. |
|
string |
Conditional |
Resource address. Provide at least one item with id. |
|
string |
No |
Resource version. |
|
object or null |
No |
Resource allocation. |
|
string |
No |
none, workflow_case or custom. |
|
string |
Required when custom |
Non-empty idempotent key template. |
|
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¶
{
"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 |
|---|---|---|
|
integer |
|
|
object |
response data. |
|
string |
Object ID. |
|
string |
The workspace ID to which it belongs. |
|
string |
The associated agent ID. |
|
string |
Name. |
|
string |
Description. Can be omitted if not set. |
|
object |
Message template. |
|
object |
JSON Schema of the input parameters. Can be omitted if not set. |
|
array of object |
Default context resource reference. Can be omitted if not set. |
|
string |
Object ID. |
|
string |
Run policy reference. Can be omitted if not set. |
|
object |
Idempotent strategy. |
|
string |
Strategy or scope pattern. Values: |
|
string |
Custom idempotent key template. Can be omitted if not set. |
|
integer |
Idempotent window, in seconds. Can be omitted if not set. |
|
object |
Output convention. Can be omitted if not set. |
|
string |
Current status. Values: |
|
integer |
Current version number. |
|
object |
Tag key-value pairs. Can be omitted if not set. |
|
object |
Extended annotations. Can be omitted if not set. |
|
string |
Creator ID. Can be omitted if not set. |
|
string |
Last updated by identifier. Can be omitted if not set. |
|
string |
Creation time, in RFC 3339 format. |
|
string |
Last updated in RFC 3339 format. |
|
string |
Message role. |
|
string |
Message template text. Can be omitted when using parts. |
|
array or null |
Structured messages are composed of items, and the content is retained by the template. |
|
object or null |
Template variables. |
|
string |
Context resource type. |
|
string |
Resource address. Can be omitted when using id. |
|
string |
Resource version. Omitted if not set. |
|
object or null |
Resource allocation. Omitted if not set. |
Error response¶
{
"code": 3,
"message": "agent task template not found"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The request body is invalid. Recommended Action: Check the fields to be updated. |
|
|
Common reasons: The template does not exist. Recommended Action: Check the template ID. |