curl -sS -X POST 'https://matrix.example.com/_matrix/client/v3/createRoom' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"name":"Dev Chat","preset":"private_chat"}'

Category: Matrix & Synapse

curl -sS -X POST 'https://matrix.example.com/_matrix/client/v3/createRoom' -H "Authorization: Bearer $ACCESS_TOKEN" -d '{"name":"Dev Chat","preset":"private_chat"}'

Create a room via the client API

Creates a room named Dev Chat as the logged-in user and returns its room ID, the unique identifier starting with !. The preset private_chat makes it invite-only, while public_chat makes it discoverable in the room directory. Add invite or room_alias_name fields to pre-configure it. Room creation via the API mirrors what clients do when you click Create Room.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.