Delete a file
Files
Delete File
Deletes a file record and optionally removes from storage.
DELETE
Delete a file
Overview
Delete a file from storage. This permanently removes the file—it cannot be recovered.Common Use Cases
- Cleanup: Remove outdated or superseded documents
- Corrections: Delete incorrectly uploaded files
- Compliance: Remove files per data retention policies
- Storage Management: Free up storage space
What Gets Deleted
- File content is permanently removed from storage
- File metadata is removed from the database
- References in orders/subscriptions are cleared
Example: Delete Obsolete Document
Example: Cleanup Old Files
Error Handling
| Error Code | Cause | Solution |
|---|---|---|
NOT_FOUND | File doesn’t exist | Verify file ID |
DELETE_FAILED | Storage error | Retry or contact support |
Related Endpoints
- Get File - Verify file before deletion
- List Files - Find files to delete
Authorizations
API key obtained from FlexPortal dashboard
Headers
Your tenant identifier
Path Parameters
The file ID
Body
application/json
Also delete from storage (default: true)