curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup \
--header 'AccessKey: <api-key>'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup"
headers = {"AccessKey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {AccessKey: '<api-key>'}};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"statusCode": 123,
"data": {
"videoId": "<string>",
"videoLibraryId": 123,
"resolutionsToDelete": [
"<string>"
],
"resolutionsToDeleteFromPlaylist": [
"<string>"
],
"resolutionsToDeleteFromStorage": [
"<string>"
],
"resolutionsToDeleteFromMp4": [
"<string>"
],
"storageObjectsToDelete": [
"<string>"
],
"availableResolutionsAfter": [
"<string>"
],
"updatedAvailableResolutions": true,
"modifiedPlaylist": true,
"deletedStorageObjects": true,
"deletedOriginal": true
}
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"data": {
"videoId": "<string>",
"videoLibraryId": 123,
"resolutionsToDelete": [
"<string>"
],
"resolutionsToDeleteFromPlaylist": [
"<string>"
],
"resolutionsToDeleteFromStorage": [
"<string>"
],
"resolutionsToDeleteFromMp4": [
"<string>"
],
"storageObjectsToDelete": [
"<string>"
],
"availableResolutionsAfter": [
"<string>"
],
"updatedAvailableResolutions": true,
"modifiedPlaylist": true,
"deletedStorageObjects": true,
"deletedOriginal": true
}
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Cleanup unconfigured resolutions
Deletes stored resolution files that are no longer configured for the library, or the specific resolutions passed in resolutionsToDelete/allResolutions. This cannot be undone. If the library has ‘keep original files’ turned off, the original source file is also deleted as part of this cleanup even when deleteOriginal is not set.
curl --request POST \
--url https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup \
--header 'AccessKey: <api-key>'import requests
url = "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup"
headers = {"AccessKey": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {AccessKey: '<api-key>'}};
fetch('https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("AccessKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup")
.header("AccessKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://video.bunnycdn.com/library/{libraryId}/videos/{videoId}/resolutions/cleanup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"statusCode": 123,
"data": {
"videoId": "<string>",
"videoLibraryId": 123,
"resolutionsToDelete": [
"<string>"
],
"resolutionsToDeleteFromPlaylist": [
"<string>"
],
"resolutionsToDeleteFromStorage": [
"<string>"
],
"resolutionsToDeleteFromMp4": [
"<string>"
],
"storageObjectsToDelete": [
"<string>"
],
"availableResolutionsAfter": [
"<string>"
],
"updatedAvailableResolutions": true,
"modifiedPlaylist": true,
"deletedStorageObjects": true,
"deletedOriginal": true
}
}{
"success": true,
"message": "<string>",
"statusCode": 123,
"data": {
"videoId": "<string>",
"videoLibraryId": 123,
"resolutionsToDelete": [
"<string>"
],
"resolutionsToDeleteFromPlaylist": [
"<string>"
],
"resolutionsToDeleteFromStorage": [
"<string>"
],
"resolutionsToDeleteFromMp4": [
"<string>"
],
"storageObjectsToDelete": [
"<string>"
],
"availableResolutionsAfter": [
"<string>"
],
"updatedAvailableResolutions": true,
"modifiedPlaylist": true,
"deletedStorageObjects": true,
"deletedOriginal": true
}
}{
"success": true,
"message": "<string>",
"statusCode": 123
}{
"success": true,
"message": "<string>",
"statusCode": 123
}Authorizations
AccessKey based authentication
Path Parameters
The ID of the video library.
The GUID of the video.
Query Parameters
Comma-separated list of specific resolutions to delete (e.g. "720p,480p"), instead of relying on deleteNonConfiguredResolutions/allResolutions.
If set to true, all resolutions not currently configured for the library will be deleted.
If set to true, all resolutions for the video will be deleted, regardless of library configuration. When targeting HLS resolutions (the default, or outputs=all), at least one resolution must remain after cleanup or the request is rejected — scope outputs to mp4 to remove every rendition.
If set to true, the original source file is deleted as well. Note: the original is also deleted when the library has 'keep original files' disabled, regardless of this flag.
Outputs to clean. Supported values: hls, mp4, all
If set to true, MP4 fallback files for the deleted resolutions are removed too.
If set to true, no actual file manipulation will happen, only informational data will be returned
Response
The resolutions were successfully deleted
Determines if the request was successful
Human-readable message describing the result, typically populated with error details when Success is false.
The HTTP status code corresponding to the result of the request.
The response payload. Some endpoints also populate this with error details when Success is false — see the endpoint's own response documentation.
Show child attributes
Show child attributes
Was this page helpful?