documents/ are not publicly readable — preview and download always go through signed SquadVault URLs.
Flow
1. Request a presigned upload URL
fileKey ← key, fileUrl ← fileRef. The API overwrites fileUrl with a private storage reference.
sizeBytes must match the exact byte length of the file you PUT in step 2.
2. Upload the file
Content-Type and byte size you requested in step 1.
3. Create the document record
GET /documents/{documentId}/download or /preview — never use fileUrl as a public HTTP link.
Allowed content types
application/pdfapplication/mswordapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.ms-excelapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/plainimage/jpeg,image/png,image/webp,image/gif
JavaScript example
document:create.