Update agent task template¶
Updates a saved agent task template; fields not provided retain their original values.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-task-templates/{template_id}
Before you call¶
Prepare personal access token, workspace ID, and template ID.
The example below uses:
$AI_STUDIO_API_KEY: Actual personal access token.$WORKSPACE_ID: Target workspace ID.$TEMPLATE_ID: Template ID to update.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-task-templates/$TEMPLATE_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"description": "用于工作流中的摘要节点"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The target workspace ID. |
|
string |
Yes |
The ID of the template to update. |
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Template name. |
|
string |
No |
ID of the agent to be called. |
|
string |
No |
Template description. |
|
object |
No |
Task message template. |
|
object |
No |
Input structure definition. |
|
array |
No |
Default context reference. |
|
string |
No |
Run policy reference. |
|
object |
No |
Idempotent policy. |
|
object |
No |
Output contract. |
|
string |
No |
Template status. |
|
object |
No |
Tag key-value pair. |
|
object |
No |
Annotation key-value pair. |
Successful response¶
Returns 200 and the updated template on success.
{"code": 0, "data": {"id": "template_01", "description": "用于工作流中的摘要节点"}}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Template ID. |
|
string |
Updated template description. |
Error response¶
{"code": 5, "message": "agent task template not found"}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid. |
Check the fields to be updated. |
|
|
The template does not exist. |
Check template ID. |