Delete File
Endpoints
Delete File
Delete a file from your Hubsy Cloud account
DELETE
Delete File
Overview
Permanently delete a file from your Hubsy Cloud storage. This action cannot be undone.Path Parameters
The unique identifier of the file to delete
Example Request
Response
Indicates if the deletion was successful
Information about the deleted file
Example Response
Error Responses
Important Notes
Trash and Recovery
Trash and Recovery
Deleted files are moved to trash for 30 days:
- Files remain recoverable for 30 days
- After 30 days, files are permanently deleted
- Use the restore endpoint to recover files
- Storage space is freed only after permanent deletion
Shared Links
Shared Links
Permanent Deletion
Permanent Deletion
To permanently delete immediately:
- Use the
permanent=truequery parameter - This bypasses the trash
- Action cannot be undone
- Requires elevated API key permissions
Permanent Deletion
To permanently delete a file immediately (bypass trash):Bulk Delete
Delete multiple files at once:Bulk Delete Response
Restore Deleted File
Restore a file from trash:Restore Response
Related Endpoints
List Trash
GET /trash - View deleted filesEmpty Trash
DELETE /trash - Permanently delete all trashed filesRestore File
POST /files/{file_id}/restore - Restore from trashBulk Delete
POST /files/bulk-delete - Delete multiple filesBest Practices
Confirm Before Deleting
Confirm Before Deleting
Always confirm with users:
- Show file name and details
- Explain trash/recovery period
- Provide undo option
- Log deletion for audit trail
Error Handling
Error Handling
Handle common scenarios:
- File already deleted
- Permission errors
- Invalid file ID
- Network timeouts
Bulk Operations
Bulk Operations
For multiple file deletions:
- Use bulk delete endpoint
- Handle partial failures
- Show progress to users
- Provide summary of results