APIs & Integrations

StaffG
Participant

Files API - Not possible to completely delete a folder

SOLVE

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!

0 Upvotes
1 Accepted solution
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Files API - Not possible to completely delete a folder

SOLVE

Hi @StaffG ,

You can delete the folder by this api https://api.hubapi.com/filemanager/api/v2/folders/{folder_id}?hapikey=demo , for more info refer to this doc 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. 

View solution in original post

1 Reply 1
webdew
Solution
Guide | Diamond Partner
Guide | Diamond Partner

Files API - Not possible to completely delete a folder

SOLVE

Hi @StaffG ,

You can delete the folder by this api https://api.hubapi.com/filemanager/api/v2/folders/{folder_id}?hapikey=demo , for more info refer to this doc 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.