Create a new room
Create a new room with various configuration options.
The server MUST apply the normal state resolution rules when creating the new room, including checking power levels for each event. It MUST apply the events implied by the request in the following order:
-
The m.room.create event itself. Must be the first event in the room.
-
An m.room.member event for the creator to join the room. This is needed so the remaining events can be sent.
-
A default m.room.power_levels event. Overridden by the power_level_content_override parameter.
In room versions 1 through 11, the room creator (and not other members) will be given permission to send state events.
In room versions 12 and later, the room creator is given infinite power level and cannot be specified in the users field of m.room.power_levels, so is not listed explicitly.
Note: For trusted_private_chat, the users specified in the invite parameter SHOULD also be appended to additional_creators by the server, per the creation_content parameter.
If the room's version is 12 or higher, the power level for sending m.room.tombstone events MUST explicitly be higher than state_default. For example, set to 150 instead of 100.
-
An m.room.canonical_alias event if room_alias_name is given.
-
Events set by the preset. Currently these are the m.room.join_rules, m.room.history_visibility, and m.room.guest_access state events.
-
Events listed in initial_state, in the order that they are listed.
-
Events implied by name and topic (m.room.name and m.room.topic state events).
-
Invite events implied by invite and invite_3pid (m.room.member with membership: invite and m.room.third_party_invite).
The available presets do the following with respect to room state:
| Preset | join_rules | history_visibility | guest_access | Other |
|---|---|---|---|---|
| private_chat | invite | shared | can_join | |
| trusted_private_chat | invite | shared | can_join | All invitees are given the same power level as the room creator. |
| public_chat | public | shared | forbidden |
The server will create a m.room.create event in the room with the requesting user as the creator, alongside other keys provided in the creation_content or implied by behaviour of creation_content.
Request
- Base URLhttps://matrix.org
- Auth
- API key in query parameter access_token
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"creation_content": {
"m.federate": false
},
"name": "The Grand Duke Pub",
"preset": "public_chat",
"room_alias_name": "thepub",
"topic": "All about happy hour"
}Response
Information about the newly created room.
Changes
No recorded changes to this operation across all 1 revision of this API.