Add filesize to v4 /folders endpoint

,

Hi there,

in V2 we used the /v2/assets/:asset_id and /v2/assets/:asset_id/children endpoints to fetch folder size information. These endpoints used to include a “filesize” field which showed the total size of all assets in that folder added up.

That allowed us to easily display how content was distubuted in the storage pool in a WinDirStat/TreeSize kinda way without scanning the entire storage.

The current v4 implementation on /v4/accounts/:account_id/folders/:folder_id/children shows filesize only on files but not on folders. To get the size value now would require accessing all subdirectories recursively and adding up all the files.

Though it seems the information is still available internally, since using the new search can find folders filtered by size.

It would be lovely to know if thats a feature that will return in a future update.

Thanks y’all.

Jannik

Hi @jannikr!

That is correct, folder sizes aren’t currently exposed via the V4 API. At this time, the best workaround would be the approach that you mentioned, traversing subdirectories and adding up the file sizes. Understood that this isn’t a great substitute for the Legacy workflow.

I’ve gone ahead and created a ticket to capture this feedback as a feature request. I’ll make sure to update this thread with additional information on that request as it becomes available.