Archive automation tasks

Archiving automation tasks. This interface does not physically delete the task, but instead sets its status to archived.

DELETE https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-automation-tasks/{automation_task_id}

Preparation before calling

First Query automation task detailsconfirm the current status 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 the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through the X-Workspace-ID Header and also as workspace_id in the path.

  • $TASK_ID: The automation task ID to be archived, as automation_task_id in the path.

Request example

curl -X DELETE "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"

Path parameters

Parameters

Type

Is it required

Description

workspace_id

string

Yes

Workspace ID.

automation_task_id

string

Yes

Automation task ID.

Successful response

Returns 200 on success. data returns the archived task, data.status as archived. Tasks should not be considered triggerable after being archived.

{
  "code": 0,
  "data": {
    "id": "task_01",
    "workspace_id": "ws_01",
    "status": "archived",
    "version": 3,
    "updated_at": "2026-08-18T03:00:00Z"
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.id

string

Automation task ID and associated workspace ID.

data.workspace_id

string

Automation task ID and associated workspace ID.

data.status

string

archived on success.

data.version

integer

Archived task version.

data.updated_at

string

Archive time, using RFC 3339 format.

Other fields of data

object

Are consistent with the task fields returned by Query automation task details.

Error response

{
  "code": 3,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2INVALID_ARGUMENT

The path parameter is invalid, or the current status of the task cannot be archived.

Check task ID and current status.

401

6UNAUTHENTICATED

Lack of valid identity credentials.

Check API Key.

404

3NOT_FOUND

The automated task does not exist.

Check the task list first.

409

4ALREADY_EXISTS

Task status conflicts with archiving operation.

Refresh task details before performing the operation.

503

15UNAVAILABLE

The automated task service is unavailable.

Try again later.

Follow-up operations

If you need to retain the running results before archiving, please record the run ID that needs to be retained and query the corresponding running details or results.

Last updated on