Get directory/file info from container

i’m trying to work out a way to retrieve full file/directory structure info from containers via the API. I can’t find anything on the API docs to do this, only to find info about one specific file/directory. The way my project works is that i am communicating with several servers running docker from a separate web server, so i have no access to the containers other than the API. The end goal is that you can browse the files/folders within a directory in the container from the website and edit/upload new files.

Anyone have any suggestions?

cannot mount the files to an outer storage? maybe also some distributed filesystem with docker swarm?
I fear you kind of reinvent the wheel here.