how to access photo public id including a folder name?

rwahdan Member Posts: 50

I am trying to delete photos from my API using the photo public id but with one issue, I have the photos inside a folder so the photo public id is something like this:


and if i try to delete that photo it will bring error file not found as it will treat it as a path rather than public id.




  • Cloudinary Team
    Cloudinary Team Administrator, Cloudinary Staff Posts: 123 admin

    Hi there,

    Thanks for reaching out.

    It is not a problem to delete assets inside of folders. You just pass the full public_id to the destroy method call. So for example, if you had a folder named 'cats' and you wanted to delete an asset, 'noDogsAllowed.jpg' inside of that folder, you would pass "cats/noDogsAllowed"
    You can refer to our documentation for additional information, including code examples:

    I hope this helps. If you have any questions, just let us know.

    Kind regards,


    Helpful Links For You
    💬 Share questions, connect with other users in our Cloudinary Community forums and Discord server!
    🧑‍🎓 Join our Cloudinary Academy for free courses, workshops and other educational resources.
    📄 Read our documentation for in-depth details on Cloudinary product features and capabilities
    📰 Check out the Cloudinary blog for the latest company news and insights