When a Matrix room must be deleted, blocked or shut down
The Synapse rooms admin API blocks, purges or shuts down rooms, and during a shutdown it can move local members into a replacement room. Administrators reach for it when a whole room is the problem: a spam hub that keeps attracting accounts, a room used to distribute abusive material, or an obsolete room that should no longer exist on your server. It works at the room level, so it is a different tool from reviewing individual reported events and from suspending a single account. Start with the Synapse documentation and confirm the exact endpoints, request fields and admin token requirements for the Synapse release you run, because the API is called from the server host and changes between versions.
Choose the action by what you need to stop. Blocking prevents local users from joining the room, which is the fastest containment step when the room is still active and you need time to investigate. A shutdown removes local members from the room and can move them to a replacement room you name, which suits obsolete rooms and rooms that must be replaced by an official space. A purge removes the stored history of a room from your database and is the most destructive option. Remote members on other homeservers keep their copies of the room, so a shutdown on your server does not end the room across the federation. Decide in advance who approves a purge, and record the room ID, the reason and the replacement room before running anything.
Blocking, purging and shutdown options compared
This table compares blocking, purging history and shutting down a room with a replacement room by what each changes, who it affects, whether it can be undone and when it fits. Confirm parameters and defaults against the Synapse admin API documentation for your installed version before running any call. The main takeaway is that only blocking is reversible through the API, so purge and shutdown should follow a completed review.
| Option | What it changes and who is affected | Reversible | When it fits |
|---|---|---|---|
| Block room | Stops local users from joining the room. Blocking alone does not remove current members. | Yes, through the unblock call | Stopping new joins while a review is open |
| Purge history | Deletes older events for the room from the local database. Other servers keep their copies. | No | Trimming old content from a room you keep running |
| Shutdown with replacement room | Removes local members from the room and can create a new room and post a message. Remote members are not moved. | No | Retiring an abusive or obsolete room that local users must leave |
| Shutdown with purge option | Shutdown variant that also removes the room's data from the local database, per the purge option in your version. | No | Removing all local trace of a room after blocking and review |
| Parameters to confirm | Parameter names, defaults and whether purge is part of the shutdown call vary by release. | Not applicable | Before every call, on a test server first |
Run a safe room takedown on Synapse
This sequence removes an abusive or obsolete room from a Synapse homeserver in a controlled order, so local members are moved and every step leaves a record. It produces a block on the room, a preserved copy of its state, a replacement room for affected members, and a deletion status record for the ticket.
Confirm admin access and API token
Confirm that the account behind the API token is a server administrator and that the token is scoped to the host where Synapse runs. Make one read-only admin request and check that it returns the room list without an authorization error. Record the server name, the token owner and the date in the ticket. The step is done when the request succeeds and the ticket names the person accountable for the token.
Identify the room and its local members
Resolve the room ID from the alias or the reported event, then confirm it matches the room users reported. List the room's members and separate local users from remote users, since only local accounts can be moved by the server. Save the member list with the count of local and remote members. The step is done when the room ID and member counts are written in the ticket and checked by a second reviewer.
Export and record the room state
Before any destructive action, preserve the room's state and the events your policy requires you to keep, using the export method your team has tested on a staging server. Store the export in access-controlled storage with a checksum. Confirm the file opens and that its event count matches what the server reports. The step is done when the checksum and event count are recorded in the ticket.
Block the room from new joins
Apply the block through the rooms admin API so that local users cannot join the room while the takedown is prepared. Then use a test account on the same server to attempt a join. The block is confirmed when the API reports the room as blocked and the test join is refused. Record the timestamp of the block in the ticket, since it marks the point after which the room is closed to local users.
Choose and prepare the replacement room
Create or select a replacement room with the room settings your moderators approve, and invite the local members identified earlier. Ask members to join and confirm the joins through the member list. Where a member does not join, record the account and the reason in the ticket. The step is done when the replacement room ID and the list of members who joined are both recorded and reviewed before the shutdown starts.
Run the room shutdown request
Submit the shutdown request through the rooms admin API with the replacement room ID and the options your policy allows, such as whether to purge the room's history from the local database. Copy the deletion ID that the server returns. Check that the response contains that ID and that the room no longer appears in the room list once the request is accepted. The step is done when the deletion ID is stored in the ticket.
Check the deletion status endpoint
Query the deletion status endpoint with the stored deletion ID and repeat the check until the status shows the deletion has finished or failed. Review the reported counts of kicked members and any error messages. If the status shows a failure, do not close the ticket; record the error and rerun the check after the cause is fixed. The step is done when the final status and counts are copied into the ticket.
Close the ticket with limits noted
Write a closing note that lists the room ID, the block timestamp, the export checksum, the replacement room ID, the deletion ID and the final status. State that the deletion should be treated as irreversible on this server, and that copies of events already sent to other homeservers are outside its control. Ask a second reviewer to sign off. The step is done when the note is complete and the ticket is closed.
Security and operational risks of deleting rooms
Room deletion is hard to reverse and touches evidence, users and admin access at once. The four cards below name the most common failure points and the control that addresses each one.
Wrong room ID in the admin call
The rooms admin API acts on the room ID you pass, and a mistyped or copied ID can point at a busy business room instead of the abusive one. Before any block, purge or shutdown, confirm the room ID, its canonical alias and its member count against the change ticket. Treat a second reviewer check of the exact ID as a required step, and log the command output so the target is provable afterward.
Synapse docsAdmin endpoints reachable beyond trusted hosts
Synapse admin endpoints sit on the same listener as client traffic unless you restrict them. If they are reachable from the public internet or from general staff networks, anyone with a stolen admin token can delete rooms. Limit the admin API to a bastion or management network at the reverse proxy, and confirm that admin tokens belong only to named operators with rotation in place.
Configuration manualEvidence lost during purge
A purge removes the room's events from the server, which can destroy the material needed for an abuse review, a law enforcement request or an internal investigation. Before you purge, export the room state and reported events, and keep them under the same retention rules as your other investigation records. Take a backup before purge of the database rows you may need, and confirm with legal counsel how long that copy must be kept.
Local users with no destination
Blocking or shutting down a room leaves local members without a conversation, and they may miss notices or keep trying to post. Decide in advance which replacement room receives them, who creates it, and how the move is announced, then record that plan in the ticket. Check that the replacement room exists and has an admin before you remove the original, since members moved into an orphaned room create a second problem.
Audit trail review after deletion
Deletion is only defensible if you can show who ran it, when, against which room and with what result. Review the server's admin activity and your ticket together within a set period after each action, and compare the deleted room ID with the ticket. Store the review as a signed-off audit trail entry, and remember that a purge cannot be undone, so the review catches mistakes early rather than repairing them.
How the approach differs across Synapse, MAS and ESS
In a plain Synapse install, the homeserver handles authentication itself and the room admin endpoints are called with an access token belonging to a server admin account. Access is controlled by the server's own admin flag and by who can reach the admin API from the network. Confirm that the admin API is not exposed through the public reverse proxy, since the Synapse documentation recommends restricting admin and replication listeners and this is a common gap on single-node installs.
- Token ownership: Identify which admin account's token will run deletions, and confirm it is a dedicated account rather than a personal one.
- Listener exposure: Check that the reverse proxy does not forward admin paths to the public internet.
- Config and version: Record the Synapse version and the relevant settings in the configuration manual before the first call, since endpoint behavior can change between releases.
- Backups: Confirm a recent database backup exists, because purged room history cannot be recovered from the server alone.
- Logging: Confirm that the calls made with the admin token are logged somewhere your reviewers can read.
Before any takedown, confirm who holds the admin token, where the admin listener is reachable, and that a tested backup exists for the database.
When Matrix Authentication Service sits in front of Synapse, account administration moves out of Synapse. MAS handles login through upstream identity providers such as Keycloak, Microsoft Entra ID, Google or Authentik, and admin rights are tied to the identity that MAS manages rather than to a Synapse flag alone. Some Synapse endpoints used for user administration stop working once MAS takes over, so the room workflow must be checked against your actual version rather than assumed from older guides.
- Admin identity source: Confirm where the operator's admin rights are granted, in MAS or in the upstream provider, and who can change them.
- Synapse endpoints: Verify, on your version, which Synapse admin calls still respond and which were replaced by MAS equivalents.
- Separation of duties: Decide whether the person who approves a takedown is the same person who runs it, and record both identities.
- Upstream revocation: Check how quickly removing an operator in the identity provider removes their MAS admin session.
- Token scope: Confirm which token type the room calls accept after MAS is in place.
Before the first takedown, test one non-production room end to end and confirm which admin paths the environment actually accepts.
Element Server Suite runs Synapse Pro, MAS, LDAP and SCIM integration and auditing on Kubernetes using Helm charts. The admin API is not reached by logging into a host, so access depends on how the chart exposes services, which pods can reach the Synapse admin listener, and which credentials are mounted into your operator workflow. Treat the cluster's ingress rules, network policies and secret handling as part of the takedown control, not only as infrastructure detail.
- Service routing: Confirm how the admin listener is exposed through the chart and whether any ingress rule reaches it from outside the cluster.
- Network policy: Check which namespaces and jump hosts can open a connection to the admin service.
- Secret handling: Confirm where the admin token is stored, who can read it, and how it is rotated.
- Chart version: Record the ESS chart and image versions, and check the ESS documentation for any changes to admin access between releases.
- Audit trail: Confirm that Kubernetes audit logs and Synapse logs capture the calls made during a takedown.
Before use, confirm with your ESS support channel or documentation which admin service is exposed in your chart version and how operators are expected to reach it.
Limits of undoing a room deletion
Taking a room down is easy to start and harder to reverse. The cards below cover what a purge removes from your server, what other servers still hold, and how upgrade rules can narrow your recovery options. Check each point against your own backups and the documented Synapse version before you run anything.
Purged data stays gone locally
Purging a room removes its events and state from your own database, and the homeserver cannot rebuild that history from its own records. Treat a purge as final for local copies. Before you run it, confirm that a database backup taken before the purge exists, is restorable, and covers the time window you may need. Ask whether the backup predates any federation traffic that would have been lost.
Remote servers keep their copies
Other homeservers that joined the room still hold the events they received. Purging on your server does not delete those copies, and a remote server may re-send history when a local user rejoins or when federation catches up. Identify which remote servers were in the room, and decide whether you need to ask them to act or accept that their copies persist.
Unblocking is not restoring
Blocking a room stops local users from joining or interacting with it, and an unblock lifts that restriction. Blocking does not bring back history that was already purged. If the room was purged and then blocked, the only way to recover its content is from your own backup, so the block decision and the purge decision should be made and logged separately.
Rollback limits after upgrades
Synapse upgrade notes warn that rolling back can be difficult because database schema changes between releases. If a purge goes wrong and you also need to revert to an earlier Synapse version, the schema may not match. Read the upgrade notes for every version between your backup and your current release before you plan a rollback, and rehearse the restore on a copy.
Synapse upgrade notesConfirm restore steps in advance
Restore procedures depend on your database engine, your backup tooling, your Synapse version and the media store you use. Write the restore steps for each supported path, test them on a non-production copy, and record how long they took. Ask your team or partner to confirm the documented restore steps for your exact version, and to confirm whether media files are restored alongside the database.
Questions administrators ask before deleting a Matrix room
How long does deleting or blocking a Matrix room take?
The API call itself finishes in one request, but the surrounding work takes longer and depends on the room. Effort is driven by how many local users must be moved, how many rooms share the same problem, how much evidence you must preserve before purging, and how many approvals your change process requires. A single obsolete room with few members is a short task. A coordinated takedown across many rooms, with a replacement room, user notices and a review of abuse reports, takes more planning. Ask any partner for a written estimate that lists each of these steps separately, since no duration figure is supplied for this work.
Can our own team delete Matrix rooms without outside help?
Yes, if you run a Synapse homeserver and have an account with server admin rights. The rooms admin API is part of Synapse, so your administrators can block, purge and move members with the documented endpoints. Outside help is most useful when the takedown needs a written procedure, a test on a staging copy, or a review of the policy decisions behind it. DeployOpen plans, implements and documents this kind of work inside your infrastructure on a fixed scope agreed in writing, and it can also train your team to run the procedure. Confirm your team's skills with the Synapse admin API before choosing an approach.
What do we need to provide before a room takedown?
You need admin access to the homeserver host and the Synapse admin API, a current database backup, and a named owner who signs off on the decision. Change control matters because purging events is hard to reverse. Agree on the room IDs, the reason for the action, the replacement room if members must move, and the message that will go to affected users. Keep records of the abuse reports or policy basis that led to the decision. Ask your partner which of these items they expect from you and which they will prepare.
Does deleting a room remove it from other federated servers?
Not necessarily. Deleting or purging a room on your homeserver removes the local copy and affects your local users, but other homeservers that joined the room keep their own copies of the events they received. Federation does not give your server authority to erase data held elsewhere. Blocking a room prevents your local users from joining or using it, which is often the first step. If the content must disappear everywhere, you also need to coordinate with the other server operators and check your data protection obligations. Confirm this behavior against the Synapse federation documentation for your version.
Can we restore a room after we purge it?
Usually not. A purge removes room data from your database, so restoring it generally requires a backup taken before the action. Blocking is easier to reverse because it stops local access without deleting history, but the room's state and any users who left in the meantime need checking. Before you act, record the room ID, membership list and any aliases, and confirm your backup and restore procedure with a test. Synapse's upgrade notes also warn that rolling back can be difficult because of schema changes between releases, so plan restores against the version you run.
What is the risk of moving users to a replacement room?
The main risk is losing track of who moved and what they can see. Moving members to a replacement room must not expose content from the closed room, and users who return to old bookmarks or aliases may create confusion. Check room permissions, aliases and the join rules of the new room, and decide how to handle encrypted rooms and the keys users hold. Send a clear notice explaining the change, and track which accounts completed the move. Ask your partner to show a tested example on a staging server before you apply the procedure to production rooms.
How do we track whether a deletion has finished?
Synapse's rooms admin API runs deletion as a background task and returns an identifier you can query for status. Record that identifier, check the task until it reports completion, and confirm the result in your logs and database. Keep the outcome in your change record so auditors and internal reviewers can see what was done and when. Confirm the exact endpoints and status fields in the Synapse documentation for your version before writing a runbook.
Decision path for a room takedown
The path starts with a report or a policy decision and asks first whether the room should be blocked from new joins, purged from the local server, or shut down with local users moved to a replacement room. Each branch hands off to the rooms admin API, after which the team records the deletion status and checks that the room, its local members and any reported events are in the expected state. Confirm the exact endpoints and behavior against the Synapse documentation for your version before running any step on production.
Decision branches from a report to block, shutdown or purge, then verification.
How DeployOpen scopes room takedown work
DeployOpen plans room takedown work on a self-hosted Matrix homeserver as a written, fixed-scope engagement inside your own infrastructure. The work starts with the rooms, the evidence and the policy decisions, then moves to a tested procedure your administrators can repeat and audit.
How we scope
- Inventory the rooms in question, their local members, aliases, published directory entries and any linked bridges or bots.
- Agree in writing which actions apply: blocking, purging, moving local users, or a combination for each room.
- Record who approves a takedown, what evidence is kept, and how the decision is communicated to affected users.
- Confirm the Synapse version and deployment model so the scope matches the admin API endpoints actually available.
How we build
- Write and test the takedown runbook on a staging copy of your homeserver before any production room is touched.
- Script the admin API calls with dry-run checks, status tracking and logging so each step can be reviewed afterward.
- Verify the outcome by confirming blocked room state, user membership changes and directory removal, with the limits of undo documented.
- Set file-level and database backup steps before the first deletion, with restore steps tested where the environment allows.
How we hand over
- Deliver the runbook, scripts, approval template and evidence checklist in the client's own repository and documentation.
- Walk the administrators through a live takedown rehearsal and the review of deletion status and purge results.
- Document the known limits, including what cannot be recalled, what remote servers may still hold, and what to confirm with your upgrade path.
- Provide a handover list of open questions for your legal, privacy and security teams to decide.
How we support
- Offer ongoing support, upgrades and continuous testing of the takedown procedure as a retainer where the organization wants it.
- Re-test the runbook after Synapse upgrades, since admin endpoints and deletion behavior can change between releases.
- Review new abuse cases against the written procedure and update scripts when policy or tooling changes.
- Ask for a quote built from the written scope, which sets the cost of each stage and any retainer terms.

