How do I delete an empty folder using the Destroy method of the Upload Api?

Comments

8 comments

  • Avatar
    Shirly Manor

    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>"
    0
    Comment actions Permalink
  • Avatar
    Isaac Hinman

    What is the status of this presently? Being able to delete folders (both with children and empty) should be possible via the SDKs directly.

    0
    Comment actions Permalink
  • Avatar
    Shirly Manor

    Hi Isaac, deleting empty and not empty folders is on our roadmap. but no ETA yet.

    0
    Comment actions Permalink
  • Avatar
    Ivan Turuk

    Hello, Shirly.
    I have try to use described API call from node.js, but received 'allow-control-allow-origin' error.
    Auth was specified.
    Thanks

    0
    Comment actions Permalink
  • Avatar
    Raya Straus

    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?

     

     

    0
    Comment actions Permalink
  • Avatar
    Shirly Manor

    Update:

    You can now delete a folder with assets via Media Library UI.

    0
    Comment actions Permalink
  • Avatar
    Ganizani Chiwaura

    What is the status of this ticket now after 5 years? I also need to delete a folder via API using the destroy method

    0
    Comment actions Permalink
  • Avatar
    Thomas Gurung

    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

    0
    Comment actions Permalink

Please sign in to leave a comment.