Permanently deletes files from a specified knowledge base.
Operation description
This operation does not support deleting data from data query or image Q&A knowledge bases. Use the Model Studio console instead.
Resource Access Management (RAM) users must first obtain API permissions for Model Studio (requiring
AliyunBailianDataFullAccess, which includes the sfm:DeleteIndexDocument permission), before calling this operation. Alibaba Cloud accounts can call this operation directly without authorization. Use the latest Model Studio SDK to call this operation.Before calling this operation, make sure that your knowledge base has been created and has not been deleted (that is, the knowledge base ID
IndexIdis valid).You can only delete files whose status is import failed (INSERT_ERROR) or import succeeded (FINISH) in the knowledge base. To query the file status in a specified knowledge base, call the ListIndexDocuments operation.
Deletion is irreversible. The content of deleted files cannot be recovered, and the Retrieve operation can no longer retrieve related information. Proceed with caution.
Calling this operation does not delete documents that have been imported into Application Data.
This operation is idempotent.
Throttling: This operation is throttled if called too frequently. Do not exceed 10 calls per second. If you are throttled, retry later.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sfm:DeleteIndexDocument |
delete |
*All Resource
|
None | None |
Request syntax
POST /{WorkspaceId}/index/delete_index_document HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
Yes |
The ID of the workspace to which the knowledge base belongs. For information about how to obtain the workspace ID, see How to use a workspace. |
llm-3z7uw7fwz0vxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| IndexId |
string |
Yes |
The knowledge base ID, which is the |
79c0alxxxx |
| DocumentIds |
array |
Yes |
The list of file IDs. |
|
|
string |
No |
The file ID, which is the |
file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
17204B98-xxxx-4F9A-8464-2446A84821CA |
| Code |
string |
The error code. |
Index.InvalidParameter |
| Message |
string |
The error message. |
Required parameter(%s) missing or invalid, please check the request parameters. |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| Data |
object |
The business data field returned by the operation. |
|
| DeletedDocument |
array |
The list of successfully deleted file IDs. |
|
|
string |
The file ID. |
file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx |
|
| Status |
string |
The status code returned by the operation. |
200 |
Examples
Success response
JSON format
{
"RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA",
"Code": "Index.InvalidParameter",
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"Success": true,
"Data": {
"DeletedDocument": [
"file_5f03dfea56da4050ab68d61871fc4cb3_xxxxxxxx"
]
},
"Status": "200"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.