The Syncthing API code evaluates a parameter named dirsonly on the GET /rest/db/browse call:
https://github.com/syncthing/syncthing/blob/17e60b9e0c340d12b80d015663c058bd54d03557/lib/api/api.go#L778
This parameter is not documented. Especially it should be cleared up what values are evaluated as true: no, 0 and false would all be regarded as true if I read the code correctly. Maybe that should be tightened / specified more clearly also in the API code.