End-to-End Encryption API
Key Upload
Upload device keys and one-time keys (OTK):
Response:
Key Query
Returns device keys for the specified users/devices.
Key Claim
Claims one-time keys for Olm session establishment.
Key Changes
Returns a list of users whose device keys have changed since the given token.
Cross-Signing Keys
Upload Master Key
Upload cross-signing keys (master, self-signing, user-signing):
Device Management
List Devices
Get Device
Update Device
Delete Devices
To-Device Messages
To-device messages are delivered via /sync in the to_device section. Each message must include an event_id field for E2EE clients like Cinny to process room key exchanges correctly.
Device Key Visibility
When a user joins, leaves, or is banned from a room, RoomEventService.upsertMembership() triggers device_lists.changed / device_lists.left notifications in the /sync response. This allows clients to track which devices need encryption key updates.