Search code examples
xmppejabberd

Create a protected room via Admin API


Is it possible to create protected rooms via the admin API?

The create_room command from the docs only takes 3 parameters: Name, service and host.


Solution

  • Yes this is possible!

    POST /api/create_room_with_opts
    {
      "name": "room1",
      "service": "muc.example.com",
      "host": "localhost",
      "options": [
        {
          "name": "members_only",
          "value": "true"
        }
      ]
    }
    

    From here: https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#create-room-with-opts