Overview
Delete specific documents or vectors from a namespace by providing their IDs. Use the documents endpoint for text data and vectors endpoint for vector data. Both operations are permanent and decrement your total item count.
This operation permanently deletes data and cannot be undone. Deleted items will decrement your total item count.
Endpoints
Documents : POST /namespaces/{namespace_name}/documents/delete - Delete text documents from namespace
Vectors : POST /namespaces/{namespace_name}/vectors/delete - Delete vector embeddings from namespace
Authentication
Your API key for authentication
Path Parameters
Name of the namespace containing the data to delete
Body Parameters
Array of item IDs to delete (max 1000 items per request). Numbers will be converted to strings.
Delete Documents
Delete Vectors
Request Body
curl -X POST "https://api.moorcheh.ai/v1/namespaces/my-namespace/documents/delete" \
-H "Content-Type: application/json" \
-H "x-api-key: your-api-key-here" \
-d '{
"ids": [
"document-001",
"document-002",
"document-003"
]
}'
200 - Success
207 - Multi-Status
Response 3
401 - Unauthorized
403 - Forbidden
404 - Not Found
429 - Rate Limited
500 - Server Error
{
"status" : "success" ,
"message" : "Successfully processed deletion request. Requested: 1, Actually deleted: 0 items from namespace 'test'." ,
"requested_deletions" : 1 ,
"actual_deletions" : 0 ,
"remaining_items" : 1 ,
"requested_ids" : [
"doc-001"
]
}
Response Fields
Success Response (200)
Always “success” for 200 responses
Human-readable confirmation message with deletion counts
Number of items requested to be deleted
Number of items actually deleted
Total number of items remaining in namespace after deletion
List of item IDs that were requested to be deleted
Partial Success Response (207)
“partial” for 207 responses
IDs of items that failed to be deleted
Important Notes
Maximum of 1,000 IDs can be deleted in a single request
IDs can be strings or numbers - they’ll be converted to strings internally
This operation permanently deletes data and cannot be undone
Successfully deleted items will decrement your total item count
Use the correct endpoint: documents/delete for text data, vectors/delete for vector data
Both endpoints use POST method (not DELETE) for security and payload reasons
Namespace must exist and belong to your account
The API uses batch deletion for efficient processing
Understanding Responses
200 Response : No items failed to process (no unprocessed items)
207 Response : Some items were successfully deleted while others failed
Check actual_deletions vs requested_deletions to see if items were found
If actual_deletions is 0, the requested IDs may not exist in the namespace
The remaining_items count reflects the current namespace size
Use Cases
Data Cleanup : Remove outdated or temporary documents/vectors
Content Management : Delete specific items by ID
Privacy Compliance : Remove specific user data
Storage Management : Free up space by removing unused content
Testing : Clean specific test data between runs