Skip to main content

DELETE /api/images

Deletes one or more images from the photo frame collection. Requires admin authentication.
This is a protected endpoint. You must be logged in as admin to delete images.

Request

string[]
required
Array of image paths to delete (relative to uploads directory)

Request Example

Single Image
Multiple Images

Response

Status Codes

Success
Images deleted successfully (may include partial failures)
Bad Request
Missing or invalid images parameter
Unauthorized
Admin authentication required
Server Error
File system error during deletion

JavaScript Example

Important Notes

Permanent Deletion: Deleted images cannot be recovered. Make sure you have backups if needed.
  • Image paths should be relative to the uploads directory
  • Use forward slashes for path separators
  • Non-existent files are reported but don’t cause the entire operation to fail
  • Empty folders are not automatically removed after deleting all contents
  • Deletion is permanent - there is no trash/recycle bin functionality

Bulk Operations

For deleting many images:
  • Consider breaking large batches into smaller chunks
  • Monitor server response times for large operations
  • Check the response for any partial failures
  • Failed deletions don’t stop the processing of remaining images