Delete Document
This method allows you to remove a document from an index.
When a document is removed, its embeddings (if any) are removed from the vector-store associated with the index, and its chunks will no-longer appear in any search result.
Note that you can only remove documents from an index for a knowledge base that
was created with data_origin_type=LOCAL_FILES. For details, refer to the method
to Create a new knowledge base.
To remove documents from any other type of index, remove the documents from the underlying data source and trigger a new indexing. Any document that is not found in the data source will be removed automatically as part of the indexing.
knowledge_base_id
index_id
document_id
Successful Response
{
"id": "string",
"object": "string",
"deleted": false
}
id
object
deleted
Invalid document ID or mismatched knowledge base and document IDs.
Validation Error
"HTTPValidationError Object"
detail
curl -X DELETE -H 'Authorization: <value>' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/documents/{document_id}