Files API - Get List of all files in Folder

Hey community,

just found the new Files Api and checked the endpoints, but couldn’t find an endpoint to get a simple list of all files in a specific folder.

Something simple like:
GET /files/v3/folders/{folderId}/files

Use case:
As a User, I want to see all available files in a folder, So I can click on a file to view it.

Can anyone help me out to the the list of files?

Hi @novista,

You can do this by using the GET/files/v3/files/search endpoint. If you have the folder ID you can preform a get request like:

https://api.hubapi.com/files/v3/files/search?parentFolderId={Your-Folder-ID-Here}&hapikey={Your-hapikey-Here}

Or if you know the path you can do:

https://api.hubapi.com/files/v3/files/search?path={Your-Path-Here}&hapikey={Your-hapikey-Here}

And for reference an example path could look like this(without the quotes):

“/folder-one/Folder%20Two/”

Notice the %20 URL encoding of a space, and how the path starts and ends with a “/”.

The problem is this has a limit 100 files

How can one retrieve all files within a folder, including those in its subsubfolders ?

Hi @novista ,
Please follow the below link for files:
Screen shot : Screenshot by Lightshot
Links : https://legacydocs.hubspot.com/docs/methods/files/get_files_file_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.