Prerequisites
- A Marqo Cloud account (sign up here)
- Your Marqo API key (find your API key guide)
- An existing ecommerce index with products (add products guide)
Delete Documents by ID
Remove specific product documents by making aDELETE /documents request with an ids array in the request body.
Endpoint: DELETE https://ecom.marqo-ep.ai/api/v1/indexes/{index_name}/documents
Request Body:
Single Product Deletion
Delete one product by providing a single ID in theids array:
Batch Product Deletion
Delete multiple products by providing multiple IDs:Single Product Deletion
Delete one specific product by providing its ID:Batch Product Deletion
Delete multiple products efficiently in a single request:{index_name} with your actual index name and {api_key} with your API key.
Deletion Response
The response provides detailed information about the deletion operation:Response Fields
| Field Name | Type | Description |
|---|---|---|
details.deletedDocuments | Integer | Number of documents successfully deleted |
details.receivedDocumentIds | Integer | Number of document IDs received in the request |
items | Array | Status of each individual document deletion |
items[].\_id | String | The ID of the document |
items[].result | String | Result of the deletion operation |
items[].status | Integer | HTTP status code for this specific deletion |
Status Codes
| Status Code | Description |
|---|---|
200 | Document successfully deleted |
404 | Document with the specified ID was not found |
400 | Bad request (invalid ID format) |
500 | Internal error |
Common Deletion Scenarios
Product Discontinuation
Remove discontinued products from your catalog:Variant Management
Remove specific variants while keeping the parent product:Seasonal Cleanup
Remove seasonal products after the season ends:Catalog Migration
Reset index before importing new catalog:Best Practices
Deletion Safety
- Verify IDs - Ensure product IDs exist before attempting deletion
- Backup data - Keep backups before bulk deletions
- Test first - Test deletion operations on a staging index
- Batch wisely - Delete in reasonable batch sizes (50-100 IDs)