How do I delete an empty folder using the Destroy method of the Upload Api?
I am able to remove the images in a folder, but when a folder PublicId (path) is sent with the Destroy method "Not Found" is returned. This leaves phantom folders in the cloudinary media library.
-
We have an API method for deleting empty folders, but it is not currently documented or supported in our SDKs. It is on our roadmap to support this. While no ETA for it yet, I'll gladly let you know once it's ready.
However, you can accomplish this by calling the API directly, for example:
curl -X DELETE -u <API_KEY>:<API_SECRET> "https://api.cloudinary.com/v1_1/<cloud_name>/folders/<folder>"
-
Hi Ivan,
Can you please open a ticket at support@cloudinary.com with more information on your implementation so that we can further assist you?
-
Hi Ganizani,
Thank you for reaching out.
So to delete folders you need to use the delete_folder API, more details on this can be found via https://support.cloudinary.com/hc/en-us/articles/202520972-How-can-I-delete-a-folder-from-the-Media-Library-
Please let me know if you have any other questions or queries.
Kind Regards,
Thomas
Please sign in to leave a comment.
Comments
8 comments