Pause task¶
Pause an import task. A successful response does not return the task status, please check the details again to confirm the status.
POST https://moi.matrixorigin.cn/newmoi/task/pause
Before you call¶
Prepare the personal access token, target workspace ID, and task ID that have 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: The workspace ID of the task to be paused, passed through theX-Workspace-IDHeader.$TASK_ID: ID of the task to be suspended.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/task/pause" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d "{\"task_id\":\"$TASK_ID\"}"
Request body¶
Field |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The ID of the import task to pause. |
Successful response¶
Returns 200 on success and data is null. This interface does not return the task status after suspension.
{
"code": "OK",
"msg": "OK",
"data": null
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
null |
This interface does not return the task status after suspension. |
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. |
Fix JSON and |
|
|
The caller does not have permission to operate the task. |
Check workspace and object authorization. |
|
|
The service is temporarily unable to complete the authorization check. |
Try again later. |
|
|
The service failed to suspend the task. |
Check both HTTP status and |
Follow-up operations¶
Use the same task ID Query task details to confirm that it has been suspended. When you need to continue resume task.