rooms.html 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157
  1. <!DOCTYPE HTML>
  2. <html lang="en" class="sidebar-visible no-js light">
  3. <head>
  4. <!-- Book generated using mdBook -->
  5. <meta charset="UTF-8">
  6. <title>Rooms - Synapse</title>
  7. <!-- Custom HTML head -->
  8. <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  9. <meta name="description" content="">
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <meta name="theme-color" content="#ffffff" />
  12. <link rel="icon" href="../favicon.svg">
  13. <link rel="shortcut icon" href="../favicon.png">
  14. <link rel="stylesheet" href="../css/variables.css">
  15. <link rel="stylesheet" href="../css/general.css">
  16. <link rel="stylesheet" href="../css/chrome.css">
  17. <link rel="stylesheet" href="../css/print.css" media="print">
  18. <!-- Fonts -->
  19. <link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
  20. <link rel="stylesheet" href="../fonts/fonts.css">
  21. <!-- Highlight.js Stylesheets -->
  22. <link rel="stylesheet" href="../highlight.css">
  23. <link rel="stylesheet" href="../tomorrow-night.css">
  24. <link rel="stylesheet" href="../ayu-highlight.css">
  25. <!-- Custom theme stylesheets -->
  26. <link rel="stylesheet" href="../docs/website_files/table-of-contents.css">
  27. <link rel="stylesheet" href="../docs/website_files/remove-nav-buttons.css">
  28. <link rel="stylesheet" href="../docs/website_files/indent-section-headers.css">
  29. <link rel="stylesheet" href="../docs/website_files/version-picker.css">
  30. </head>
  31. <body>
  32. <!-- Provide site root to javascript -->
  33. <script type="text/javascript">
  34. var path_to_root = "../";
  35. var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
  36. </script>
  37. <!-- Work around some values being stored in localStorage wrapped in quotes -->
  38. <script type="text/javascript">
  39. try {
  40. var theme = localStorage.getItem('mdbook-theme');
  41. var sidebar = localStorage.getItem('mdbook-sidebar');
  42. if (theme.startsWith('"') && theme.endsWith('"')) {
  43. localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
  44. }
  45. if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
  46. localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
  47. }
  48. } catch (e) { }
  49. </script>
  50. <!-- Set the theme before any content is loaded, prevents flash -->
  51. <script type="text/javascript">
  52. var theme;
  53. try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
  54. if (theme === null || theme === undefined) { theme = default_theme; }
  55. var html = document.querySelector('html');
  56. html.classList.remove('no-js')
  57. html.classList.remove('light')
  58. html.classList.add(theme);
  59. html.classList.add('js');
  60. </script>
  61. <!-- Hide / unhide sidebar before it is displayed -->
  62. <script type="text/javascript">
  63. var html = document.querySelector('html');
  64. var sidebar = 'hidden';
  65. if (document.body.clientWidth >= 1080) {
  66. try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
  67. sidebar = sidebar || 'visible';
  68. }
  69. html.classList.remove('sidebar-visible');
  70. html.classList.add("sidebar-" + sidebar);
  71. </script>
  72. <nav id="sidebar" class="sidebar" aria-label="Table of contents">
  73. <div class="sidebar-scrollbox">
  74. <ol class="chapter"><li class="chapter-item expanded affix "><li class="part-title">Introduction</li><li class="chapter-item expanded "><a href="../welcome_and_overview.html">Welcome and Overview</a></li><li class="chapter-item expanded affix "><li class="part-title">Setup</li><li class="chapter-item expanded "><a href="../setup/installation.html">Installation</a></li><li class="chapter-item expanded "><a href="../postgres.html">Using Postgres</a></li><li class="chapter-item expanded "><a href="../reverse_proxy.html">Configuring a Reverse Proxy</a></li><li class="chapter-item expanded "><a href="../setup/forward_proxy.html">Configuring a Forward/Outbound Proxy</a></li><li class="chapter-item expanded "><a href="../turn-howto.html">Configuring a Turn Server</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../setup/turn/coturn.html">coturn TURN server</a></li><li class="chapter-item expanded "><a href="../setup/turn/eturnal.html">eturnal TURN server</a></li></ol></li><li class="chapter-item expanded "><a href="../delegate.html">Delegation</a></li><li class="chapter-item expanded affix "><li class="part-title">Upgrading</li><li class="chapter-item expanded "><a href="../upgrade.html">Upgrading between Synapse Versions</a></li><li class="chapter-item expanded affix "><li class="part-title">Usage</li><li class="chapter-item expanded "><a href="../federate.html">Federation</a></li><li class="chapter-item expanded "><a href="../usage/configuration/index.html">Configuration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../usage/configuration/config_documentation.html">Configuration Manual</a></li><li class="chapter-item expanded "><a href="../usage/configuration/homeserver_sample_config.html">Homeserver Sample Config File</a></li><li class="chapter-item expanded "><a href="../usage/configuration/logging_sample_config.html">Logging Sample Config File</a></li><li class="chapter-item expanded "><a href="../structured_logging.html">Structured Logging</a></li><li class="chapter-item expanded "><a href="../templates.html">Templates</a></li><li class="chapter-item expanded "><a href="../usage/configuration/user_authentication/index.html">User Authentication</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../usage/configuration/user_authentication/single_sign_on/index.html">Single-Sign On</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../openid.html">OpenID Connect</a></li><li class="chapter-item expanded "><a href="../usage/configuration/user_authentication/single_sign_on/saml.html">SAML</a></li><li class="chapter-item expanded "><a href="../usage/configuration/user_authentication/single_sign_on/cas.html">CAS</a></li><li class="chapter-item expanded "><a href="../sso_mapping_providers.html">SSO Mapping Providers</a></li></ol></li><li class="chapter-item expanded "><a href="../password_auth_providers.html">Password Auth Providers</a></li><li class="chapter-item expanded "><a href="../jwt.html">JSON Web Tokens</a></li><li class="chapter-item expanded "><a href="../usage/configuration/user_authentication/refresh_tokens.html">Refresh Tokens</a></li></ol></li><li class="chapter-item expanded "><a href="../CAPTCHA_SETUP.html">Registration Captcha</a></li><li class="chapter-item expanded "><a href="../application_services.html">Application Services</a></li><li class="chapter-item expanded "><a href="../server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="../consent_tracking.html">Consent Tracking</a></li><li class="chapter-item expanded "><a href="../user_directory.html">User Directory</a></li><li class="chapter-item expanded "><a href="../message_retention_policies.html">Message Retention Policies</a></li><li class="chapter-item expanded "><a href="../modules/index.html">Pluggable Modules</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../modules/writing_a_module.html">Writing a module</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../modules/spam_checker_callbacks.html">Spam checker callbacks</a></li><li class="chapter-item expanded "><a href="../modules/third_party_rules_callbacks.html">Third-party rules callbacks</a></li><li class="chapter-item expanded "><a href="../modules/presence_router_callbacks.html">Presence router callbacks</a></li><li class="chapter-item expanded "><a href="../modules/account_validity_callbacks.html">Account validity callbacks</a></li><li class="chapter-item expanded "><a href="../modules/password_auth_provider_callbacks.html">Password auth provider callbacks</a></li><li class="chapter-item expanded "><a href="../modules/background_update_controller_callbacks.html">Background update controller callbacks</a></li><li class="chapter-item expanded "><a href="../modules/account_data_callbacks.html">Account data callbacks</a></li><li class="chapter-item expanded "><a href="../modules/porting_legacy_module.html">Porting a legacy module to the new interface</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../workers.html">Workers</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../synctl_workers.html">Using synctl with Workers</a></li><li class="chapter-item expanded "><a href="../systemd-with-workers/index.html">Systemd</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../usage/administration/index.html">Administration</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../usage/administration/admin_api/index.html">Admin API</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../admin_api/account_validity.html">Account Validity</a></li><li class="chapter-item expanded "><a href="../usage/administration/admin_api/background_updates.html">Background Updates</a></li><li class="chapter-item expanded "><a href="../admin_api/event_reports.html">Event Reports</a></li><li class="chapter-item expanded "><a href="../admin_api/media_admin_api.html">Media</a></li><li class="chapter-item expanded "><a href="../admin_api/purge_history_api.html">Purge History</a></li><li class="chapter-item expanded "><a href="../admin_api/register_api.html">Register Users</a></li><li class="chapter-item expanded "><a href="../usage/administration/admin_api/registration_tokens.html">Registration Tokens</a></li><li class="chapter-item expanded "><a href="../admin_api/room_membership.html">Manipulate Room Membership</a></li><li class="chapter-item expanded "><a href="../admin_api/rooms.html" class="active">Rooms</a></li><li class="chapter-item expanded "><a href="../admin_api/server_notices.html">Server Notices</a></li><li class="chapter-item expanded "><a href="../admin_api/statistics.html">Statistics</a></li><li class="chapter-item expanded "><a href="../admin_api/user_admin_api.html">Users</a></li><li class="chapter-item expanded "><a href="../admin_api/version_api.html">Server Version</a></li><li class="chapter-item expanded "><a href="../usage/administration/admin_api/federation.html">Federation</a></li></ol></li><li class="chapter-item expanded "><a href="../manhole.html">Manhole</a></li><li class="chapter-item expanded "><a href="../metrics-howto.html">Monitoring</a></li><li><ol class="section"><li class="chapter-item expanded "><a href="../usage/administration/monitoring/reporting_homeserver_usage_statistics.html">Reporting Homeserver Usage Statistics</a></li></ol></li><li class="chapter-item expanded "><a href="../usage/administration/monthly_active_users.html">Monthly Active Users</a></li><li class="chapter-item expanded "><a href="../usage/administration/understanding_synapse_through_grafana_graphs.html">Understanding Synapse Through Grafana Graphs</a></li><li class="chapter-item expanded "><a href="../usage/administration/useful_sql_for_admins.html">Useful SQL for Admins</a></li><li class="chapter-item expanded "><a href="../usage/administration/database_maintenance_tools.html">Database Maintenance Tools</a></li><li class="chapter-item expanded "><a href="../usage/administration/state_groups.html">State Groups</a></li><li class="chapter-item expanded "><a href="../usage/administration/request_log.html">Request log format</a></li><li class="chapter-item expanded "><a href="../usage/administration/admin_faq.html">Admin FAQ</a></li><li class="chapter-item expanded "><div>Scripts</div></li></ol></li><li class="chapter-item expanded "><li class="part-title">Development</li><li class="chapter-item expanded "><a href="../development/contributing_guide.html">Contributing Guide</a></li><li class="chapter-item expanded "><a href="../code_style.html">Code Style</a></li><li class="chapter-item expanded "><a href="../development/reviews.html">Reviewing Code</a></li><li class="chapter-item expanded "><a href="../development/releases.html">Release Cycle</a></li><li class="chapter-item expanded "><a href="../development/git.html">Git Usage</a></li><li class="chapter-item expanded "><div>Testing</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="../development/demo.html">Demo scripts</a></li></ol></li><li class="chapter-item expanded "><a href="../opentracing.html">OpenTracing</a></li><li class="chapter-item expanded "><a href="../development/database_schema.html">Database Schemas</a></li><li class="chapter-item expanded "><a href="../development/experimental_features.html">Experimental features</a></li><li class="chapter-item expanded "><a href="../development/dependencies.html">Dependency management</a></li><li class="chapter-item expanded "><div>Synapse Architecture</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="../development/synapse_architecture/cancellation.html">Cancellation</a></li><li class="chapter-item expanded "><a href="../log_contexts.html">Log Contexts</a></li><li class="chapter-item expanded "><a href="../replication.html">Replication</a></li><li class="chapter-item expanded "><a href="../tcp_replication.html">TCP Replication</a></li></ol></li><li class="chapter-item expanded "><a href="../development/internal_documentation/index.html">Internal Documentation</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Single Sign-On</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="../development/saml.html">SAML</a></li><li class="chapter-item expanded "><a href="../development/cas.html">CAS</a></li></ol></li><li class="chapter-item expanded "><a href="../development/room-dag-concepts.html">Room DAG concepts</a></li><li class="chapter-item expanded "><div>State Resolution</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="../auth_chain_difference_algorithm.html">The Auth Chain Difference Algorithm</a></li></ol></li><li class="chapter-item expanded "><a href="../media_repository.html">Media Repository</a></li><li class="chapter-item expanded "><a href="../room_and_user_statistics.html">Room and User Statistics</a></li></ol></li><li class="chapter-item expanded "><div>Scripts</div></li><li class="chapter-item expanded affix "><li class="part-title">Other</li><li class="chapter-item expanded "><a href="../deprecation_policy.html">Dependency Deprecation Policy</a></li><li class="chapter-item expanded "><a href="../other/running_synapse_on_single_board_computers.html">Running Synapse on a Single-Board Computer</a></li></ol>
  75. </div>
  76. <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
  77. </nav>
  78. <div id="page-wrapper" class="page-wrapper">
  79. <div class="page">
  80. <div id="menu-bar-hover-placeholder"></div>
  81. <div id="menu-bar" class="menu-bar sticky bordered">
  82. <div class="left-buttons">
  83. <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
  84. <i class="fa fa-bars"></i>
  85. </button>
  86. <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
  87. <i class="fa fa-paint-brush"></i>
  88. </button>
  89. <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
  90. <li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
  91. <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
  92. <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
  93. <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
  94. <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
  95. </ul>
  96. <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
  97. <i class="fa fa-search"></i>
  98. </button>
  99. <div class="version-picker">
  100. <div class="dropdown">
  101. <div class="select">
  102. <span></span>
  103. <i class="fa fa-chevron-down"></i>
  104. </div>
  105. <input type="hidden" name="version">
  106. <ul class="dropdown-menu">
  107. <!-- Versions will be added dynamically in version-picker.js -->
  108. </ul>
  109. </div>
  110. </div>
  111. </div>
  112. <h1 class="menu-title">Synapse</h1>
  113. <div class="right-buttons">
  114. <a href="../print.html" title="Print this book" aria-label="Print this book">
  115. <i id="print-button" class="fa fa-print"></i>
  116. </a>
  117. <a href="https://github.com/matrix-org/synapse" title="Git repository" aria-label="Git repository">
  118. <i id="git-repository-button" class="fa fa-github"></i>
  119. </a>
  120. <a href="https://github.com/matrix-org/synapse/edit/develop/docs/admin_api/rooms.md" title="Suggest an edit" aria-label="Suggest an edit">
  121. <i id="git-edit-button" class="fa fa-edit"></i>
  122. </a>
  123. </div>
  124. </div>
  125. <div id="search-wrapper" class="hidden">
  126. <form id="searchbar-outer" class="searchbar-outer">
  127. <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
  128. </form>
  129. <div id="searchresults-outer" class="searchresults-outer hidden">
  130. <div id="searchresults-header" class="searchresults-header"></div>
  131. <ul id="searchresults">
  132. </ul>
  133. </div>
  134. </div>
  135. <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
  136. <script type="text/javascript">
  137. document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
  138. document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
  139. Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
  140. link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
  141. });
  142. </script>
  143. <div id="content" class="content">
  144. <main>
  145. <!-- Page table of contents -->
  146. <div class="sidetoc">
  147. <nav class="pagetoc"></nav>
  148. </div>
  149. <h1 id="list-room-api"><a class="header" href="#list-room-api">List Room API</a></h1>
  150. <p>The List Room admin API allows server admins to get a list of rooms on their
  151. server. There are various parameters available that allow for filtering and
  152. sorting the returned list. This API supports pagination.</p>
  153. <p>To use it, you will need to authenticate by providing an <code>access_token</code>
  154. for a server admin: see <a href="../usage/administration/admin_api/">Admin API</a>.</p>
  155. <p><strong>Parameters</strong></p>
  156. <p>The following query parameters are available:</p>
  157. <ul>
  158. <li>
  159. <p><code>from</code> - Offset in the returned list. Defaults to <code>0</code>.</p>
  160. </li>
  161. <li>
  162. <p><code>limit</code> - Maximum amount of rooms to return. Defaults to <code>100</code>.</p>
  163. </li>
  164. <li>
  165. <p><code>order_by</code> - The method in which to sort the returned list of rooms. Valid values are:</p>
  166. <ul>
  167. <li><code>alphabetical</code> - Same as <code>name</code>. This is deprecated.</li>
  168. <li><code>size</code> - Same as <code>joined_members</code>. This is deprecated.</li>
  169. <li><code>name</code> - Rooms are ordered alphabetically by room name. This is the default.</li>
  170. <li><code>canonical_alias</code> - Rooms are ordered alphabetically by main alias address of the room.</li>
  171. <li><code>joined_members</code> - Rooms are ordered by the number of members. Largest to smallest.</li>
  172. <li><code>joined_local_members</code> - Rooms are ordered by the number of local members. Largest to smallest.</li>
  173. <li><code>version</code> - Rooms are ordered by room version. Largest to smallest.</li>
  174. <li><code>creator</code> - Rooms are ordered alphabetically by creator of the room.</li>
  175. <li><code>encryption</code> - Rooms are ordered alphabetically by the end-to-end encryption algorithm.</li>
  176. <li><code>federatable</code> - Rooms are ordered by whether the room is federatable.</li>
  177. <li><code>public</code> - Rooms are ordered by visibility in room list.</li>
  178. <li><code>join_rules</code> - Rooms are ordered alphabetically by join rules of the room.</li>
  179. <li><code>guest_access</code> - Rooms are ordered alphabetically by guest access option of the room.</li>
  180. <li><code>history_visibility</code> - Rooms are ordered alphabetically by visibility of history of the room.</li>
  181. <li><code>state_events</code> - Rooms are ordered by number of state events. Largest to smallest.</li>
  182. </ul>
  183. </li>
  184. <li>
  185. <p><code>dir</code> - Direction of room order. Either <code>f</code> for forwards or <code>b</code> for backwards. Setting
  186. this value to <code>b</code> will reverse the above sort order. Defaults to <code>f</code>.</p>
  187. </li>
  188. <li>
  189. <p><code>search_term</code> - Filter rooms by their room name, canonical alias and room id.
  190. Specifically, rooms are selected if the search term is contained in</p>
  191. <ul>
  192. <li>the room's name,</li>
  193. <li>the local part of the room's canonical alias, or</li>
  194. <li>the complete (local and server part) room's id (case sensitive).</li>
  195. </ul>
  196. <p>Defaults to no filtering.</p>
  197. </li>
  198. </ul>
  199. <p><strong>Response</strong></p>
  200. <p>The following fields are possible in the JSON response body:</p>
  201. <ul>
  202. <li><code>rooms</code> - An array of objects, each containing information about a room.
  203. <ul>
  204. <li>Room objects contain the following fields:
  205. <ul>
  206. <li><code>room_id</code> - The ID of the room.</li>
  207. <li><code>name</code> - The name of the room.</li>
  208. <li><code>canonical_alias</code> - The canonical (main) alias address of the room.</li>
  209. <li><code>joined_members</code> - How many users are currently in the room.</li>
  210. <li><code>joined_local_members</code> - How many local users are currently in the room.</li>
  211. <li><code>version</code> - The version of the room as a string.</li>
  212. <li><code>creator</code> - The <code>user_id</code> of the room creator.</li>
  213. <li><code>encryption</code> - Algorithm of end-to-end encryption of messages. Is <code>null</code> if encryption is not active.</li>
  214. <li><code>federatable</code> - Whether users on other servers can join this room.</li>
  215. <li><code>public</code> - Whether the room is visible in room directory.</li>
  216. <li><code>join_rules</code> - The type of rules used for users wishing to join this room. One of: [&quot;public&quot;, &quot;knock&quot;, &quot;invite&quot;, &quot;private&quot;].</li>
  217. <li><code>guest_access</code> - Whether guests can join the room. One of: [&quot;can_join&quot;, &quot;forbidden&quot;].</li>
  218. <li><code>history_visibility</code> - Who can see the room history. One of: [&quot;invited&quot;, &quot;joined&quot;, &quot;shared&quot;, &quot;world_readable&quot;].</li>
  219. <li><code>state_events</code> - Total number of state_events of a room. Complexity of the room.</li>
  220. <li><code>room_type</code> - The type of the room taken from the room's creation event; for example &quot;m.space&quot; if the room is a space. If the room does not define a type, the value will be <code>null</code>.</li>
  221. </ul>
  222. </li>
  223. </ul>
  224. </li>
  225. <li><code>offset</code> - The current pagination offset in rooms. This parameter should be
  226. used instead of <code>next_token</code> for room offset as <code>next_token</code> is
  227. not intended to be parsed.</li>
  228. <li><code>total_rooms</code> - The total number of rooms this query can return. Using this
  229. and <code>offset</code>, you have enough information to know the current
  230. progression through the list.</li>
  231. <li><code>next_batch</code> - If this field is present, we know that there are potentially
  232. more rooms on the server that did not all fit into this response.
  233. We can use <code>next_batch</code> to get the &quot;next page&quot; of results. To do
  234. so, simply repeat your request, setting the <code>from</code> parameter to
  235. the value of <code>next_batch</code>.</li>
  236. <li><code>prev_batch</code> - If this field is present, it is possible to paginate backwards.
  237. Use <code>prev_batch</code> for the <code>from</code> value in the next request to
  238. get the &quot;previous page&quot; of results.</li>
  239. </ul>
  240. <p>The API is:</p>
  241. <p>A standard request with no filtering:</p>
  242. <pre><code>GET /_synapse/admin/v1/rooms
  243. </code></pre>
  244. <p>A response body like the following is returned:</p>
  245. <pre><code class="language-json">{
  246. &quot;rooms&quot;: [
  247. {
  248. &quot;room_id&quot;: &quot;!OGEhHVWSdvArJzumhm:matrix.org&quot;,
  249. &quot;name&quot;: &quot;Matrix HQ&quot;,
  250. &quot;canonical_alias&quot;: &quot;#matrix:matrix.org&quot;,
  251. &quot;joined_members&quot;: 8326,
  252. &quot;joined_local_members&quot;: 2,
  253. &quot;version&quot;: &quot;1&quot;,
  254. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  255. &quot;encryption&quot;: null,
  256. &quot;federatable&quot;: true,
  257. &quot;public&quot;: true,
  258. &quot;join_rules&quot;: &quot;invite&quot;,
  259. &quot;guest_access&quot;: null,
  260. &quot;history_visibility&quot;: &quot;shared&quot;,
  261. &quot;state_events&quot;: 93534,
  262. &quot;room_type&quot;: &quot;m.space&quot;
  263. },
  264. ... (8 hidden items) ...
  265. {
  266. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  267. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  268. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  269. &quot;joined_members&quot;: 314,
  270. &quot;joined_local_members&quot;: 20,
  271. &quot;version&quot;: &quot;4&quot;,
  272. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  273. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  274. &quot;federatable&quot;: true,
  275. &quot;public&quot;: false,
  276. &quot;join_rules&quot;: &quot;invite&quot;,
  277. &quot;guest_access&quot;: null,
  278. &quot;history_visibility&quot;: &quot;shared&quot;,
  279. &quot;state_events&quot;: 8345,
  280. &quot;room_type&quot;: null
  281. }
  282. ],
  283. &quot;offset&quot;: 0,
  284. &quot;total_rooms&quot;: 10
  285. }
  286. </code></pre>
  287. <p>Filtering by room name:</p>
  288. <pre><code>GET /_synapse/admin/v1/rooms?search_term=TWIM
  289. </code></pre>
  290. <p>A response body like the following is returned:</p>
  291. <pre><code class="language-json">{
  292. &quot;rooms&quot;: [
  293. {
  294. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  295. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  296. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  297. &quot;joined_members&quot;: 314,
  298. &quot;joined_local_members&quot;: 20,
  299. &quot;version&quot;: &quot;4&quot;,
  300. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  301. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  302. &quot;federatable&quot;: true,
  303. &quot;public&quot;: false,
  304. &quot;join_rules&quot;: &quot;invite&quot;,
  305. &quot;guest_access&quot;: null,
  306. &quot;history_visibility&quot;: &quot;shared&quot;,
  307. &quot;state_events&quot;: 8,
  308. &quot;room_type&quot;: null
  309. }
  310. ],
  311. &quot;offset&quot;: 0,
  312. &quot;total_rooms&quot;: 1
  313. }
  314. </code></pre>
  315. <p>Paginating through a list of rooms:</p>
  316. <pre><code>GET /_synapse/admin/v1/rooms?order_by=size
  317. </code></pre>
  318. <p>A response body like the following is returned:</p>
  319. <pre><code class="language-json">{
  320. &quot;rooms&quot;: [
  321. {
  322. &quot;room_id&quot;: &quot;!OGEhHVWSdvArJzumhm:matrix.org&quot;,
  323. &quot;name&quot;: &quot;Matrix HQ&quot;,
  324. &quot;canonical_alias&quot;: &quot;#matrix:matrix.org&quot;,
  325. &quot;joined_members&quot;: 8326,
  326. &quot;joined_local_members&quot;: 2,
  327. &quot;version&quot;: &quot;1&quot;,
  328. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  329. &quot;encryption&quot;: null,
  330. &quot;federatable&quot;: true,
  331. &quot;public&quot;: true,
  332. &quot;join_rules&quot;: &quot;invite&quot;,
  333. &quot;guest_access&quot;: null,
  334. &quot;history_visibility&quot;: &quot;shared&quot;,
  335. &quot;state_events&quot;: 93534,
  336. &quot;room_type&quot;: null
  337. },
  338. ... (98 hidden items) ...
  339. {
  340. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  341. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  342. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  343. &quot;joined_members&quot;: 314,
  344. &quot;joined_local_members&quot;: 20,
  345. &quot;version&quot;: &quot;4&quot;,
  346. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  347. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  348. &quot;federatable&quot;: true,
  349. &quot;public&quot;: false,
  350. &quot;join_rules&quot;: &quot;invite&quot;,
  351. &quot;guest_access&quot;: null,
  352. &quot;history_visibility&quot;: &quot;shared&quot;,
  353. &quot;state_events&quot;: 8345,
  354. &quot;room_type&quot;: &quot;m.space&quot;
  355. }
  356. ],
  357. &quot;offset&quot;: 0,
  358. &quot;total_rooms&quot;: 150,
  359. &quot;next_token&quot;: 100
  360. }
  361. </code></pre>
  362. <p>The presence of the <code>next_token</code> parameter tells us that there are more rooms
  363. than returned in this request, and we need to make another request to get them.
  364. To get the next batch of room results, we repeat our request, setting the <code>from</code>
  365. parameter to the value of <code>next_token</code>.</p>
  366. <pre><code>GET /_synapse/admin/v1/rooms?order_by=size&amp;from=100
  367. </code></pre>
  368. <p>A response body like the following is returned:</p>
  369. <pre><code class="language-json">{
  370. &quot;rooms&quot;: [
  371. {
  372. &quot;room_id&quot;: &quot;!mscvqgqpHYjBGDxNym:matrix.org&quot;,
  373. &quot;name&quot;: &quot;Music Theory&quot;,
  374. &quot;canonical_alias&quot;: &quot;#musictheory:matrix.org&quot;,
  375. &quot;joined_members&quot;: 127,
  376. &quot;joined_local_members&quot;: 2,
  377. &quot;version&quot;: &quot;1&quot;,
  378. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  379. &quot;encryption&quot;: null,
  380. &quot;federatable&quot;: true,
  381. &quot;public&quot;: true,
  382. &quot;join_rules&quot;: &quot;invite&quot;,
  383. &quot;guest_access&quot;: null,
  384. &quot;history_visibility&quot;: &quot;shared&quot;,
  385. &quot;state_events&quot;: 93534,
  386. &quot;room_type&quot;: &quot;m.space&quot;
  387. },
  388. ... (48 hidden items) ...
  389. {
  390. &quot;room_id&quot;: &quot;!twcBhHVdZlQWuuxBhN:termina.org.uk&quot;,
  391. &quot;name&quot;: &quot;weechat-matrix&quot;,
  392. &quot;canonical_alias&quot;: &quot;#weechat-matrix:termina.org.uk&quot;,
  393. &quot;joined_members&quot;: 137,
  394. &quot;joined_local_members&quot;: 20,
  395. &quot;version&quot;: &quot;4&quot;,
  396. &quot;creator&quot;: &quot;@foo:termina.org.uk&quot;,
  397. &quot;encryption&quot;: null,
  398. &quot;federatable&quot;: true,
  399. &quot;public&quot;: true,
  400. &quot;join_rules&quot;: &quot;invite&quot;,
  401. &quot;guest_access&quot;: null,
  402. &quot;history_visibility&quot;: &quot;shared&quot;,
  403. &quot;state_events&quot;: 8345,
  404. &quot;room_type&quot;: null
  405. }
  406. ],
  407. &quot;offset&quot;: 100,
  408. &quot;prev_batch&quot;: 0,
  409. &quot;total_rooms&quot;: 150
  410. }
  411. </code></pre>
  412. <p>Once the <code>next_token</code> parameter is no longer present, we know we've reached the
  413. end of the list.</p>
  414. <h1 id="room-details-api"><a class="header" href="#room-details-api">Room Details API</a></h1>
  415. <p>The Room Details admin API allows server admins to get all details of a room.</p>
  416. <p>The following fields are possible in the JSON response body:</p>
  417. <ul>
  418. <li><code>room_id</code> - The ID of the room.</li>
  419. <li><code>name</code> - The name of the room.</li>
  420. <li><code>topic</code> - The topic of the room.</li>
  421. <li><code>avatar</code> - The <code>mxc</code> URI to the avatar of the room.</li>
  422. <li><code>canonical_alias</code> - The canonical (main) alias address of the room.</li>
  423. <li><code>joined_members</code> - How many users are currently in the room.</li>
  424. <li><code>joined_local_members</code> - How many local users are currently in the room.</li>
  425. <li><code>joined_local_devices</code> - How many local devices are currently in the room.</li>
  426. <li><code>version</code> - The version of the room as a string.</li>
  427. <li><code>creator</code> - The <code>user_id</code> of the room creator.</li>
  428. <li><code>encryption</code> - Algorithm of end-to-end encryption of messages. Is <code>null</code> if encryption is not active.</li>
  429. <li><code>federatable</code> - Whether users on other servers can join this room.</li>
  430. <li><code>public</code> - Whether the room is visible in room directory.</li>
  431. <li><code>join_rules</code> - The type of rules used for users wishing to join this room. One of: [&quot;public&quot;, &quot;knock&quot;, &quot;invite&quot;, &quot;private&quot;].</li>
  432. <li><code>guest_access</code> - Whether guests can join the room. One of: [&quot;can_join&quot;, &quot;forbidden&quot;].</li>
  433. <li><code>history_visibility</code> - Who can see the room history. One of: [&quot;invited&quot;, &quot;joined&quot;, &quot;shared&quot;, &quot;world_readable&quot;].</li>
  434. <li><code>state_events</code> - Total number of state_events of a room. Complexity of the room.</li>
  435. <li><code>room_type</code> - The type of the room taken from the room's creation event; for example &quot;m.space&quot; if the room is a space.
  436. If the room does not define a type, the value will be <code>null</code>.</li>
  437. <li><code>forgotten</code> - Whether all local users have
  438. <a href="https://spec.matrix.org/latest/client-server-api/#leaving-rooms">forgotten</a> the room.</li>
  439. </ul>
  440. <p>The API is:</p>
  441. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;
  442. </code></pre>
  443. <p>A response body like the following is returned:</p>
  444. <pre><code class="language-json">{
  445. &quot;room_id&quot;: &quot;!mscvqgqpHYjBGDxNym:matrix.org&quot;,
  446. &quot;name&quot;: &quot;Music Theory&quot;,
  447. &quot;avatar&quot;: &quot;mxc://matrix.org/AQDaVFlbkQoErdOgqWRgiGSV&quot;,
  448. &quot;topic&quot;: &quot;Theory, Composition, Notation, Analysis&quot;,
  449. &quot;canonical_alias&quot;: &quot;#musictheory:matrix.org&quot;,
  450. &quot;joined_members&quot;: 127,
  451. &quot;joined_local_members&quot;: 2,
  452. &quot;joined_local_devices&quot;: 2,
  453. &quot;version&quot;: &quot;1&quot;,
  454. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  455. &quot;encryption&quot;: null,
  456. &quot;federatable&quot;: true,
  457. &quot;public&quot;: true,
  458. &quot;join_rules&quot;: &quot;invite&quot;,
  459. &quot;guest_access&quot;: null,
  460. &quot;history_visibility&quot;: &quot;shared&quot;,
  461. &quot;state_events&quot;: 93534,
  462. &quot;room_type&quot;: &quot;m.space&quot;,
  463. &quot;forgotten&quot;: false
  464. }
  465. </code></pre>
  466. <p><em>Changed in Synapse 1.66:</em> Added the <code>forgotten</code> key to the response body.</p>
  467. <h1 id="room-members-api"><a class="header" href="#room-members-api">Room Members API</a></h1>
  468. <p>The Room Members admin API allows server admins to get a list of all members of a room.</p>
  469. <p>The response includes the following fields:</p>
  470. <ul>
  471. <li><code>members</code> - A list of all the members that are present in the room, represented by their ids.</li>
  472. <li><code>total</code> - Total number of members in the room.</li>
  473. </ul>
  474. <p>The API is:</p>
  475. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/members
  476. </code></pre>
  477. <p>A response body like the following is returned:</p>
  478. <pre><code class="language-json">{
  479. &quot;members&quot;: [
  480. &quot;@foo:matrix.org&quot;,
  481. &quot;@bar:matrix.org&quot;,
  482. &quot;@foobar:matrix.org&quot;
  483. ],
  484. &quot;total&quot;: 3
  485. }
  486. </code></pre>
  487. <h1 id="room-state-api"><a class="header" href="#room-state-api">Room State API</a></h1>
  488. <p>The Room State admin API allows server admins to get a list of all state events in a room.</p>
  489. <p>The response includes the following fields:</p>
  490. <ul>
  491. <li><code>state</code> - The current state of the room at the time of request.</li>
  492. </ul>
  493. <p>The API is:</p>
  494. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/state
  495. </code></pre>
  496. <p>A response body like the following is returned:</p>
  497. <pre><code class="language-json">{
  498. &quot;state&quot;: [
  499. {&quot;type&quot;: &quot;m.room.create&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true},
  500. {&quot;type&quot;: &quot;m.room.power_levels&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true},
  501. {&quot;type&quot;: &quot;m.room.name&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true}
  502. ]
  503. }
  504. </code></pre>
  505. <h1 id="room-messages-api"><a class="header" href="#room-messages-api">Room Messages API</a></h1>
  506. <p>The Room Messages admin API allows server admins to get all messages
  507. sent to a room in a given timeframe. There are various parameters available
  508. that allow for filtering and ordering the returned list. This API supports pagination.</p>
  509. <p>To use it, you will need to authenticate by providing an <code>access_token</code>
  510. for a server admin: see <a href="../usage/administration/admin_api/">Admin API</a>.</p>
  511. <p>This endpoint mirrors the <a href="https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3roomsroomidmessages">Matrix Spec defined Messages API</a>.</p>
  512. <p>The API is:</p>
  513. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/messages
  514. </code></pre>
  515. <p><strong>Parameters</strong></p>
  516. <p>The following path parameters are required:</p>
  517. <ul>
  518. <li><code>room_id</code> - The ID of the room you wish you fetch messages from.</li>
  519. </ul>
  520. <p>The following query parameters are available:</p>
  521. <ul>
  522. <li><code>from</code> (required) - The token to start returning events from. This token can be obtained from a prev_batch
  523. or next_batch token returned by the /sync endpoint, or from an end token returned by a previous request to this endpoint.</li>
  524. <li><code>to</code> - The token to spot returning events at.</li>
  525. <li><code>limit</code> - The maximum number of events to return. Defaults to <code>10</code>.</li>
  526. <li><code>filter</code> - A JSON RoomEventFilter to filter returned events with.</li>
  527. <li><code>dir</code> - The direction to return events from. Either <code>f</code> for forwards or <code>b</code> for backwards. Setting
  528. this value to <code>b</code> will reverse the above sort order. Defaults to <code>f</code>.</li>
  529. </ul>
  530. <p><strong>Response</strong></p>
  531. <p>The following fields are possible in the JSON response body:</p>
  532. <ul>
  533. <li><code>chunk</code> - A list of room events. The order depends on the dir parameter.
  534. Note that an empty chunk does not necessarily imply that no more events are available. Clients should continue to paginate until no end property is returned.</li>
  535. <li><code>end</code> - A token corresponding to the end of chunk. This token can be passed back to this endpoint to request further events.
  536. If no further events are available, this property is omitted from the response.</li>
  537. <li><code>start</code> - A token corresponding to the start of chunk.</li>
  538. <li><code>state</code> - A list of state events relevant to showing the chunk.</li>
  539. </ul>
  540. <p><strong>Example</strong></p>
  541. <p>For more details on each chunk, read <a href="https://spec.matrix.org/v1.1/client-server-api/#get_matrixclientv3roomsroomidmessages">the Matrix specification</a>.</p>
  542. <pre><code class="language-json">{
  543. &quot;chunk&quot;: [
  544. {
  545. &quot;content&quot;: {
  546. &quot;body&quot;: &quot;This is an example text message&quot;,
  547. &quot;format&quot;: &quot;org.matrix.custom.html&quot;,
  548. &quot;formatted_body&quot;: &quot;&lt;b&gt;This is an example text message&lt;/b&gt;&quot;,
  549. &quot;msgtype&quot;: &quot;m.text&quot;
  550. },
  551. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  552. &quot;origin_server_ts&quot;: 1432735824653,
  553. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  554. &quot;sender&quot;: &quot;@example:example.org&quot;,
  555. &quot;type&quot;: &quot;m.room.message&quot;,
  556. &quot;unsigned&quot;: {
  557. &quot;age&quot;: 1234
  558. }
  559. },
  560. {
  561. &quot;content&quot;: {
  562. &quot;name&quot;: &quot;The room name&quot;
  563. },
  564. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  565. &quot;origin_server_ts&quot;: 1432735824653,
  566. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  567. &quot;sender&quot;: &quot;@example:example.org&quot;,
  568. &quot;state_key&quot;: &quot;&quot;,
  569. &quot;type&quot;: &quot;m.room.name&quot;,
  570. &quot;unsigned&quot;: {
  571. &quot;age&quot;: 1234
  572. }
  573. },
  574. {
  575. &quot;content&quot;: {
  576. &quot;body&quot;: &quot;Gangnam Style&quot;,
  577. &quot;info&quot;: {
  578. &quot;duration&quot;: 2140786,
  579. &quot;h&quot;: 320,
  580. &quot;mimetype&quot;: &quot;video/mp4&quot;,
  581. &quot;size&quot;: 1563685,
  582. &quot;thumbnail_info&quot;: {
  583. &quot;h&quot;: 300,
  584. &quot;mimetype&quot;: &quot;image/jpeg&quot;,
  585. &quot;size&quot;: 46144,
  586. &quot;w&quot;: 300
  587. },
  588. &quot;thumbnail_url&quot;: &quot;mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe&quot;,
  589. &quot;w&quot;: 480
  590. },
  591. &quot;msgtype&quot;: &quot;m.video&quot;,
  592. &quot;url&quot;: &quot;mxc://example.org/a526eYUSFFxlgbQYZmo442&quot;
  593. },
  594. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  595. &quot;origin_server_ts&quot;: 1432735824653,
  596. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  597. &quot;sender&quot;: &quot;@example:example.org&quot;,
  598. &quot;type&quot;: &quot;m.room.message&quot;,
  599. &quot;unsigned&quot;: {
  600. &quot;age&quot;: 1234
  601. }
  602. }
  603. ],
  604. &quot;end&quot;: &quot;t47409-4357353_219380_26003_2265&quot;,
  605. &quot;start&quot;: &quot;t47429-4392820_219380_26003_2265&quot;
  606. }
  607. </code></pre>
  608. <h1 id="room-timestamp-to-event-api"><a class="header" href="#room-timestamp-to-event-api">Room Timestamp to Event API</a></h1>
  609. <p>The Room Timestamp to Event API endpoint fetches the <code>event_id</code> of the closest event to the given
  610. timestamp (<code>ts</code> query parameter) in the given direction (<code>dir</code> query parameter).</p>
  611. <p>Useful for cases like jump to date so you can start paginating messages from
  612. a given date in the archive.</p>
  613. <p>The API is:</p>
  614. <pre><code> GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/timestamp_to_event
  615. </code></pre>
  616. <p><strong>Parameters</strong></p>
  617. <p>The following path parameters are required:</p>
  618. <ul>
  619. <li><code>room_id</code> - The ID of the room you wish to check.</li>
  620. </ul>
  621. <p>The following query parameters are available:</p>
  622. <ul>
  623. <li><code>ts</code> - a timestamp in milliseconds where we will find the closest event in
  624. the given direction.</li>
  625. <li><code>dir</code> - can be <code>f</code> or <code>b</code> to indicate forwards and backwards in time from the
  626. given timestamp. Defaults to <code>f</code>.</li>
  627. </ul>
  628. <p><strong>Response</strong></p>
  629. <ul>
  630. <li><code>event_id</code> - converted from timestamp</li>
  631. </ul>
  632. <h1 id="block-room-api"><a class="header" href="#block-room-api">Block Room API</a></h1>
  633. <p>The Block Room admin API allows server admins to block and unblock rooms,
  634. and query to see if a given room is blocked.
  635. This API can be used to pre-emptively block a room, even if it's unknown to this
  636. homeserver. Users will be prevented from joining a blocked room.</p>
  637. <h2 id="block-or-unblock-a-room"><a class="header" href="#block-or-unblock-a-room">Block or unblock a room</a></h2>
  638. <p>The API is:</p>
  639. <pre><code>PUT /_synapse/admin/v1/rooms/&lt;room_id&gt;/block
  640. </code></pre>
  641. <p>with a body of:</p>
  642. <pre><code class="language-json">{
  643. &quot;block&quot;: true
  644. }
  645. </code></pre>
  646. <p>A response body like the following is returned:</p>
  647. <pre><code class="language-json">{
  648. &quot;block&quot;: true
  649. }
  650. </code></pre>
  651. <p><strong>Parameters</strong></p>
  652. <p>The following parameters should be set in the URL:</p>
  653. <ul>
  654. <li><code>room_id</code> - The ID of the room.</li>
  655. </ul>
  656. <p>The following JSON body parameters are available:</p>
  657. <ul>
  658. <li><code>block</code> - If <code>true</code> the room will be blocked and if <code>false</code> the room will be unblocked.</li>
  659. </ul>
  660. <p><strong>Response</strong></p>
  661. <p>The following fields are possible in the JSON response body:</p>
  662. <ul>
  663. <li><code>block</code> - A boolean. <code>true</code> if the room is blocked, otherwise <code>false</code></li>
  664. </ul>
  665. <h2 id="get-block-status"><a class="header" href="#get-block-status">Get block status</a></h2>
  666. <p>The API is:</p>
  667. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/block
  668. </code></pre>
  669. <p>A response body like the following is returned:</p>
  670. <pre><code class="language-json">{
  671. &quot;block&quot;: true,
  672. &quot;user_id&quot;: &quot;&lt;user_id&gt;&quot;
  673. }
  674. </code></pre>
  675. <p><strong>Parameters</strong></p>
  676. <p>The following parameters should be set in the URL:</p>
  677. <ul>
  678. <li><code>room_id</code> - The ID of the room.</li>
  679. </ul>
  680. <p><strong>Response</strong></p>
  681. <p>The following fields are possible in the JSON response body:</p>
  682. <ul>
  683. <li><code>block</code> - A boolean. <code>true</code> if the room is blocked, otherwise <code>false</code></li>
  684. <li><code>user_id</code> - An optional string. If the room is blocked (<code>block</code> is <code>true</code>) shows
  685. the user who has add the room to blocking list. Otherwise it is not displayed.</li>
  686. </ul>
  687. <h1 id="delete-room-api"><a class="header" href="#delete-room-api">Delete Room API</a></h1>
  688. <p>The Delete Room admin API allows server admins to remove rooms from the server
  689. and block these rooms.</p>
  690. <p>Shuts down a room. Moves all local users and room aliases automatically to a
  691. new room if <code>new_room_user_id</code> is set. Otherwise local users only
  692. leave the room without any information.</p>
  693. <p>The new room will be created with the user specified by the <code>new_room_user_id</code> parameter
  694. as room administrator and will contain a message explaining what happened. Users invited
  695. to the new room will have power level <code>-10</code> by default, and thus be unable to speak.</p>
  696. <p>If <code>block</code> is <code>true</code>, users will be prevented from joining the old room.
  697. This option can in <a href="#version-1-old-version">Version 1</a> also be used to pre-emptively
  698. block a room, even if it's unknown to this homeserver. In this case, the room will be
  699. blocked, and no further action will be taken. If <code>block</code> is <code>false</code>, attempting to
  700. delete an unknown room is invalid and will be rejected as a bad request.</p>
  701. <p>This API will remove all trace of the old room from your database after removing
  702. all local users. If <code>purge</code> is <code>true</code> (the default), all traces of the old room will
  703. be removed from your database after removing all local users. If you do not want
  704. this to happen, set <code>purge</code> to <code>false</code>.
  705. Depending on the amount of history being purged, a call to the API may take
  706. several minutes or longer.</p>
  707. <p>The local server will only have the power to move local user and room aliases to
  708. the new room. Users on other servers will be unaffected.</p>
  709. <h2 id="version-1-old-version"><a class="header" href="#version-1-old-version">Version 1 (old version)</a></h2>
  710. <p>This version works synchronously. That means you only get the response once the server has
  711. finished the action, which may take a long time. If you request the same action
  712. a second time, and the server has not finished the first one, the second request will block.
  713. This is fixed in version 2 of this API. The parameters are the same in both APIs.
  714. This API will become deprecated in the future.</p>
  715. <p>The API is:</p>
  716. <pre><code>DELETE /_synapse/admin/v1/rooms/&lt;room_id&gt;
  717. </code></pre>
  718. <p>with a body of:</p>
  719. <pre><code class="language-json">{
  720. &quot;new_room_user_id&quot;: &quot;@someuser:example.com&quot;,
  721. &quot;room_name&quot;: &quot;Content Violation Notification&quot;,
  722. &quot;message&quot;: &quot;Bad Room has been shutdown due to content violations on this server. Please review our Terms of Service.&quot;,
  723. &quot;block&quot;: true,
  724. &quot;purge&quot;: true
  725. }
  726. </code></pre>
  727. <p>A response body like the following is returned:</p>
  728. <pre><code class="language-json">{
  729. &quot;kicked_users&quot;: [
  730. &quot;@foobar:example.com&quot;
  731. ],
  732. &quot;failed_to_kick_users&quot;: [],
  733. &quot;local_aliases&quot;: [
  734. &quot;#badroom:example.com&quot;,
  735. &quot;#evilsaloon:example.com&quot;
  736. ],
  737. &quot;new_room_id&quot;: &quot;!newroomid:example.com&quot;
  738. }
  739. </code></pre>
  740. <p>The parameters and response values have the same format as
  741. <a href="#version-2-new-version">version 2</a> of the API.</p>
  742. <h2 id="version-2-new-version"><a class="header" href="#version-2-new-version">Version 2 (new version)</a></h2>
  743. <p><strong>Note</strong>: This API is new, experimental and &quot;subject to change&quot;.</p>
  744. <p>This version works asynchronously, meaning you get the response from server immediately
  745. while the server works on that task in background. You can then request the status of the action
  746. to check if it has completed.</p>
  747. <p>The API is:</p>
  748. <pre><code>DELETE /_synapse/admin/v2/rooms/&lt;room_id&gt;
  749. </code></pre>
  750. <p>with a body of:</p>
  751. <pre><code class="language-json">{
  752. &quot;new_room_user_id&quot;: &quot;@someuser:example.com&quot;,
  753. &quot;room_name&quot;: &quot;Content Violation Notification&quot;,
  754. &quot;message&quot;: &quot;Bad Room has been shutdown due to content violations on this server. Please review our Terms of Service.&quot;,
  755. &quot;block&quot;: true,
  756. &quot;purge&quot;: true
  757. }
  758. </code></pre>
  759. <p>The API starts the shut down and purge running, and returns immediately with a JSON body with
  760. a purge id:</p>
  761. <pre><code class="language-json">{
  762. &quot;delete_id&quot;: &quot;&lt;opaque id&gt;&quot;
  763. }
  764. </code></pre>
  765. <p><strong>Parameters</strong></p>
  766. <p>The following parameters should be set in the URL:</p>
  767. <ul>
  768. <li><code>room_id</code> - The ID of the room.</li>
  769. </ul>
  770. <p>The following JSON body parameters are available:</p>
  771. <ul>
  772. <li><code>new_room_user_id</code> - Optional. If set, a new room will be created with this user ID
  773. as the creator and admin, and all users in the old room will be moved into that
  774. room. If not set, no new room will be created and the users will just be removed
  775. from the old room. The user ID must be on the local server, but does not necessarily
  776. have to belong to a registered user.</li>
  777. <li><code>room_name</code> - Optional. A string representing the name of the room that new users will be
  778. invited to. Defaults to <code>Content Violation Notification</code></li>
  779. <li><code>message</code> - Optional. A string containing the first message that will be sent as
  780. <code>new_room_user_id</code> in the new room. Ideally this will clearly convey why the
  781. original room was shut down. Defaults to <code>Sharing illegal content on this server is not permitted and rooms in violation will be blocked.</code></li>
  782. <li><code>block</code> - Optional. If set to <code>true</code>, this room will be added to a blocking list,
  783. preventing future attempts to join the room. Rooms can be blocked
  784. even if they're not yet known to the homeserver (only with
  785. <a href="#version-1-old-version">Version 1</a> of the API). Defaults to <code>false</code>.</li>
  786. <li><code>purge</code> - Optional. If set to <code>true</code>, it will remove all traces of the room from your database.
  787. Defaults to <code>true</code>.</li>
  788. <li><code>force_purge</code> - Optional, and ignored unless <code>purge</code> is <code>true</code>. If set to <code>true</code>, it
  789. will force a purge to go ahead even if there are local users still in the room. Do not
  790. use this unless a regular <code>purge</code> operation fails, as it could leave those users'
  791. clients in a confused state.</li>
  792. </ul>
  793. <p>The JSON body must not be empty. The body must be at least <code>{}</code>.</p>
  794. <h2 id="status-of-deleting-rooms"><a class="header" href="#status-of-deleting-rooms">Status of deleting rooms</a></h2>
  795. <p><strong>Note</strong>: This API is new, experimental and &quot;subject to change&quot;.</p>
  796. <p>It is possible to query the status of the background task for deleting rooms.
  797. The status can be queried up to 24 hours after completion of the task,
  798. or until Synapse is restarted (whichever happens first).</p>
  799. <h3 id="query-by-room_id"><a class="header" href="#query-by-room_id">Query by <code>room_id</code></a></h3>
  800. <p>With this API you can get the status of all active deletion tasks, and all those completed in the last 24h,
  801. for the given <code>room_id</code>.</p>
  802. <p>The API is:</p>
  803. <pre><code>GET /_synapse/admin/v2/rooms/&lt;room_id&gt;/delete_status
  804. </code></pre>
  805. <p>A response body like the following is returned:</p>
  806. <pre><code class="language-json">{
  807. &quot;results&quot;: [
  808. {
  809. &quot;delete_id&quot;: &quot;delete_id1&quot;,
  810. &quot;status&quot;: &quot;failed&quot;,
  811. &quot;error&quot;: &quot;error message&quot;,
  812. &quot;shutdown_room&quot;: {
  813. &quot;kicked_users&quot;: [],
  814. &quot;failed_to_kick_users&quot;: [],
  815. &quot;local_aliases&quot;: [],
  816. &quot;new_room_id&quot;: null
  817. }
  818. }, {
  819. &quot;delete_id&quot;: &quot;delete_id2&quot;,
  820. &quot;status&quot;: &quot;purging&quot;,
  821. &quot;shutdown_room&quot;: {
  822. &quot;kicked_users&quot;: [
  823. &quot;@foobar:example.com&quot;
  824. ],
  825. &quot;failed_to_kick_users&quot;: [],
  826. &quot;local_aliases&quot;: [
  827. &quot;#badroom:example.com&quot;,
  828. &quot;#evilsaloon:example.com&quot;
  829. ],
  830. &quot;new_room_id&quot;: &quot;!newroomid:example.com&quot;
  831. }
  832. }
  833. ]
  834. }
  835. </code></pre>
  836. <p><strong>Parameters</strong></p>
  837. <p>The following parameters should be set in the URL:</p>
  838. <ul>
  839. <li><code>room_id</code> - The ID of the room.</li>
  840. </ul>
  841. <h3 id="query-by-delete_id"><a class="header" href="#query-by-delete_id">Query by <code>delete_id</code></a></h3>
  842. <p>With this API you can get the status of one specific task by <code>delete_id</code>.</p>
  843. <p>The API is:</p>
  844. <pre><code>GET /_synapse/admin/v2/rooms/delete_status/&lt;delete_id&gt;
  845. </code></pre>
  846. <p>A response body like the following is returned:</p>
  847. <pre><code class="language-json">{
  848. &quot;status&quot;: &quot;purging&quot;,
  849. &quot;shutdown_room&quot;: {
  850. &quot;kicked_users&quot;: [
  851. &quot;@foobar:example.com&quot;
  852. ],
  853. &quot;failed_to_kick_users&quot;: [],
  854. &quot;local_aliases&quot;: [
  855. &quot;#badroom:example.com&quot;,
  856. &quot;#evilsaloon:example.com&quot;
  857. ],
  858. &quot;new_room_id&quot;: &quot;!newroomid:example.com&quot;
  859. }
  860. }
  861. </code></pre>
  862. <p><strong>Parameters</strong></p>
  863. <p>The following parameters should be set in the URL:</p>
  864. <ul>
  865. <li><code>delete_id</code> - The ID for this delete.</li>
  866. </ul>
  867. <h3 id="response"><a class="header" href="#response">Response</a></h3>
  868. <p>The following fields are returned in the JSON response body:</p>
  869. <ul>
  870. <li><code>results</code> - An array of objects, each containing information about one task.
  871. This field is omitted from the result when you query by <code>delete_id</code>.
  872. Task objects contain the following fields:
  873. <ul>
  874. <li><code>delete_id</code> - The ID for this purge if you query by <code>room_id</code>.</li>
  875. <li><code>status</code> - The status will be one of:
  876. <ul>
  877. <li><code>shutting_down</code> - The process is removing users from the room.</li>
  878. <li><code>purging</code> - The process is purging the room and event data from database.</li>
  879. <li><code>complete</code> - The process has completed successfully.</li>
  880. <li><code>failed</code> - The process is aborted, an error has occurred.</li>
  881. </ul>
  882. </li>
  883. <li><code>error</code> - A string that shows an error message if <code>status</code> is <code>failed</code>.
  884. Otherwise this field is hidden.</li>
  885. <li><code>shutdown_room</code> - An object containing information about the result of shutting down the room.
  886. <em>Note:</em> The result is shown after removing the room members.
  887. The delete process can still be running. Please pay attention to the <code>status</code>.
  888. <ul>
  889. <li><code>kicked_users</code> - An array of users (<code>user_id</code>) that were kicked.</li>
  890. <li><code>failed_to_kick_users</code> - An array of users (<code>user_id</code>) that that were not kicked.</li>
  891. <li><code>local_aliases</code> - An array of strings representing the local aliases that were
  892. migrated from the old room to the new.</li>
  893. <li><code>new_room_id</code> - A string representing the room ID of the new room, or <code>null</code> if
  894. no such room was created.</li>
  895. </ul>
  896. </li>
  897. </ul>
  898. </li>
  899. </ul>
  900. <h2 id="undoing-room-deletions"><a class="header" href="#undoing-room-deletions">Undoing room deletions</a></h2>
  901. <p><em>Note</em>: This guide may be outdated by the time you read it. By nature of room deletions being performed at the database level,
  902. the structure can and does change without notice.</p>
  903. <p>First, it's important to understand that a room deletion is very destructive. Undoing a deletion is not as simple as pretending it
  904. never happened - work has to be done to move forward instead of resetting the past. In fact, in some cases it might not be possible
  905. to recover at all:</p>
  906. <ul>
  907. <li>If the room was invite-only, your users will need to be re-invited.</li>
  908. <li>If the room no longer has any members at all, it'll be impossible to rejoin.</li>
  909. <li>The first user to rejoin will have to do so via an alias on a different
  910. server (or receive an invite from a user on a different server).</li>
  911. </ul>
  912. <p>With all that being said, if you still want to try and recover the room:</p>
  913. <ol>
  914. <li>
  915. <p>If the room was <code>block</code>ed, you must unblock it on your server. This can be
  916. accomplished as follows:</p>
  917. <ol>
  918. <li>For safety reasons, shut down Synapse.</li>
  919. <li>In the database, run <code>DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';</code>
  920. <ul>
  921. <li>For caution: it's recommended to run this in a transaction: <code>BEGIN; DELETE ...;</code>, verify you got 1 result, then <code>COMMIT;</code>.</li>
  922. <li>The room ID is the same one supplied to the delete room API, not the Content Violation room.</li>
  923. </ul>
  924. </li>
  925. <li>Restart Synapse.</li>
  926. </ol>
  927. <p>This step is unnecessary if <code>block</code> was not set.</p>
  928. </li>
  929. <li>
  930. <p>Any room aliases on your server that pointed to the deleted room may have
  931. been deleted, or redirected to the Content Violation room. These will need
  932. to be restored manually.</p>
  933. </li>
  934. <li>
  935. <p>Users on your server that were in the deleted room will have been kicked
  936. from the room. Consider whether you want to update their membership
  937. (possibly via the <a href="room_membership.html">Edit Room Membership API</a>) or let
  938. them handle rejoining themselves.</p>
  939. </li>
  940. <li>
  941. <p>If <code>new_room_user_id</code> was given, a 'Content Violation' will have been
  942. created. Consider whether you want to delete that roomm.</p>
  943. </li>
  944. </ol>
  945. <h1 id="make-room-admin-api"><a class="header" href="#make-room-admin-api">Make Room Admin API</a></h1>
  946. <p>Grants another user the highest power available to a local user who is in the room.
  947. If the user is not in the room, and it is not publicly joinable, then invite the user.</p>
  948. <p>By default the server admin (the caller) is granted power, but another user can
  949. optionally be specified, e.g.:</p>
  950. <pre><code>POST /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/make_room_admin
  951. {
  952. &quot;user_id&quot;: &quot;@foo:example.com&quot;
  953. }
  954. </code></pre>
  955. <h1 id="forward-extremities-admin-api"><a class="header" href="#forward-extremities-admin-api">Forward Extremities Admin API</a></h1>
  956. <p>Enables querying and deleting forward extremities from rooms. When a lot of forward
  957. extremities accumulate in a room, performance can become degraded. For details, see
  958. <a href="https://github.com/matrix-org/synapse/issues/1760">#1760</a>.</p>
  959. <h2 id="check-for-forward-extremities"><a class="header" href="#check-for-forward-extremities">Check for forward extremities</a></h2>
  960. <p>To check the status of forward extremities for a room:</p>
  961. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/forward_extremities
  962. </code></pre>
  963. <p>A response as follows will be returned:</p>
  964. <pre><code class="language-json">{
  965. &quot;count&quot;: 1,
  966. &quot;results&quot;: [
  967. {
  968. &quot;event_id&quot;: &quot;$M5SP266vsnxctfwFgFLNceaCo3ujhRtg_NiiHabcdefgh&quot;,
  969. &quot;state_group&quot;: 439,
  970. &quot;depth&quot;: 123,
  971. &quot;received_ts&quot;: 1611263016761
  972. }
  973. ]
  974. }
  975. </code></pre>
  976. <h2 id="deleting-forward-extremities"><a class="header" href="#deleting-forward-extremities">Deleting forward extremities</a></h2>
  977. <p><strong>WARNING</strong>: Please ensure you know what you're doing and have read
  978. the related issue <a href="https://github.com/matrix-org/synapse/issues/1760">#1760</a>.
  979. Under no situations should this API be executed as an automated maintenance task!</p>
  980. <p>If a room has lots of forward extremities, the extra can be
  981. deleted as follows:</p>
  982. <pre><code>DELETE /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/forward_extremities
  983. </code></pre>
  984. <p>A response as follows will be returned, indicating the amount of forward extremities
  985. that were deleted.</p>
  986. <pre><code class="language-json">{
  987. &quot;deleted&quot;: 1
  988. }
  989. </code></pre>
  990. <h1 id="event-context-api"><a class="header" href="#event-context-api">Event Context API</a></h1>
  991. <p>This API lets a client find the context of an event. This is designed primarily to investigate abuse reports.</p>
  992. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/context/&lt;event_id&gt;
  993. </code></pre>
  994. <p>This API mimmicks <a href="https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-rooms-roomid-context-eventid">GET /_matrix/client/r0/rooms/{roomId}/context/{eventId}</a>. Please refer to the link for all details on parameters and reseponse.</p>
  995. <p>Example response:</p>
  996. <pre><code class="language-json">{
  997. &quot;end&quot;: &quot;t29-57_2_0_2&quot;,
  998. &quot;events_after&quot;: [
  999. {
  1000. &quot;content&quot;: {
  1001. &quot;body&quot;: &quot;This is an example text message&quot;,
  1002. &quot;msgtype&quot;: &quot;m.text&quot;,
  1003. &quot;format&quot;: &quot;org.matrix.custom.html&quot;,
  1004. &quot;formatted_body&quot;: &quot;&lt;b&gt;This is an example text message&lt;/b&gt;&quot;
  1005. },
  1006. &quot;type&quot;: &quot;m.room.message&quot;,
  1007. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  1008. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  1009. &quot;sender&quot;: &quot;@example:example.org&quot;,
  1010. &quot;origin_server_ts&quot;: 1432735824653,
  1011. &quot;unsigned&quot;: {
  1012. &quot;age&quot;: 1234
  1013. }
  1014. }
  1015. ],
  1016. &quot;event&quot;: {
  1017. &quot;content&quot;: {
  1018. &quot;body&quot;: &quot;filename.jpg&quot;,
  1019. &quot;info&quot;: {
  1020. &quot;h&quot;: 398,
  1021. &quot;w&quot;: 394,
  1022. &quot;mimetype&quot;: &quot;image/jpeg&quot;,
  1023. &quot;size&quot;: 31037
  1024. },
  1025. &quot;url&quot;: &quot;mxc://example.org/JWEIFJgwEIhweiWJE&quot;,
  1026. &quot;msgtype&quot;: &quot;m.image&quot;
  1027. },
  1028. &quot;type&quot;: &quot;m.room.message&quot;,
  1029. &quot;event_id&quot;: &quot;$f3h4d129462ha:example.com&quot;,
  1030. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  1031. &quot;sender&quot;: &quot;@example:example.org&quot;,
  1032. &quot;origin_server_ts&quot;: 1432735824653,
  1033. &quot;unsigned&quot;: {
  1034. &quot;age&quot;: 1234
  1035. }
  1036. },
  1037. &quot;events_before&quot;: [
  1038. {
  1039. &quot;content&quot;: {
  1040. &quot;body&quot;: &quot;something-important.doc&quot;,
  1041. &quot;filename&quot;: &quot;something-important.doc&quot;,
  1042. &quot;info&quot;: {
  1043. &quot;mimetype&quot;: &quot;application/msword&quot;,
  1044. &quot;size&quot;: 46144
  1045. },
  1046. &quot;msgtype&quot;: &quot;m.file&quot;,
  1047. &quot;url&quot;: &quot;mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe&quot;
  1048. },
  1049. &quot;type&quot;: &quot;m.room.message&quot;,
  1050. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  1051. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  1052. &quot;sender&quot;: &quot;@example:example.org&quot;,
  1053. &quot;origin_server_ts&quot;: 1432735824653,
  1054. &quot;unsigned&quot;: {
  1055. &quot;age&quot;: 1234
  1056. }
  1057. }
  1058. ],
  1059. &quot;start&quot;: &quot;t27-54_2_0_2&quot;,
  1060. &quot;state&quot;: [
  1061. {
  1062. &quot;content&quot;: {
  1063. &quot;creator&quot;: &quot;@example:example.org&quot;,
  1064. &quot;room_version&quot;: &quot;1&quot;,
  1065. &quot;m.federate&quot;: true,
  1066. &quot;predecessor&quot;: {
  1067. &quot;event_id&quot;: &quot;$something:example.org&quot;,
  1068. &quot;room_id&quot;: &quot;!oldroom:example.org&quot;
  1069. }
  1070. },
  1071. &quot;type&quot;: &quot;m.room.create&quot;,
  1072. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  1073. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  1074. &quot;sender&quot;: &quot;@example:example.org&quot;,
  1075. &quot;origin_server_ts&quot;: 1432735824653,
  1076. &quot;unsigned&quot;: {
  1077. &quot;age&quot;: 1234
  1078. },
  1079. &quot;state_key&quot;: &quot;&quot;
  1080. },
  1081. {
  1082. &quot;content&quot;: {
  1083. &quot;membership&quot;: &quot;join&quot;,
  1084. &quot;avatar_url&quot;: &quot;mxc://example.org/SEsfnsuifSDFSSEF&quot;,
  1085. &quot;displayname&quot;: &quot;Alice Margatroid&quot;
  1086. },
  1087. &quot;type&quot;: &quot;m.room.member&quot;,
  1088. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  1089. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  1090. &quot;sender&quot;: &quot;@example:example.org&quot;,
  1091. &quot;origin_server_ts&quot;: 1432735824653,
  1092. &quot;unsigned&quot;: {
  1093. &quot;age&quot;: 1234
  1094. },
  1095. &quot;state_key&quot;: &quot;@alice:example.org&quot;
  1096. }
  1097. ]
  1098. }
  1099. </code></pre>
  1100. </main>
  1101. <nav class="nav-wrapper" aria-label="Page navigation">
  1102. <!-- Mobile navigation buttons -->
  1103. <a rel="prev" href="../admin_api/room_membership.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1104. <i class="fa fa-angle-left"></i>
  1105. </a>
  1106. <a rel="next" href="../admin_api/server_notices.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1107. <i class="fa fa-angle-right"></i>
  1108. </a>
  1109. <div style="clear: both"></div>
  1110. </nav>
  1111. </div>
  1112. </div>
  1113. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  1114. <a rel="prev" href="../admin_api/room_membership.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  1115. <i class="fa fa-angle-left"></i>
  1116. </a>
  1117. <a rel="next" href="../admin_api/server_notices.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  1118. <i class="fa fa-angle-right"></i>
  1119. </a>
  1120. </nav>
  1121. </div>
  1122. <script type="text/javascript">
  1123. window.playground_copyable = true;
  1124. </script>
  1125. <script src="../elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  1126. <script src="../mark.min.js" type="text/javascript" charset="utf-8"></script>
  1127. <script src="../searcher.js" type="text/javascript" charset="utf-8"></script>
  1128. <script src="../clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  1129. <script src="../highlight.js" type="text/javascript" charset="utf-8"></script>
  1130. <script src="../book.js" type="text/javascript" charset="utf-8"></script>
  1131. <!-- Custom JS scripts -->
  1132. <script type="text/javascript" src="../docs/website_files/table-of-contents.js"></script>
  1133. <script type="text/javascript" src="../docs/website_files/version-picker.js"></script>
  1134. <script type="text/javascript" src="../docs/website_files/version.js"></script>
  1135. </body>
  1136. </html>