documents.delete / vectors.delete
Deletes specific documents or vectors from a namespace by their IDs. Usedocuments.delete for text data and vectors.delete for vector data.
Parameters
The name of the target namespace.
A list of document/vector IDs to delete (max 1000 items per request).
Dict[str, Any] - A dictionary confirming the deletion status.
Raises: NamespaceNotFound, InvalidInputError.
Examples
Delete Documents Example
Delete Vectors Example
Response Structure
The response contains:status(str): “success” or “partial”message(str): Human-readable confirmation messagerequested_deletions(int): Number of items requested to be deletedactual_deletions(int): Number of items actually deletedremaining_items(int): Total number of items remaining in namespaceunprocessed_ids(list, optional): IDs that failed to be deleted (for partial success)
Complete Example
Complete Deletion Example
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
documents.deletefor text data,vectors.deletefor vector data - Namespace must exist and belong to your account
Understanding Responses
- 200 Response: No items failed to process (no unprocessed items)
- 207 Response: Some items were successfully deleted while others failed
- Check
actual_deletionsvsrequested_deletionsto see if items were found - If
actual_deletionsis 0, the requested IDs may not exist in the namespace - The
remaining_itemscount reflects the current namespace size
Best Practices
- Verify document IDs before deletion
- Delete in batches for large operations
- Check the response to confirm successful deletions
- Implement proper error handling for partial failures
- Consider backing up important data before deletion
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
Related Operations
- Get Documents - Retrieve documents before deletion
- Upload Text Data - Add new text documents
- Upload Vector Data - Add new vector data