How encryption works
Every file is encrypted with its own per-file key, which is in turn wrapped by the user’s record key. Nothing is written to storage in the clear, and a file can only be decrypted through the vault. Because the file key is chained to the user’s record key, file storage inherits two properties of the PII vault:- Crypto-shredding on erasure — deleting the user destroys the record key, which renders all of that user’s files permanently unrecoverable. This is the mechanism behind GDPR “right to erasure” for attached documents.
- Shared key management — the same key rotation, Shamir’s secret sharing, multi-tenancy, and access control apply to files as to any other record.
The storage backend only ever holds ciphertext — the keys live in the vault, not with the objects.
API operations
Every call identifies the owning user with a
mode (login, token, email, phone, or custom) and the matching identity.
Store a file
File content is supplied as a base64-encodedfiledata field. The MIME type is auto-detected when mimetype is omitted.
"duplicate": true.
Retrieve a file
Select a file byfileuuid (preferred) or by filename — when selecting by name, the most recently created file with that name is returned. By default the content comes back as a base64-encoded filedata field:
"raw": true to receive the decrypted bytes with the appropriate Content-Type and Content-Disposition headers instead of a JSON envelope.
List a user’s files
FileListUserFiles returns metadata only — never file content:
Delete a file
FileDelete removes both the stored object and its metadata:
Retention and expiration
Files support the same expiration model as tokens. Setslidingtime for a relative retention window (e.g. 30d, 1y) or finaltime for an absolute cutoff (e.g. 90d, 2026-01-01). This lets you enforce document retention policies automatically instead of tracking expiry in your own application.
Next steps
- PII vault — the user record a file is attached to
- Access control — who may upload, list, and download
- Backup and recovery — files are covered by the same key model