Skip to main content

Managing a Room: Advanced Room Management

Disclaimer: This guide refers to using the Element Matrix clients, Element Web or Element Desktop apps

Transferring Ownership of a Room

There are several scenarios where you might wish to transfer ownership of a room; perhaps you no longer wish to maintain the room yourself; have accidentally removed your, or possibly all privileged users' permissions from a room; or wish to take over an abandoned room.

How do I transfer ownership of a room? / How do I restore lost privileges to a room?

If you do not have permissions yourself, contact a current Admin for the room and get them to follow these steps to promote you.

Admins cannot remove admin permissions from other users, only themselves. Make sure any user prompted to Admin is correct before making changes.

  1. Open the room, click i / Room Info from the top-right
  2. Open Room Settings, click to Roles & Permissions
  3. Add a new privileged user, setting their power level to Admin
  4. Under privileged users, find your username, change your power level from Admin to the desired level

How do I take over an abandoned room? / How do I restore lost privileges to a room without an Admin?

For the following you will need Admin access to the homeserver. If you do not manage the homeserver for your room, you will need to contact the support for that homeserver.

When a user is no longer active on your homeserver, or they have been deactivated, you may find some rooms where there are no remaining active Room Admins preventing administration of those rooms. This guide will make extensive use of the Admin API, see our Getting Started Using the Admin API guide for more information.information, and if required, will also use the Client-Server API, which has an equivalent Getting Started Using the Client-Server API guide.

If there is a non-deactivated but no longer active Room Admin user still present within the room, you can make use of the Admin API Make Room Admin API to grant the Admin role to another user:

POST https://HOMESERVER_URL/_synapse/admin/v1/rooms/ROOM_ID/make_room_admin
{
    "user_id": "@user:example.com"
}

However that leaves a problem if there are no longer any admins still within the room. Fortunately, whether they are within the room or not, users retain their power levels unless they demote themselves prior to leaving.

So for rooms where you are unsure who holds Room Admin (I.E Power level 100), you can use the Admin API Room State API:

You can find the `ROOM_ID` from Room Settings Advanced

GET https://HOMESERVER_URL/_synapse/admin/v1/rooms/ROOM_ID/state

This will return a list of states, find the state where "type": "m.room.power_levels", from within that states' "content": { "users": {} } you will find a list of users followed by their power level, the Room Admins of the room will have a power level of 100.

If the listed Room Admins have been deactivated, you will first reactivate one of them. To reactivate a deactivated user, you can use an Admin Console if you have access to one to perform this operation for you, or you can use the Admin API Create Or Modify Account API:

`USER_ID` should look something like `@user:example.com`, otherwise known as the full Matrix ID

PUT https://HOMESERVER_URL/_synapse/admin/v2/users/USER_ID

{
    "password": "NEW_PASSWORD",
    "deactivated": false
}

At this point you should have an active account with Room Admin available that can be used to regain access to management of the room. If you've reactivated a deactivated user, you will have had to set a new password for the account, you could at this point login as the user using a Matrix client. You would then be able to rejoin any required rooms, promoting new users to the Admin role before deactivating the account.

Alternatively you can generate an access token for an account using the Admin API Login as a user API.

POST https://HOMESERVER_URL/_synapse/admin/v1/users/USER_ID/login
{}
{
    "access_token": "<opaque_access_token_string>"
}

The users' access token can be used by the Client-Server API to perform actions, such as joining rooms and changing room permissions.

To join a room you will use the Client-Server API Join API

POST https://HOMESERVER_URL/_matrix/client/v3/join/ROOM_ID
{}

Finally, you can set the power levels for users within a room using the Client-Server API Events API:

PUT https://HOMESERVER_URL/_matrix/client/v3/rooms/ROOM_ID/state/m.room.power_levels
{
    "users": {
        "@user:example.com": 100
    }
}

Removing a Room

There is no way to unilaterally delete a room unless you own the homeserver is it on, however a room will no longer be able to be joined once all members of the room have left. As an admin it is possible to remove people from the room via the Room Info panel see the section above, once no other members remain, leaving the room will offer a final prompt to confirm the action.

Tombstoning a Room

An alternative to everyone leaving a room, and a new one being created is to Tombstone it. This acts like closing a room and pointing it to a replacement. You can find the steps for this on our FAQ Page.

Deleting a Room

If you manage a homeserver you can delete a room from it, you can find the steps for doing this if you're an EMS customer on our FAQ Page. Rooms across multiple homeservers will only be deleted from your homeserver.