End-to-end encryption

Store a key in the backup.

Store a key in the backup.

put/_matrix/client/v3/room_keys/keys/{roomId}/{sessionId}

Request

Path parameters

roomIdstring required

The ID of the room that the key is for.

sessionIdstring required

The ID of the megolm session that the key is for.

Query parameters

versionstring required

The backup in which to store the key. Must be the current backup.

Request body

first_message_indexinteger required

The index of the first message in the session that the key can decrypt.

forwarded_countinteger required

The number of times this key has been forwarded via key-sharing between devices.

is_verifiedboolean required

Whether the device backing up the key verified the device that the key is from.

session_dataobject required

Algorithm-dependent data. See the documentation for the backup algorithms in Server-side key backups for more information on the expected format of the data.

Example request

{
  "first_message_index": 1,
  "session_data": {
    "ciphertext": "base64+ciphertext+of+JSON+data",
    "ephemeral": "base64+ephemeral+key",
    "mac": "base64+mac+of+ciphertext"
  }
}

Response

The update succeeded.

countinteger required

The number of keys stored in the backup

etagstring required

The new etag value representing stored keys in the backup.

See GET /room_keys/version/{version} for more details.

Example response

{
  "count": 10,
  "etag": "abcdefg"
}

Changes

No recorded changes to this operation across all 1 revision of this API.