Delete agent version

Remove a disabled and non-default version. This version cannot be restored after deletion.

DELETE https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agents/{agent_id}/versions/{version}

Preparation before calling

First query the agent version and confirm the version number to be deleted. Prepare a personal access token with access to the target workspace, target workspace ID, agent ID, and version number.

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 as workspace_id in the path.

  • $AGENT_ID: Target agent ID, as agent_id in the path.

  • $VERSION: The version number to delete, as version in the path.

Only deactivated and non-default versions can be deleted.

Request example

curl -X DELETE "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agents/$AGENT_ID/versions/$VERSION" \
  -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

The current workspace ID.

agent_id

string

Yes

Agent ID.

version

string

Yes

The version number to delete.

Successful response

Returns 200 on success. When data.deleted was true, the version was deleted.

{
  "code": 0,
  "data": {
    "deleted": true
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

0 on success.

data.deleted

boolean

When true, the specified version has been deleted.

Error response

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

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

2INVALID_ARGUMENT

The path parameter is invalid, or the version is still the default version and has not been deactivated.

Set other runnable versions as default before deactivating the target version.

401

6UNAUTHENTICATED

Lack of valid identity credentials.

Check API Key.

403

5PERMISSION_DENIED

The current caller does not have permission to update the agent.

Check the agent authorization in the workspace.

404

3NOT_FOUND

The agent or version does not exist.

Query the version list first.

503

15UNAVAILABLE

Version service, operation record service or authorization dependency are temporarily unavailable.

Try again later.

Follow-up operations

Query the agent version, confirm that the target no longer appears.

Last updated on