Delete Indexed Documents
Remove all Azure AI Search index chunks for a given document_id without needing to track individual chunk keys. The Lowcademy Labs endpoint queries your Azure AI Search index for all chunks matching the document_id, then issues a bulk delete. This is the clean way to remove a document from your RAG index when it becomes outdated or needs to be re-indexed.
| Property | Value |
|---|---|
| Method | POST |
| Body | Empty — all parameters are passed as request headers |
| Service | Lowcademy hosted — proxies deletion to your Azure AI Search index |
document_id from your Azure AI Search index. To re-add the document, run the full ingestion pipeline again (Steps 1–2).
https://my-search.search.windows.netTwo sets of credentials are required
api-keyankitg.inazureAISearchKey{{azureAISearch_Key}}| Header | Type | Required | Description |
|---|---|---|---|
| api-key | String | Required | Fixed Lowcademy lab API key. Value: ankitg.in |
| azureAISearchEndpoint | String (URL) | Required | Your Azure AI Search endpoint. Maps to {{azureAISearch_Endpoint}}. |
| azureAISearchKey | String | Required | Your Azure AI Search admin key. Maps to {{azureAISearch_Key}}. |
| indexName | String | Required | Name of the index to delete from. Maps to {{azureAISearch_IndexName}}. |
| document_id | Integer | Required | The numeric document_id whose chunks should be deleted. All chunks with this ID are removed. |
cURL
curl -X POST \ -H "api-key: ankitg.in" \ -H "azureAISearchEndpoint: https://my-search.search.windows.net" \ -H "azureAISearchKey: <your-azure-search-admin-key>" \ -H "indexName: my-rag-index" \ -H "document_id: 42" \ https://labs.lowcademy.com/apis/delete-indexed-document.php
Successful Delete Response
{
"success" : true,
"deleted" : 14,
"document_id" : 42,
"message" : "14 chunks deleted for document_id 42."
}document_id, the response will still be 200 with "deleted": 0. This means the document was never indexed or was already deleted.
deleted count.api-key header missing or wrong.azureAISearchEndpoint, azureAISearchKey, indexName, or document_id).