We can use the Retrieve Folder or Repository Archive REST API, which allows us to download the content of a folder as an archive file. The supported archive types are 'zip','tar','tar.gz', and 'tgz'. The archiveType=<type> query parameter is required in the URL.