The documentation and support for the boxes are terrible. Here is what I understood:
Unfortunately, you must first share the file. There seems to be no way to make private domains in the API from what I found, except through email (wtf?).
For completeness, shares can be done using api, for example: (note that the file.unshare method [at the time of writing] is broken, so the call through file.api is broken)
file.share_public file.api.unshare_public(file.type, file.id)
source share