DELETE /api/user/files/:id
Permanently delete a file from both the database and the datasource storage.Path Parameters
The file ID or file name to delete. Both the unique file ID (
clxyz123) and the file name on server (abc123.png) are accepted.Response
Returns the deleted file object with the same structure as the Get File endpoint.Unique file identifier of the deleted file
File name that was on the server
Original name of the uploaded file
File size in bytes
MIME type of the file
Number of times the file was viewed before deletion
Maximum allowed views that was set
Whether the file was marked as favorite
Whether the file was password-protected
ID of the folder that contained this file
ISO 8601 timestamp of file creation
ISO 8601 timestamp of last update
ISO 8601 timestamp of scheduled deletion
The URL that was used to access the file (now inactive)
Thumbnail information that was available
Array of tag objects that were associated with this file
Example Response
Error Responses
404 Not Found
The file does not exist, or you don’t have permission to delete it.
Permissions
You can only delete files that:- You own, OR
- Belong to a user with a lower role than yours (if you’re an admin/superadmin)
What Gets Deleted
- Database Record: The file entry is removed from the database
- Physical File: The actual file is deleted from the datasource storage
- Thumbnail: Associated thumbnail is automatically deleted via cascade
- Tags: Tag associations are removed (tags themselves are preserved)
The deletion is logged with the username, file name, size, and owner ID for audit purposes.