Endpoint
Path Parameters
The unique identifier of the knowledgebase containing the dataset
The unique identifier of the dataset to delete
Headers
Your project API key for authentication
Response
Returns a success message confirming the deletion.Confirmation message that the dataset was deleted successfully
Error Responses
Status Code | Description |
---|---|
400 | Missing knowledgebase ID or dataset ID |
401 | Invalid API key |
403 | Dataset does not belong to the specified knowledgebase |
404 | Knowledgebase or dataset not found |
500 | Internal server error |
Deletion Process
- Validation: Verifies the knowledgebase exists and belongs to your project
- Dataset Verification: Ensures the dataset exists and belongs to the knowledgebase
- Chunk Removal: Deletes all text chunks associated with the dataset
- Embedding Cleanup: Removes vector embeddings from the search index
- File Deletion: Removes the original uploaded file
- Database Cleanup: Removes dataset metadata from the database
Important Notes
Permanent Action
- This action cannot be undone
- All chunks and embeddings are permanently removed
- The original file is also deleted from storage
Search Impact
- Queries will no longer return results from this dataset
- Existing search results may be affected immediately
- Related chunks will no longer appear in search results
Validation
- The dataset must belong to the specified knowledgebase
- Cross-validation prevents accidental deletion from wrong knowledgebase
- API key must have access to the project containing the knowledgebase
Usage Notes
- Ensure you have backups if you need to preserve the original file
- Consider the impact on existing applications using this dataset
- Large datasets may take a moment to fully clean up
- The operation is atomic - either all cleanup succeeds or nothing is deleted
Migration from Old Endpoint
If you’re migrating from the deprecated/api/datasets/{filename}
endpoint:
- Get your knowledgebase ID using Get Knowledgebases
- Get the dataset ID from Get Datasets in Knowledgebase
- Update your API calls to use both IDs in the URL path
- The response format remains the same