Delete semantic entries

Delete a semantic entry in the knowledge base.

DELETE https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}/entries/{entry_id}

Preparation before calling

First query the semantic entry to obtain the entry ID to be deleted. 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 X-Workspace-ID Header.

  • $MODEL_ID: Knowledge Base ID.

  • $ENTRY_ID: ID of the semantic entry to delete.

Request example

curl -X DELETE "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID/entries/$ENTRY_ID" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Path parameters

Parameters

Type

Description

model_id

integer

Knowledge base ID.

entry_id

integer

ID of the semantic entry to delete.

Successful response

Returns 200 on success. After deletion, the verification interface should be called to confirm that the remaining definitions are still valid.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "deleted": true
  }
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.deleted

boolean

true indicates that the entry has been deleted.

Error response

{
  "code": "ErrNotFound",
  "msg": "resource not found",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

model_id or entry_id is not valid.

Use the integer ID from the response.

401

ErrUnauthorized

The API Key is invalid or has expired.

Check API Key.

403

ErrForbidden

The caller does not have delete permission.

Check workspace and object authorization.

404

ErrNotFound

The knowledge base or entry does not exist or is not visible to the current caller.

Reconfirm ID.

500

ErrServer

The service failed to delete the entry.

Keep the desensitized response information and try again.

Follow-up operations

Verify semantic entries confirms that the remaining definitions are still valid.

Last updated on