mx_room_create: Create a room

View source: R/rooms.R

mx_room_createR Documentation

Create a room

Description

Create a room

Usage

mx_room_create(
  session,
  name = NULL,
  topic = NULL,
  visibility = "private",
  preset = NULL,
  invite = character(),
  creation_content = NULL
)

Arguments

session

An "mx_session" object.

name

Character or NULL. Human-readable room name.

topic

Character or NULL. Room topic.

visibility

Character. "private" (default) or "public".

preset

Character or NULL. A Matrix room preset ("private_chat", "trusted_private_chat", "public_chat").

invite

Character vector. Matrix IDs to invite.

creation_content

Named list or NULL. Merged into the m.room.create event content. This is the only way to set properties that are fixed at creation and immutable afterwards – notably type = "m.space", which makes the room a space rather than a conversation. A space cannot be converted from an ordinary room later, so it has to be requested here or not at all.

Value

The new room ID as a character string.

Examples

## Not run: 
room_id <- mx_room_create(s, name = "test", topic = "hello")

# A space, which holds other rooms instead of messages
space_id <- mx_room_create(s, name = "Topics",
                           creation_content = list(type = "m.space"))

## End(Not run)

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