JavaScript
Resources
Delete a File
Remove a file resource, its stored blob, and any indexed vectors.
DELETE
JavaScript
Overview
Permanently delete a file resource along with its stored binary, metadata, and all derived vector embeddings. This immediately removes the file’s content from search results and retrieval operations.Use cases: Removing outdated documentation, retracting superseded content, managing storage costs, or complying with data deletion requests.
Authentication
Requires valid JWT token or session authentication. You must own the parent corpus.Path Parameters
UUID
required
File resource identifier. Must belong to a corpus you own.Example:
0f75c73e-91bb-4e2b-9ff2-6820a8636ad8Example request
Response Codes
No Content
File successfully deleted. No response body returned.
Not Found
File does not exist or belongs to a corpus you don’t own.
Conflict
Backend could not delete the storage blob or vector embeddings. Retry usually succeeds once the storage subsystem catches up.Common causes:
- Storage service temporarily unavailable
- Vector database connection timeout
- Concurrent deletion attempt
What Gets Deleted
- File record - Database entry with metadata
- Storage blob - Actual file binary in cloud/local storage
- Vector embeddings - All chunks removed from Qdrant
- Indexing metadata - Processing status and timestamps
Immediate effect: Deletion prevents the file from appearing in future retrievals. Vector embeddings are removed before the database record is deleted.
Common Use Cases
Verify Before Deletion
Verify Before Deletion
Check file details before permanently deleting:
Batch File Deletion
Batch File Deletion
Remove multiple files efficiently:
Replace Updated Content
Replace Updated Content
Remove old version before uploading new:
Handle Deletion Failures
Handle Deletion Failures
Implement retry logic for 409 errors:
Alternative: Move to Archive Corpus
Alternative: Move to Archive Corpus
Instead of deleting, move files to an archive corpus:Benefits:
- Preserves data for potential future use
- Maintains audit trail
- Can restore if needed
Client examples
- Python
- TypeScript / JavaScript
- Java

