$image_id = "ID_OF_YOUR_IMAGE";
$api_key = "YOUR_API_KEY";
function delete_image($image_id, $api_key) {
$url = "https://api.autoenhance.ai/v3/images/$image_id";
$options = array(
'http' => array(
'header' => "Content-Type: application/json\r\n" .
"x-api-key: $api_key",
'method' => 'DELETE',
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
return 'Error deleting image';
}
return 'Image deleted successfully';
}