# Files API - Not possible to completely delete a folder

**URL:** <https://community.hubspot.com/t/files-api-not-possible-to-completely-delete-a-folder/42893>\
**Category:** APIs & Integrations\
**Tags:** free\
**Created:** [August 25, 2021, 6:33pm UTC](https://community.hubspot.com/t/files-api-not-possible-to-completely-delete-a-folder/42893 "2021-08-25T18:33:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![StaffG](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/staffg/32/63860_2.png) [@StaffG](https://community.hubspot.com/u/StaffG)\
**Post date:** [August 25, 2021, 6:33pm UTC](https://community.hubspot.com/t/files-api-not-possible-to-completely-delete-a-folder/42893/1 "2021-08-25T18:33:30Z")

</div>

I am trying to delete a folder (using either the folder path or the folderId). This results in the folder beeing marked as “archived”. However, when trying to create a folder with the same path/name 201 is returned but the folder returned in the response is the “old folder” (same Id as the original folder and archived set to true).

After that I am stuck in a state where:

1. I cannot delete the folder completly (no API endpoint for this)
2. I cannot unarchive the folder (no API endpoint for this)
3. I cannot create a new folder with the same path (the old archived folder is returned)
4. I cannot upload files to the “folder” (the upload endpoint cannot find the folder).

Thanks for any help on how to get around this situation!

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [August 26, 2021, 10:57am UTC](https://community.hubspot.com/t/files-api-not-possible-to-completely-delete-a-folder/42893/2 "2021-08-26T10:57:45Z")

</div>

Hi @StaffG ,  
You can delete the folder by this api [https://api.hubapi.com/filemanager/api/v2/folders/{folder\_id}?hapikey=demo](https://api.hubapi.com/filemanager/api/v2/folders/%7Bfolder_id%7D?hapikey=demo) , for more info refer to this doc [https://legacydocs.hubspot.com/docs/methods/files/delete\_folders\_folder\_id](https://legacydocs.hubspot.com/docs/methods/files/delete_folders_folder_id)

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.
