Delete Collection
This endpoint permanently deletes a collection and all media items it contains. This operation removes all vectors and metadata associated with the collection's media items from both high-dimensional and low-dimensional vector stores.
Endpoint
DELETE https://api.wickson.ai/v1/media/collections/{collection_id}
Request
X-Api-Key: Required. Your Wickson API key with delete capability.
Path Parameters
collection_id: Required. The identifier of the collection to delete.
Example Request
curl -X DELETE \
-H "X-Api-Key: YOUR_API_KEY" \
https://api.wickson.ai/v1/media/collections/research_papers
Python Example
import requests
# Configuration
api_key = "YOUR_API_KEY"
collection_id = "research_papers"
# Delete the collection
response = requests.delete(
f"https://api.wickson.ai/v1/media/collections/{collection_id}",
headers={"X-Api-Key": api_key}
)
# Process the response
if response.status_code == 200:
data = response.json()["data"]
print(f"Collection '{data['collection_id']}' deleted:")
print(f" {data['deleted_items']} items removed")
print(f" {data['storage_info']['deleted_vectors']['hd']} HD vectors deleted")
print(f" {data['storage_info']['deleted_vectors']['ld']} LD vectors deleted")
else:
print(f"Error {response.status_code}: {response.text}")
Response
Status Codes
| Status Code |
Description |
| 200 OK |
Collection deleted successfully. |
| 401 Unauthorized |
Invalid or missing API key. |
| 403 Forbidden |
Insufficient API key permissions. |
| 404 Not Found |
Collection not found. |
| 429 Too Many Requests |
Rate limit exceeded. |
| 500 Internal Server Error |
An unexpected error occurred. |
Body (JSON)
{
"success": true,
"message": "Collection 'research_papers' deleted successfully",
"data": {
"collection_id": "research_papers",
"deleted_items": 17,
"storage_info": {
"deleted_vectors": {
"hd": 17,
"ld": 17
}
}
},
"metadata": {
"api_version": "1.0.0"
}
}
Response Fields
Deletion Results
| Field |
Description |
collection_id |
Identifier of the deleted collection. |
deleted_items |
Number of media items deleted from the collection. |
storage_info.deleted_vectors.hd |
Number of high-dimensional vectors deleted. |
storage_info.deleted_vectors.ld |
Number of low-dimensional vectors deleted. |
Important Considerations
- This operation is permanent and cannot be undone. All media items in the collection will be deleted.
- You cannot delete the "default" collection. Media items in the default collection must be deleted individually or moved to another collection first.
- This operation is atomic - either all media items are deleted or none are deleted.
- Deletion of large collections may take significant time to process, but the API response is returned once the operation is safely queued.
Error Responses
In case of error, the response will follow this structure:
{
"success": false,
"message": "Error message describing what went wrong",
"error": {
"code": "ERROR_CODE",
"details": {
"specific": "error details",
"request_id": "req_12345"
}
}
}
Common Error Scenarios
| HTTP Status |
Error Code |
Description |
| 401 |
INVALID_API_KEY |
Invalid or missing API key |
| 403 |
INSUFFICIENT_PERMISSIONS |
API key lacks delete capability |
| 404 |
COLLECTION_NOT_FOUND |
The specified collection doesn't exist |
| 400 |
CANNOT_DELETE_DEFAULT |
The default collection cannot be deleted |
| 429 |
RATE_LIMIT_EXCEEDED |
Too many requests in time period |
| 500 |
PROCESSING_ERROR |
Error during deletion processing |