Retry failed files

Retry the failed file specified in the import task. A successful response will not return the running record. Please query the file and running record again to confirm the result.

POST https://moi.matrixorigin.cn/newmoi/task/retry

Before you call

Prepare the personal access token, target workspace ID, and task ID that have access to the target workspace. First Query task files, select only failed files; the task must be in completed or failed state.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: The workspace ID to retry the task, passed through the X-Workspace-ID Header.

  • $TASK_ID: Import task ID.

  • $FILE_ID: ID of the failed file.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/task/retry" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d "{\"task_id\":\"$TASK_ID\",\"ids\":[\"$FILE_ID\"]}"

Retry all failed files:

curl -X POST "https://moi.matrixorigin.cn/newmoi/task/retry" \
  -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

task_id

string

yes

Import task ID.

ids

string[]

No

List of failed file IDs to retry; omitting or passing an empty array will retry the task on all failed files.

[] 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. A successful submission does not mean that the file has been processed.

{
  "code": "OK",
  "msg": "OK",
  "data": null
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data

null

This interface does not return retry run records.

Error response

{
  "code": "ErrForbidden",
  "msg": "permission denied",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

The request body is invalid, or the task is not in a completed or failed state.

Fix task_id and file ids, and try again after confirming the task status.

403

ErrForbidden

The caller does not have permission to operate the task.

Check workspace and object authorization.

503

ErrCoreAuthorizeUnavailable

The service is temporarily unable to complete the authorization check.

Try again later.

200

ErrServer

Service failed to submit retry.

Check both HTTP status and code.

Follow-up operations

After retrying the acceptance, Query task files and Query run records again to confirm whether the number of failed items has been reduced.

Last updated on