Update automated tasks¶
Partially update the configuration of the automation task. Fields not provided remain unchanged.
PATCH https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-automation-tasks/{automation_task_id}
Preparation before calling¶
First Query automation task detailsconfirm the current configuration of the task and obtain the task ID. Prepare a personal access token and target workspace ID that has access to the target workspace.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$TASK_ID: The automation task ID to be updated asautomation_task_idin the path.
Request example¶
curl -X PATCH "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-automation-tasks/$TASK_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"status": "disabled"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Automation task ID. |
Request body¶
The request body must be a JSON object. All fields are optional; fields not provided remain unchanged.
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Task name and description. |
|
string |
No |
Task name and description. |
|
string |
No |
The workspace and agent ID to which the agent belongs. The agent workspace can only be the current workspace or the system workspace. |
|
string |
No |
The workspace and agent ID to which the agent belongs. The agent workspace can only be the current workspace or the system workspace. |
|
string |
No |
Model name and LLM backend ID. |
|
integer |
No |
Model name and LLM backend ID. |
|
string |
No |
Fixed instructions used for each run. |
|
object |
No |
Trigger configuration. |
|
object |
No |
Certification policy and tool, run, and approval policy references. |
|
string |
No |
Certification policy and tool, run, and approval policy references. |
|
string |
no |
Certification policy and tool, run, and approval policy references. |
|
string |
No |
Certification policy and tool, run, and approval policy references. |
|
object |
No |
Structured output constraints. |
|
string |
No |
Task status. |
|
object |
No |
Label and annotation key-value pairs. |
|
object |
No |
Label and annotation key-value pairs. |
|
string |
No |
Workflow related reference. |
|
string |
No |
Workflow related reference. |
|
string |
No |
Workflow related reference. |
|
string |
No |
Next trigger time, using RFC 3339 format. |
|
object |
No |
API summary. |
Set status to active to enable the task; set to disabled to stop subsequent triggering. Whether triggering configuration or authentication policy changes is valid depends on whether the two are compatible.
Successful response¶
Returns 200 on success. Updating the task configuration will not overwrite the configuration snapshot used by existing running records.
{
"code": 0,
"data": {
"id": "task_01",
"workspace_id": "ws_01",
"status": "disabled",
"version": 2,
"updated_at": "2026-08-18T02:00:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
Task ID and workspace ID. |
|
string |
Task ID and workspace ID. |
|
string |
Updated status and task version. |
|
integer |
The updated status and task version. |
|
object |
Updated trigger, authentication, and output configuration; does not return if not set. |
|
object |
Updated trigger, authentication, and output configuration; does not return if not set. |
|
object |
Updated trigger, authentication, and output configuration; does not return if not set. |
|
object |
The updated task execution plan. |
|
string |
Last updated time, using RFC 3339 format. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body, workspace scope, trigger configuration, authentication policy, or status fields are invalid. |
Check the configuration corresponding to JSON and triggering methods. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity has not been verified for workspace access and valid roles. |
Use an identity and a valid role with access to the workspace. |
|
|
The task or updated target agent does not exist. |
Check task and agent identification. |
|
|
The update conflicts with the current state of the task or with concurrent versions. |
After refreshing the task details, resubmit the update based on the current version. |
|
|
Execution plan, workflow or task services are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the same task ID Query automation task details to confirm the current configuration and status.