mx_keys_upload: Upload device identity and one-time keys

View source: R/keys.R

mx_keys_uploadR Documentation

Upload device identity and one-time keys

Description

POST /_matrix/client/v3/keys/upload. The device_keys and one_time_keys arguments must be fully formed and signed per the Matrix specification; mx.api will not canonicalise or sign them. Use mx_canonical_json to produce the byte sequence to sign.

Usage

mx_keys_upload(
  session,
  device_keys = NULL,
  one_time_keys = NULL,
  fallback_keys = NULL
)

Arguments

session

An mx_session.

device_keys

Named list. The device_keys object as defined in the Matrix spec, including user_id, device_id, algorithms, keys, and the signatures block produced by the caller's signer. Pass NULL to upload only one-time keys.

one_time_keys

Named list or NULL. Map from "<algorithm>:<key_id>" (e.g. "signed_curve25519:AAAA") to the signed key object. Pass NULL or an empty list to skip.

fallback_keys

Named list or NULL. Same shape as one_time_keys; used to advertise a fallback key when the OTK pool is exhausted.

Value

The parsed homeserver response, including one_time_key_counts.

Examples

## Not run: 
mx_keys_upload(s, device_keys = signed_dk, one_time_keys = signed_otks)

## End(Not run)

mx.api documentation built on Sept. 12, 2026, 1:07 a.m.