Delete Product Image
Delete an existing product image.
HTTP Request
DELETE/api/products/:product_id/images/:image_id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| product_id | integer | Yes | The unique identifier of the product |
| image_id | integer | Yes | The unique identifier of the image to delete |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Delete a specific product image
4response = requests.delete(
5 'http://www.example.com/api/products/123/images/456',
6 headers={'Authorization': 'Token <your_api_key>'}
7)
8print(response.status_code) # Should be 204 for successful deletion1# Delete a specific product image
2curl -X DELETE "http://www.example.com/api/products/123/images/456" \
3-H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 204 | Product image deleted successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Access denied |
| 404 | Not Found - Product or image not found |
Response Fields
| Field | Type | Description |
|---|---|---|
| No Content | empty | No response body returned for successful deletion |