Deleting Product Images
Endpoints: DELETE /admin/products/{product_id}/images/{image_id}
Purpose
This endpoint allows administrators to permanently remove specific images associated with a product. It deletes both the original image and any generated thumbnail versions from the system storage while maintaining the integrity of the remaining product data.
Path Parameters
Parameter | Type | Description |
---|---|---|
product_id | Integer | The unique identifier of the product containing the image |
image_id | Integer | The unique identifier of the specific image to be deleted |
Query Parameters
No query parameters for this endpoint.
Use Case
Administrators use this endpoint when they need to remove outdated, incorrect, or unwanted product images while keeping the product record intact. Typical scenarios include deleting temporary placeholder images after adding final product photos, removing duplicate images, or cleaning up old product versions. The function targets specific images without affecting other media assets or product information, making it precise for media management operations.
Request Body
No data is required for the request body.
Response
The endpoint returns a 204 No Content
status upon successful deletion, indicating the image was removed without returning any data. The absence of content in the response confirms the operation was completed successfully while maintaining security by not exposing internal file system information.