multipart/form-data. The server streams parts through the encryption pipeline as they arrive; it does not buffer the whole file in memory.
Endpoint
Request
Multiple files
You can send up to 10 file parts in one request:Response
A successful upload returns200 with:
The
warning object, when present, has this shape:
Prerequisites
Active encryption keys
Active encryption keys
The owning user context must have active HPKE keys containing an X25519 public key and an ML-KEM public key. Without them the upload fails with
400 before storage. Generate keys in the app, then retry.Active billing
Active billing
Upload is a write operation. Lapsed subscriptions are refused. Trial accounts can upload within trial limits.
Bucket scope and capacity
Bucket scope and capacity
The key must have
buckets:write and files:write, and must be allowed to target the bucket. The file must fit the remaining storage capacity and the plan’s per-file limit.Folder ownership
Folder ownership
If a folder is specified, it must exist and belong to the same bucket. Cross-bucket folder mismatches are rejected.
Versioning behavior
If a file with the same name and extension already exists in the same folder scope, the upload can become a new version of that file. The response then hasisUpdate: true.
Do not infer version creation from the filename alone. Persist the returned fileId and versionId.
Error behavior during streaming
Validation can happen while the body is still arriving. A rejection may occur after your client has sent megabytes. Handle:- a non-2xx response even after the request body started,
- connection reset when the server drains the body to deliver the error,
413for trial file-size violations,402for insufficient storage or billing,400for missing files, multipart errors, missing encryption keys, or validation failures.
fileId.
Safe file processing
The API stores the bytes you send. It does not decide whether the content is safe for your application. Recommended controls:- Enforce an allowlist of extensions and MIME types in your application.
- Verify the declared size before starting a large upload.
- Scan untrusted files after upload, before exposing them to other users.
- Store the returned
fileId, not the user-supplied filename, as the authoritative reference. - Sanitize filenames for display; do not use them as filesystem paths.
- If you need integrity verification, compute a hash on your side and compare after download.
JavaScript example
TypeScript example with timeout
Python example
PHP example
Laravel example
Go example
These are examples, not official SDKs. They omit retries, structured error decoding, and secret management for brevity.