Delete knowledge base¶
Deletes the knowledge base and its definitions; the Catalog tables and files containing the source are not deleted. Before deleting, please confirm that the agent, workflow, or application no longer references the knowledge base.
DELETE https://moi.matrixorigin.cn/newmoi/semantic-models/{model_id}
Preparation before calling¶
First query the knowledge base details and confirm the knowledge base 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 theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$MODEL_ID: ID of the knowledge base to be deleted.
Request example¶
curl -X DELETE "https://moi.matrixorigin.cn/newmoi/semantic-models/$MODEL_ID" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Description |
|---|---|---|
|
integer |
The ID of the knowledge base to be deleted. |
Successful response¶
The knowledge base was deleted when code in the response was OK and data.deleted was true.
{
"code": "OK",
"msg": "OK",
"data": {
"deleted": true
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
|
|
string |
|
|
boolean |
|
Error response¶
{
"code": "ErrNotFound",
"msg": "resource not found",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
|
Use the knowledge base |
|
|
The API Key is invalid or has expired. |
Check API Key. |
|
|
The caller does not have permission to delete the knowledge base. |
Check workspace and object authorization. |
|
|
The knowledge base does not exist or is not visible to the current caller. |
Relist the knowledge base and confirm the ID. |
|
|
The service rejects the current delete operation. |
Handle the object or state pointed to by the conflict first. |
|
|
The service failed to complete deletion. |
Keep the desensitized response information and try again. |
Follow-up operations¶
Query the knowledge base list Confirm that the knowledge base has been removed.