Update task¶
Update a paused import task. The interface will only modify the fields provided in the request.
POST https://moi.matrixorigin.cn/newmoi/task/update
Before you call¶
Prepare the personal access token, target workspace ID, and task ID that have access to the target workspace. First, Query task details confirms that the task has been suspended; unsuspended tasks cannot be updated.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID of the task to be updated, passed through theX-Workspace-IDHeader.$TASK_ID: Task ID to be updated.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/task/update" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"task_id": "'$TASK_ID'",
"name": "import_orders_v2",
"load_mode_config": {
"load_interval_type": 4
}
}'
Request body¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the import task to update. |
|
string |
No |
The new task name; an empty string will not update the name. |
|
object |
No |
Load mode for file import. When this object is provided, the load plan is updated with the fields in it. |
|
integer |
No |
Load interval type: |
|
integer |
No |
Period parameter; represents the execution hour in days. |
|
object |
No |
File filter configuration; providing this object replaces the current file filter configuration entirely. |
|
string[] |
No |
Filename glob pattern. |
|
integer |
No |
Minimum file size in bytes. |
|
integer |
No |
Maximum file size in bytes. |
|
integer |
No |
Minimum creation time, using a Unix timestamp. |
|
integer |
No |
Maximum creation time, using a Unix timestamp. |
|
integer[] |
No |
File type filter code. |
|
string |
No |
File path filter regular expression. |
|
string[] |
No |
List of source file URIs; replacing the current URI list entirely when this field is provided. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Successful response¶
Returns 200 on success and data is null.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return the updated task; please query the details again to confirm. |
Error response¶
{
"code": "ErrForbidden",
"msg": "permission denied",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request body is invalid, or the task is not in the paused state. |
Fix JSON and pause the task first. |
|
|
The caller does not have permission to update the task. |
Check workspace and object authorization. |
|
|
The service is temporarily unable to complete the authorization check. |
Try again later. |
|
|
The service failed to update the task. |
Check both HTTP status and |
Follow-up operations¶
This interface does not return the complete task object. Use the same task ID Query task details to confirm the update result.