# 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](https://ems-docs.element.io/books/element-support/page/getting-started-using-the-admin-api) guide for more information, and if required, will also use the Client-Server API, which has an equivalent [Getting Started Using the Client-Server API](https://ems-docs.element.io/books/element-support/page/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](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#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](https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#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](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#create-or-modify-account):`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](https://ems-docs.element.io/books/element-support/page/deactivating-a-matrix-account). Alternatively you can generate an access token for an account using the Admin API [Login as a user API](https://matrix-org.github.io/synapse/latest/admin_api/user_admin_api.html#login-as-a-user). ``` POST https://HOMESERVER_URL/_synapse/admin/v1/users/USER_ID/login {} ``` ``` { "access_token": "