Documentation

Guides and API reference for uploads, image transforms and video.

npm install @cd2/fileboy-react
API https://api.fileboy.io

Zip downloads API reference

The zip downloads endpoints, generated from the OpenAPI document you can download for code generators and API clients: openapi.json or openapi.yaml. See every endpoint for the rest of the API.

Base URLhttps://api.fileboy.io

Many files, or a folder with its subfolders, as one zip streamed as it is made, or a short-lived link a browser can download it from. Making them needs your private key, opening a zip link needs nothing.

POST/files/zip

Download files as a zip

Streams a zip of up to 1,000 files picked by id, or of every file in a folder (and its subfolders unless recursive is false), as it is made. Folders are kept below the zipped folder, which is the zip's top folder, or below the deepest folder the picked files share; structure: flat puts every file at the top. Names are made safe to unzip anywhere and clashes, ignoring case, become name (2).ext. Images, video, audio, PDFs, Office files and archives are stored, the rest deflated, and zip64 is used past 4 GB. Only the app's own files can go in: other ids are 404 files_not_found unless allowMissing is true. A picked file the virus scan blocks answers with its refusal (403 file_infected, or with the app's holdDownloadsUntilScanned on 409 file_scan_pending, file_scan_failed or file_not_scanned), unless allowMissing is true, which leaves it out and counts it as missing. A folder zip leaves out infected files, and answers with the 409 while one of its files is held. There is no Content-Length. A storage failure after the zip started cuts the connection rather than finishing a zip with files missing.

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Request body

application/json
idsstring (uuid)[]
folderIdstring | nullEvery file in this folder, or null for every file in the app.
folderPathstringA folder by path, like /Products/Shoes. / is every file.
recursivebooleanWith a folder, include the files in its subfolders.
structure"folders" | "flat"Keep folders inside the zip, or put every file at the top.
filenamestringThe zip's name, .zip added if missing. No slashes.
allowMissingbooleanZip the files that were found instead of failing when some ids are not.

Responses

200The zip, as an attachment named after filename, the folder or files.zip.
application/zip
400validation_error, invalid_id, invalid_folder_path, too_many_files (more than 1,000), zip_too_large (more than 10 GB before compression) or nothing_to_zip (an empty folder).
application/json
401No key was sent.
application/json
403file_infected: a picked file was found to contain malware. Also the key refusals.
application/json
404files_not_found (some ids are not the app's files; the message lists them) or folder_not_found.
application/json
409Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).
application/json
429delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.
application/json
502storage_error: a file could not be read before the zip started.
application/json