Binary routes#
Use PUT /api/channels/{channel}/files/{id} with application/octet-stream, a UUID object ID and encrypted bytes. The object format is nonce (12 bytes), ciphertext, then GCM tag (16 bytes). The per-file maximum includes this overhead on the wire; configured fileLimit describes the original file size. GET retrieves the encrypted object. Before message commit, only the owner can access a pending object. After commit, authorized channel participants can download it. DELETE removes an owner's pending upload; a committed attachment cannot be deleted through that route.
Commit and quota#
Reference uploaded IDs in attachmentIds when publishing the encrypted message. The server validates ownership, pending state and duplicates, then commits references with the message. Identical repeated object uploads are checked for idempotency. Pending uploads count against quota and abandoned ones are cleaned after 24 hours.
Client authentication#
Per-file descriptors carry ID, name, MIME, original size and Base64 key inside the encrypted message. File AAD is compact JSON ["sintonia-file-v1", channelId, fileId, ownerId]. Validate size and AES-GCM authentication before opening. Federation uses the storage/authorization of the destination channel.