mx_send_to_device: Send a to-device event

View source: R/keys.R

mx_send_to_deviceR Documentation

Send a to-device event

Description

PUT /_matrix/client/v3/sendToDevice/{eventType}/{txnId}. Used to ship encrypted Olm payloads (e.g. m.room_key carriers wrapped as m.room.encrypted) to specific (user_id, device_id) targets.

Usage

mx_send_to_device(session, event_type, messages, txn_id = NULL)

Arguments

session

An mx_session.

event_type

Character. The to-device event type, e.g. "m.room.encrypted".

messages

Named list. Outer names are user ids; values are named lists mapping device id (or the wildcard "*") to the event content.

txn_id

Character or NULL. Idempotency key; auto-generated when NULL.

Value

Invisible NULL (the server returns an empty body on success).

Examples

## Not run: 
mx_send_to_device(s, "m.room.encrypted", list(
  "@bob:example.org" = list(BBBB = encrypted_content)
))

## End(Not run)

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