rooms.html 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880
  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. </head>
  30. <body>
  31. <!-- Provide site root to javascript -->
  32. <script type="text/javascript">
  33. var path_to_root = "../";
  34. var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light";
  35. </script>
  36. <!-- Work around some values being stored in localStorage wrapped in quotes -->
  37. <script type="text/javascript">
  38. try {
  39. var theme = localStorage.getItem('mdbook-theme');
  40. var sidebar = localStorage.getItem('mdbook-sidebar');
  41. if (theme.startsWith('"') && theme.endsWith('"')) {
  42. localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
  43. }
  44. if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
  45. localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
  46. }
  47. } catch (e) { }
  48. </script>
  49. <!-- Set the theme before any content is loaded, prevents flash -->
  50. <script type="text/javascript">
  51. var theme;
  52. try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
  53. if (theme === null || theme === undefined) { theme = default_theme; }
  54. var html = document.querySelector('html');
  55. html.classList.remove('no-js')
  56. html.classList.remove('light')
  57. html.classList.add(theme);
  58. html.classList.add('js');
  59. </script>
  60. <!-- Hide / unhide sidebar before it is displayed -->
  61. <script type="text/javascript">
  62. var html = document.querySelector('html');
  63. var sidebar = 'hidden';
  64. if (document.body.clientWidth >= 1080) {
  65. try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
  66. sidebar = sidebar || 'visible';
  67. }
  68. html.classList.remove('sidebar-visible');
  69. html.classList.add("sidebar-" + sidebar);
  70. </script>
  71. <nav id="sidebar" class="sidebar" aria-label="Table of contents">
  72. <div class="sidebar-scrollbox">
  73. <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 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 "><a href="../MSC1711_certificates_FAQ.html">Upgrading from pre-Synapse 1.0</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/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 "><div>Single-Sign On</div></li><li><ol class="section"><li class="chapter-item expanded "><a href="../openid.html">OpenID Connect</a></li><li class="chapter-item expanded "><div>SAML</div></li><li class="chapter-item expanded "><div>CAS</div></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></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="../development/url_previews.html">URL Previews</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/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="../admin_api/delete_group.html">Delete Group</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></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 class="chapter-item expanded "><a href="../usage/administration/request_log.html">Request log format</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/git.html">Git Usage</a></li><li class="chapter-item expanded "><div>Testing</div></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 "><div>Synapse Architecture</div></li><li><ol class="section"><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></ol>
  74. </div>
  75. <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
  76. </nav>
  77. <div id="page-wrapper" class="page-wrapper">
  78. <div class="page">
  79. <div id="menu-bar-hover-placeholder"></div>
  80. <div id="menu-bar" class="menu-bar sticky bordered">
  81. <div class="left-buttons">
  82. <button id="sidebar-toggle" class="icon-button" type="button" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
  83. <i class="fa fa-bars"></i>
  84. </button>
  85. <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">
  86. <i class="fa fa-paint-brush"></i>
  87. </button>
  88. <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
  89. <li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li>
  90. <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
  91. <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
  92. <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
  93. <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
  94. </ul>
  95. <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">
  96. <i class="fa fa-search"></i>
  97. </button>
  98. </div>
  99. <h1 class="menu-title">Synapse</h1>
  100. <div class="right-buttons">
  101. <a href="../print.html" title="Print this book" aria-label="Print this book">
  102. <i id="print-button" class="fa fa-print"></i>
  103. </a>
  104. <a href="https://github.com/matrix-org/synapse" title="Git repository" aria-label="Git repository">
  105. <i id="git-repository-button" class="fa fa-github"></i>
  106. </a>
  107. <a href="https://github.com/matrix-org/synapse/edit/develop/docs/admin_api/rooms.md" title="Suggest an edit" aria-label="Suggest an edit">
  108. <i id="git-edit-button" class="fa fa-edit"></i>
  109. </a>
  110. </div>
  111. </div>
  112. <div id="search-wrapper" class="hidden">
  113. <form id="searchbar-outer" class="searchbar-outer">
  114. <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
  115. </form>
  116. <div id="searchresults-outer" class="searchresults-outer hidden">
  117. <div id="searchresults-header" class="searchresults-header"></div>
  118. <ul id="searchresults">
  119. </ul>
  120. </div>
  121. </div>
  122. <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
  123. <script type="text/javascript">
  124. document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
  125. document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
  126. Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
  127. link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
  128. });
  129. </script>
  130. <div id="content" class="content">
  131. <main>
  132. <!-- Page table of contents -->
  133. <div class="sidetoc">
  134. <nav class="pagetoc"></nav>
  135. </div>
  136. <h1 id="contents"><a class="header" href="#contents">Contents</a></h1>
  137. <ul>
  138. <li><a href="#list-room-api">List Room API</a></li>
  139. <li><a href="#room-details-api">Room Details API</a></li>
  140. <li><a href="#room-members-api">Room Members API</a></li>
  141. <li><a href="#room-state-api">Room State API</a></li>
  142. <li><a href="#delete-room-api">Delete Room API</a>
  143. <ul>
  144. <li><a href="#undoing-room-shutdowns">Undoing room shutdowns</a></li>
  145. </ul>
  146. </li>
  147. <li><a href="#make-room-admin-api">Make Room Admin API</a></li>
  148. <li><a href="#forward-extremities-admin-api">Forward Extremities Admin API</a></li>
  149. <li><a href="#event-context-api">Event Context API</a></li>
  150. </ul>
  151. <h1 id="list-room-api"><a class="header" href="#list-room-api">List Room API</a></h1>
  152. <p>The List Room admin API allows server admins to get a list of rooms on their
  153. server. There are various parameters available that allow for filtering and
  154. sorting the returned list. This API supports pagination.</p>
  155. <p><strong>Parameters</strong></p>
  156. <p>The following query parameters are available:</p>
  157. <ul>
  158. <li><code>from</code> - Offset in the returned list. Defaults to <code>0</code>.</li>
  159. <li><code>limit</code> - Maximum amount of rooms to return. Defaults to <code>100</code>.</li>
  160. <li><code>order_by</code> - The method in which to sort the returned list of rooms. Valid values are:
  161. <ul>
  162. <li><code>alphabetical</code> - Same as <code>name</code>. This is deprecated.</li>
  163. <li><code>size</code> - Same as <code>joined_members</code>. This is deprecated.</li>
  164. <li><code>name</code> - Rooms are ordered alphabetically by room name. This is the default.</li>
  165. <li><code>canonical_alias</code> - Rooms are ordered alphabetically by main alias address of the room.</li>
  166. <li><code>joined_members</code> - Rooms are ordered by the number of members. Largest to smallest.</li>
  167. <li><code>joined_local_members</code> - Rooms are ordered by the number of local members. Largest to smallest.</li>
  168. <li><code>version</code> - Rooms are ordered by room version. Largest to smallest.</li>
  169. <li><code>creator</code> - Rooms are ordered alphabetically by creator of the room.</li>
  170. <li><code>encryption</code> - Rooms are ordered alphabetically by the end-to-end encryption algorithm.</li>
  171. <li><code>federatable</code> - Rooms are ordered by whether the room is federatable.</li>
  172. <li><code>public</code> - Rooms are ordered by visibility in room list.</li>
  173. <li><code>join_rules</code> - Rooms are ordered alphabetically by join rules of the room.</li>
  174. <li><code>guest_access</code> - Rooms are ordered alphabetically by guest access option of the room.</li>
  175. <li><code>history_visibility</code> - Rooms are ordered alphabetically by visibility of history of the room.</li>
  176. <li><code>state_events</code> - Rooms are ordered by number of state events. Largest to smallest.</li>
  177. </ul>
  178. </li>
  179. <li><code>dir</code> - Direction of room order. Either <code>f</code> for forwards or <code>b</code> for backwards. Setting
  180. this value to <code>b</code> will reverse the above sort order. Defaults to <code>f</code>.</li>
  181. <li><code>search_term</code> - Filter rooms by their room name. Search term can be contained in any
  182. part of the room name. Defaults to no filtering.</li>
  183. </ul>
  184. <p><strong>Response</strong></p>
  185. <p>The following fields are possible in the JSON response body:</p>
  186. <ul>
  187. <li><code>rooms</code> - An array of objects, each containing information about a room.
  188. <ul>
  189. <li>Room objects contain the following fields:
  190. <ul>
  191. <li><code>room_id</code> - The ID of the room.</li>
  192. <li><code>name</code> - The name of the room.</li>
  193. <li><code>canonical_alias</code> - The canonical (main) alias address of the room.</li>
  194. <li><code>joined_members</code> - How many users are currently in the room.</li>
  195. <li><code>joined_local_members</code> - How many local users are currently in the room.</li>
  196. <li><code>version</code> - The version of the room as a string.</li>
  197. <li><code>creator</code> - The <code>user_id</code> of the room creator.</li>
  198. <li><code>encryption</code> - Algorithm of end-to-end encryption of messages. Is <code>null</code> if encryption is not active.</li>
  199. <li><code>federatable</code> - Whether users on other servers can join this room.</li>
  200. <li><code>public</code> - Whether the room is visible in room directory.</li>
  201. <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>
  202. <li><code>guest_access</code> - Whether guests can join the room. One of: [&quot;can_join&quot;, &quot;forbidden&quot;].</li>
  203. <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>
  204. <li><code>state_events</code> - Total number of state_events of a room. Complexity of the room.</li>
  205. </ul>
  206. </li>
  207. </ul>
  208. </li>
  209. <li><code>offset</code> - The current pagination offset in rooms. This parameter should be
  210. used instead of <code>next_token</code> for room offset as <code>next_token</code> is
  211. not intended to be parsed.</li>
  212. <li><code>total_rooms</code> - The total number of rooms this query can return. Using this
  213. and <code>offset</code>, you have enough information to know the current
  214. progression through the list.</li>
  215. <li><code>next_batch</code> - If this field is present, we know that there are potentially
  216. more rooms on the server that did not all fit into this response.
  217. We can use <code>next_batch</code> to get the &quot;next page&quot; of results. To do
  218. so, simply repeat your request, setting the <code>from</code> parameter to
  219. the value of <code>next_batch</code>.</li>
  220. <li><code>prev_batch</code> - If this field is present, it is possible to paginate backwards.
  221. Use <code>prev_batch</code> for the <code>from</code> value in the next request to
  222. get the &quot;previous page&quot; of results.</li>
  223. </ul>
  224. <p>The API is:</p>
  225. <p>A standard request with no filtering:</p>
  226. <pre><code>GET /_synapse/admin/v1/rooms
  227. </code></pre>
  228. <p>A response body like the following is returned:</p>
  229. <pre><code class="language-jsonc">{
  230. &quot;rooms&quot;: [
  231. {
  232. &quot;room_id&quot;: &quot;!OGEhHVWSdvArJzumhm:matrix.org&quot;,
  233. &quot;name&quot;: &quot;Matrix HQ&quot;,
  234. &quot;canonical_alias&quot;: &quot;#matrix:matrix.org&quot;,
  235. &quot;joined_members&quot;: 8326,
  236. &quot;joined_local_members&quot;: 2,
  237. &quot;version&quot;: &quot;1&quot;,
  238. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  239. &quot;encryption&quot;: null,
  240. &quot;federatable&quot;: true,
  241. &quot;public&quot;: true,
  242. &quot;join_rules&quot;: &quot;invite&quot;,
  243. &quot;guest_access&quot;: null,
  244. &quot;history_visibility&quot;: &quot;shared&quot;,
  245. &quot;state_events&quot;: 93534
  246. },
  247. ... (8 hidden items) ...
  248. {
  249. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  250. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  251. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  252. &quot;joined_members&quot;: 314,
  253. &quot;joined_local_members&quot;: 20,
  254. &quot;version&quot;: &quot;4&quot;,
  255. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  256. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  257. &quot;federatable&quot;: true,
  258. &quot;public&quot;: false,
  259. &quot;join_rules&quot;: &quot;invite&quot;,
  260. &quot;guest_access&quot;: null,
  261. &quot;history_visibility&quot;: &quot;shared&quot;,
  262. &quot;state_events&quot;: 8345
  263. }
  264. ],
  265. &quot;offset&quot;: 0,
  266. &quot;total_rooms&quot;: 10
  267. }
  268. </code></pre>
  269. <p>Filtering by room name:</p>
  270. <pre><code>GET /_synapse/admin/v1/rooms?search_term=TWIM
  271. </code></pre>
  272. <p>A response body like the following is returned:</p>
  273. <pre><code class="language-json">{
  274. &quot;rooms&quot;: [
  275. {
  276. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  277. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  278. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  279. &quot;joined_members&quot;: 314,
  280. &quot;joined_local_members&quot;: 20,
  281. &quot;version&quot;: &quot;4&quot;,
  282. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  283. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  284. &quot;federatable&quot;: true,
  285. &quot;public&quot;: false,
  286. &quot;join_rules&quot;: &quot;invite&quot;,
  287. &quot;guest_access&quot;: null,
  288. &quot;history_visibility&quot;: &quot;shared&quot;,
  289. &quot;state_events&quot;: 8
  290. }
  291. ],
  292. &quot;offset&quot;: 0,
  293. &quot;total_rooms&quot;: 1
  294. }
  295. </code></pre>
  296. <p>Paginating through a list of rooms:</p>
  297. <pre><code>GET /_synapse/admin/v1/rooms?order_by=size
  298. </code></pre>
  299. <p>A response body like the following is returned:</p>
  300. <pre><code class="language-jsonc">{
  301. &quot;rooms&quot;: [
  302. {
  303. &quot;room_id&quot;: &quot;!OGEhHVWSdvArJzumhm:matrix.org&quot;,
  304. &quot;name&quot;: &quot;Matrix HQ&quot;,
  305. &quot;canonical_alias&quot;: &quot;#matrix:matrix.org&quot;,
  306. &quot;joined_members&quot;: 8326,
  307. &quot;joined_local_members&quot;: 2,
  308. &quot;version&quot;: &quot;1&quot;,
  309. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  310. &quot;encryption&quot;: null,
  311. &quot;federatable&quot;: true,
  312. &quot;public&quot;: true,
  313. &quot;join_rules&quot;: &quot;invite&quot;,
  314. &quot;guest_access&quot;: null,
  315. &quot;history_visibility&quot;: &quot;shared&quot;,
  316. &quot;state_events&quot;: 93534
  317. },
  318. ... (98 hidden items) ...
  319. {
  320. &quot;room_id&quot;: &quot;!xYvNcQPhnkrdUmYczI:matrix.org&quot;,
  321. &quot;name&quot;: &quot;This Week In Matrix (TWIM)&quot;,
  322. &quot;canonical_alias&quot;: &quot;#twim:matrix.org&quot;,
  323. &quot;joined_members&quot;: 314,
  324. &quot;joined_local_members&quot;: 20,
  325. &quot;version&quot;: &quot;4&quot;,
  326. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  327. &quot;encryption&quot;: &quot;m.megolm.v1.aes-sha2&quot;,
  328. &quot;federatable&quot;: true,
  329. &quot;public&quot;: false,
  330. &quot;join_rules&quot;: &quot;invite&quot;,
  331. &quot;guest_access&quot;: null,
  332. &quot;history_visibility&quot;: &quot;shared&quot;,
  333. &quot;state_events&quot;: 8345
  334. }
  335. ],
  336. &quot;offset&quot;: 0,
  337. &quot;total_rooms&quot;: 150
  338. &quot;next_token&quot;: 100
  339. }
  340. </code></pre>
  341. <p>The presence of the <code>next_token</code> parameter tells us that there are more rooms
  342. than returned in this request, and we need to make another request to get them.
  343. To get the next batch of room results, we repeat our request, setting the <code>from</code>
  344. parameter to the value of <code>next_token</code>.</p>
  345. <pre><code>GET /_synapse/admin/v1/rooms?order_by=size&amp;from=100
  346. </code></pre>
  347. <p>A response body like the following is returned:</p>
  348. <pre><code class="language-jsonc">{
  349. &quot;rooms&quot;: [
  350. {
  351. &quot;room_id&quot;: &quot;!mscvqgqpHYjBGDxNym:matrix.org&quot;,
  352. &quot;name&quot;: &quot;Music Theory&quot;,
  353. &quot;canonical_alias&quot;: &quot;#musictheory:matrix.org&quot;,
  354. &quot;joined_members&quot;: 127,
  355. &quot;joined_local_members&quot;: 2,
  356. &quot;version&quot;: &quot;1&quot;,
  357. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  358. &quot;encryption&quot;: null,
  359. &quot;federatable&quot;: true,
  360. &quot;public&quot;: true,
  361. &quot;join_rules&quot;: &quot;invite&quot;,
  362. &quot;guest_access&quot;: null,
  363. &quot;history_visibility&quot;: &quot;shared&quot;,
  364. &quot;state_events&quot;: 93534
  365. },
  366. ... (48 hidden items) ...
  367. {
  368. &quot;room_id&quot;: &quot;!twcBhHVdZlQWuuxBhN:termina.org.uk&quot;,
  369. &quot;name&quot;: &quot;weechat-matrix&quot;,
  370. &quot;canonical_alias&quot;: &quot;#weechat-matrix:termina.org.uk&quot;,
  371. &quot;joined_members&quot;: 137,
  372. &quot;joined_local_members&quot;: 20,
  373. &quot;version&quot;: &quot;4&quot;,
  374. &quot;creator&quot;: &quot;@foo:termina.org.uk&quot;,
  375. &quot;encryption&quot;: null,
  376. &quot;federatable&quot;: true,
  377. &quot;public&quot;: true,
  378. &quot;join_rules&quot;: &quot;invite&quot;,
  379. &quot;guest_access&quot;: null,
  380. &quot;history_visibility&quot;: &quot;shared&quot;,
  381. &quot;state_events&quot;: 8345
  382. }
  383. ],
  384. &quot;offset&quot;: 100,
  385. &quot;prev_batch&quot;: 0,
  386. &quot;total_rooms&quot;: 150
  387. }
  388. </code></pre>
  389. <p>Once the <code>next_token</code> parameter is no longer present, we know we've reached the
  390. end of the list.</p>
  391. <h1 id="room-details-api"><a class="header" href="#room-details-api">Room Details API</a></h1>
  392. <p>The Room Details admin API allows server admins to get all details of a room.</p>
  393. <p>The following fields are possible in the JSON response body:</p>
  394. <ul>
  395. <li><code>room_id</code> - The ID of the room.</li>
  396. <li><code>name</code> - The name of the room.</li>
  397. <li><code>topic</code> - The topic of the room.</li>
  398. <li><code>avatar</code> - The <code>mxc</code> URI to the avatar of the room.</li>
  399. <li><code>canonical_alias</code> - The canonical (main) alias address of the room.</li>
  400. <li><code>joined_members</code> - How many users are currently in the room.</li>
  401. <li><code>joined_local_members</code> - How many local users are currently in the room.</li>
  402. <li><code>joined_local_devices</code> - How many local devices are currently in the room.</li>
  403. <li><code>version</code> - The version of the room as a string.</li>
  404. <li><code>creator</code> - The <code>user_id</code> of the room creator.</li>
  405. <li><code>encryption</code> - Algorithm of end-to-end encryption of messages. Is <code>null</code> if encryption is not active.</li>
  406. <li><code>federatable</code> - Whether users on other servers can join this room.</li>
  407. <li><code>public</code> - Whether the room is visible in room directory.</li>
  408. <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>
  409. <li><code>guest_access</code> - Whether guests can join the room. One of: [&quot;can_join&quot;, &quot;forbidden&quot;].</li>
  410. <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>
  411. <li><code>state_events</code> - Total number of state_events of a room. Complexity of the room.</li>
  412. </ul>
  413. <p>The API is:</p>
  414. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;
  415. </code></pre>
  416. <p>A response body like the following is returned:</p>
  417. <pre><code class="language-json">{
  418. &quot;room_id&quot;: &quot;!mscvqgqpHYjBGDxNym:matrix.org&quot;,
  419. &quot;name&quot;: &quot;Music Theory&quot;,
  420. &quot;avatar&quot;: &quot;mxc://matrix.org/AQDaVFlbkQoErdOgqWRgiGSV&quot;,
  421. &quot;topic&quot;: &quot;Theory, Composition, Notation, Analysis&quot;,
  422. &quot;canonical_alias&quot;: &quot;#musictheory:matrix.org&quot;,
  423. &quot;joined_members&quot;: 127,
  424. &quot;joined_local_members&quot;: 2,
  425. &quot;joined_local_devices&quot;: 2,
  426. &quot;version&quot;: &quot;1&quot;,
  427. &quot;creator&quot;: &quot;@foo:matrix.org&quot;,
  428. &quot;encryption&quot;: null,
  429. &quot;federatable&quot;: true,
  430. &quot;public&quot;: true,
  431. &quot;join_rules&quot;: &quot;invite&quot;,
  432. &quot;guest_access&quot;: null,
  433. &quot;history_visibility&quot;: &quot;shared&quot;,
  434. &quot;state_events&quot;: 93534
  435. }
  436. </code></pre>
  437. <h1 id="room-members-api"><a class="header" href="#room-members-api">Room Members API</a></h1>
  438. <p>The Room Members admin API allows server admins to get a list of all members of a room.</p>
  439. <p>The response includes the following fields:</p>
  440. <ul>
  441. <li><code>members</code> - A list of all the members that are present in the room, represented by their ids.</li>
  442. <li><code>total</code> - Total number of members in the room.</li>
  443. </ul>
  444. <p>The API is:</p>
  445. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/members
  446. </code></pre>
  447. <p>A response body like the following is returned:</p>
  448. <pre><code class="language-json">{
  449. &quot;members&quot;: [
  450. &quot;@foo:matrix.org&quot;,
  451. &quot;@bar:matrix.org&quot;,
  452. &quot;@foobar:matrix.org&quot;
  453. ],
  454. &quot;total&quot;: 3
  455. }
  456. </code></pre>
  457. <h1 id="room-state-api"><a class="header" href="#room-state-api">Room State API</a></h1>
  458. <p>The Room State admin API allows server admins to get a list of all state events in a room.</p>
  459. <p>The response includes the following fields:</p>
  460. <ul>
  461. <li><code>state</code> - The current state of the room at the time of request.</li>
  462. </ul>
  463. <p>The API is:</p>
  464. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/state
  465. </code></pre>
  466. <p>A response body like the following is returned:</p>
  467. <pre><code class="language-json">{
  468. &quot;state&quot;: [
  469. {&quot;type&quot;: &quot;m.room.create&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true},
  470. {&quot;type&quot;: &quot;m.room.power_levels&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true},
  471. {&quot;type&quot;: &quot;m.room.name&quot;, &quot;state_key&quot;: &quot;&quot;, &quot;etc&quot;: true}
  472. ]
  473. }
  474. </code></pre>
  475. <h1 id="delete-room-api"><a class="header" href="#delete-room-api">Delete Room API</a></h1>
  476. <p>The Delete Room admin API allows server admins to remove rooms from server
  477. and block these rooms.</p>
  478. <p>Shuts down a room. Moves all local users and room aliases automatically to a
  479. new room if <code>new_room_user_id</code> is set. Otherwise local users only
  480. leave the room without any information.</p>
  481. <p>The new room will be created with the user specified by the <code>new_room_user_id</code> parameter
  482. as room administrator and will contain a message explaining what happened. Users invited
  483. to the new room will have power level <code>-10</code> by default, and thus be unable to speak.</p>
  484. <p>If <code>block</code> is <code>True</code> it prevents new joins to the old room.</p>
  485. <p>This API will remove all trace of the old room from your database after removing
  486. all local users. If <code>purge</code> is <code>true</code> (the default), all traces of the old room will
  487. be removed from your database after removing all local users. If you do not want
  488. this to happen, set <code>purge</code> to <code>false</code>.
  489. Depending on the amount of history being purged a call to the API may take
  490. several minutes or longer.</p>
  491. <p>The local server will only have the power to move local user and room aliases to
  492. the new room. Users on other servers will be unaffected.</p>
  493. <p>The API is:</p>
  494. <pre><code>DELETE /_synapse/admin/v1/rooms/&lt;room_id&gt;
  495. </code></pre>
  496. <p>with a body of:</p>
  497. <pre><code class="language-json">{
  498. &quot;new_room_user_id&quot;: &quot;@someuser:example.com&quot;,
  499. &quot;room_name&quot;: &quot;Content Violation Notification&quot;,
  500. &quot;message&quot;: &quot;Bad Room has been shutdown due to content violations on this server. Please review our Terms of Service.&quot;,
  501. &quot;block&quot;: true,
  502. &quot;purge&quot;: true
  503. }
  504. </code></pre>
  505. <p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
  506. server admin: see <a href="../usage/administration/admin_api">Admin API</a>.</p>
  507. <p>A response body like the following is returned:</p>
  508. <pre><code class="language-json">{
  509. &quot;kicked_users&quot;: [
  510. &quot;@foobar:example.com&quot;
  511. ],
  512. &quot;failed_to_kick_users&quot;: [],
  513. &quot;local_aliases&quot;: [
  514. &quot;#badroom:example.com&quot;,
  515. &quot;#evilsaloon:example.com&quot;
  516. ],
  517. &quot;new_room_id&quot;: &quot;!newroomid:example.com&quot;
  518. }
  519. </code></pre>
  520. <p><strong>Parameters</strong></p>
  521. <p>The following parameters should be set in the URL:</p>
  522. <ul>
  523. <li><code>room_id</code> - The ID of the room.</li>
  524. </ul>
  525. <p>The following JSON body parameters are available:</p>
  526. <ul>
  527. <li><code>new_room_user_id</code> - Optional. If set, a new room will be created with this user ID
  528. as the creator and admin, and all users in the old room will be moved into that
  529. room. If not set, no new room will be created and the users will just be removed
  530. from the old room. The user ID must be on the local server, but does not necessarily
  531. have to belong to a registered user.</li>
  532. <li><code>room_name</code> - Optional. A string representing the name of the room that new users will be
  533. invited to. Defaults to <code>Content Violation Notification</code></li>
  534. <li><code>message</code> - Optional. A string containing the first message that will be sent as
  535. <code>new_room_user_id</code> in the new room. Ideally this will clearly convey why the
  536. 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>
  537. <li><code>block</code> - Optional. If set to <code>true</code>, this room will be added to a blocking list, preventing
  538. future attempts to join the room. Defaults to <code>false</code>.</li>
  539. <li><code>purge</code> - Optional. If set to <code>true</code>, it will remove all traces of the room from your database.
  540. Defaults to <code>true</code>.</li>
  541. <li><code>force_purge</code> - Optional, and ignored unless <code>purge</code> is <code>true</code>. If set to <code>true</code>, it
  542. will force a purge to go ahead even if there are local users still in the room. Do not
  543. use this unless a regular <code>purge</code> operation fails, as it could leave those users'
  544. clients in a confused state.</li>
  545. </ul>
  546. <p>The JSON body must not be empty. The body must be at least <code>{}</code>.</p>
  547. <p><strong>Response</strong></p>
  548. <p>The following fields are returned in the JSON response body:</p>
  549. <ul>
  550. <li><code>kicked_users</code> - An array of users (<code>user_id</code>) that were kicked.</li>
  551. <li><code>failed_to_kick_users</code> - An array of users (<code>user_id</code>) that that were not kicked.</li>
  552. <li><code>local_aliases</code> - An array of strings representing the local aliases that were migrated from
  553. the old room to the new.</li>
  554. <li><code>new_room_id</code> - A string representing the room ID of the new room.</li>
  555. </ul>
  556. <h2 id="undoing-room-deletions"><a class="header" href="#undoing-room-deletions">Undoing room deletions</a></h2>
  557. <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,
  558. the structure can and does change without notice.</p>
  559. <p>First, it's important to understand that a room deletion is very destructive. Undoing a deletion is not as simple as pretending it
  560. 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
  561. to recover at all:</p>
  562. <ul>
  563. <li>If the room was invite-only, your users will need to be re-invited.</li>
  564. <li>If the room no longer has any members at all, it'll be impossible to rejoin.</li>
  565. <li>The first user to rejoin will have to do so via an alias on a different
  566. server (or receive an invite from a user on a different server).</li>
  567. </ul>
  568. <p>With all that being said, if you still want to try and recover the room:</p>
  569. <ol>
  570. <li>
  571. <p>If the room was <code>block</code>ed, you must unblock it on your server. This can be
  572. accomplished as follows:</p>
  573. <ol>
  574. <li>For safety reasons, shut down Synapse.</li>
  575. <li>In the database, run <code>DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';</code>
  576. <ul>
  577. <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>
  578. <li>The room ID is the same one supplied to the delete room API, not the Content Violation room.</li>
  579. </ul>
  580. </li>
  581. <li>Restart Synapse.</li>
  582. </ol>
  583. <p>This step is unnecessary if <code>block</code> was not set.</p>
  584. </li>
  585. <li>
  586. <p>Any room aliases on your server that pointed to the deleted room may have
  587. been deleted, or redirected to the Content Violation room. These will need
  588. to be restored manually.</p>
  589. </li>
  590. <li>
  591. <p>Users on your server that were in the deleted room will have been kicked
  592. from the room. Consider whether you want to update their membership
  593. (possibly via the <a href="room_membership.html">Edit Room Membership API</a>) or let
  594. them handle rejoining themselves.</p>
  595. </li>
  596. <li>
  597. <p>If <code>new_room_user_id</code> was given, a 'Content Violation' will have been
  598. created. Consider whether you want to delete that roomm.</p>
  599. </li>
  600. </ol>
  601. <h2 id="deprecated-endpoint"><a class="header" href="#deprecated-endpoint">Deprecated endpoint</a></h2>
  602. <p>The previous deprecated API will be removed in a future release, it was:</p>
  603. <pre><code>POST /_synapse/admin/v1/rooms/&lt;room_id&gt;/delete
  604. </code></pre>
  605. <p>It behaves the same way than the current endpoint except the path and the method.</p>
  606. <h1 id="make-room-admin-api"><a class="header" href="#make-room-admin-api">Make Room Admin API</a></h1>
  607. <p>Grants another user the highest power available to a local user who is in the room.
  608. If the user is not in the room, and it is not publicly joinable, then invite the user.</p>
  609. <p>By default the server admin (the caller) is granted power, but another user can
  610. optionally be specified, e.g.:</p>
  611. <pre><code>POST /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/make_room_admin
  612. {
  613. &quot;user_id&quot;: &quot;@foo:example.com&quot;
  614. }
  615. </code></pre>
  616. <h1 id="forward-extremities-admin-api"><a class="header" href="#forward-extremities-admin-api">Forward Extremities Admin API</a></h1>
  617. <p>Enables querying and deleting forward extremities from rooms. When a lot of forward
  618. extremities accumulate in a room, performance can become degraded. For details, see
  619. <a href="https://github.com/matrix-org/synapse/issues/1760">#1760</a>.</p>
  620. <h2 id="check-for-forward-extremities"><a class="header" href="#check-for-forward-extremities">Check for forward extremities</a></h2>
  621. <p>To check the status of forward extremities for a room:</p>
  622. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/forward_extremities
  623. </code></pre>
  624. <p>A response as follows will be returned:</p>
  625. <pre><code class="language-json">{
  626. &quot;count&quot;: 1,
  627. &quot;results&quot;: [
  628. {
  629. &quot;event_id&quot;: &quot;$M5SP266vsnxctfwFgFLNceaCo3ujhRtg_NiiHabcdefgh&quot;,
  630. &quot;state_group&quot;: 439,
  631. &quot;depth&quot;: 123,
  632. &quot;received_ts&quot;: 1611263016761
  633. }
  634. ]
  635. }
  636. </code></pre>
  637. <h2 id="deleting-forward-extremities"><a class="header" href="#deleting-forward-extremities">Deleting forward extremities</a></h2>
  638. <p><strong>WARNING</strong>: Please ensure you know what you're doing and have read
  639. the related issue <a href="https://github.com/matrix-org/synapse/issues/1760">#1760</a>.
  640. Under no situations should this API be executed as an automated maintenance task!</p>
  641. <p>If a room has lots of forward extremities, the extra can be
  642. deleted as follows:</p>
  643. <pre><code>DELETE /_synapse/admin/v1/rooms/&lt;room_id_or_alias&gt;/forward_extremities
  644. </code></pre>
  645. <p>A response as follows will be returned, indicating the amount of forward extremities
  646. that were deleted.</p>
  647. <pre><code class="language-json">{
  648. &quot;deleted&quot;: 1
  649. }
  650. </code></pre>
  651. <h1 id="event-context-api"><a class="header" href="#event-context-api">Event Context API</a></h1>
  652. <p>This API lets a client find the context of an event. This is designed primarily to investigate abuse reports.</p>
  653. <pre><code>GET /_synapse/admin/v1/rooms/&lt;room_id&gt;/context/&lt;event_id&gt;
  654. </code></pre>
  655. <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>
  656. <p>Example response:</p>
  657. <pre><code class="language-json">{
  658. &quot;end&quot;: &quot;t29-57_2_0_2&quot;,
  659. &quot;events_after&quot;: [
  660. {
  661. &quot;content&quot;: {
  662. &quot;body&quot;: &quot;This is an example text message&quot;,
  663. &quot;msgtype&quot;: &quot;m.text&quot;,
  664. &quot;format&quot;: &quot;org.matrix.custom.html&quot;,
  665. &quot;formatted_body&quot;: &quot;&lt;b&gt;This is an example text message&lt;/b&gt;&quot;
  666. },
  667. &quot;type&quot;: &quot;m.room.message&quot;,
  668. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  669. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  670. &quot;sender&quot;: &quot;@example:example.org&quot;,
  671. &quot;origin_server_ts&quot;: 1432735824653,
  672. &quot;unsigned&quot;: {
  673. &quot;age&quot;: 1234
  674. }
  675. }
  676. ],
  677. &quot;event&quot;: {
  678. &quot;content&quot;: {
  679. &quot;body&quot;: &quot;filename.jpg&quot;,
  680. &quot;info&quot;: {
  681. &quot;h&quot;: 398,
  682. &quot;w&quot;: 394,
  683. &quot;mimetype&quot;: &quot;image/jpeg&quot;,
  684. &quot;size&quot;: 31037
  685. },
  686. &quot;url&quot;: &quot;mxc://example.org/JWEIFJgwEIhweiWJE&quot;,
  687. &quot;msgtype&quot;: &quot;m.image&quot;
  688. },
  689. &quot;type&quot;: &quot;m.room.message&quot;,
  690. &quot;event_id&quot;: &quot;$f3h4d129462ha:example.com&quot;,
  691. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  692. &quot;sender&quot;: &quot;@example:example.org&quot;,
  693. &quot;origin_server_ts&quot;: 1432735824653,
  694. &quot;unsigned&quot;: {
  695. &quot;age&quot;: 1234
  696. }
  697. },
  698. &quot;events_before&quot;: [
  699. {
  700. &quot;content&quot;: {
  701. &quot;body&quot;: &quot;something-important.doc&quot;,
  702. &quot;filename&quot;: &quot;something-important.doc&quot;,
  703. &quot;info&quot;: {
  704. &quot;mimetype&quot;: &quot;application/msword&quot;,
  705. &quot;size&quot;: 46144
  706. },
  707. &quot;msgtype&quot;: &quot;m.file&quot;,
  708. &quot;url&quot;: &quot;mxc://example.org/FHyPlCeYUSFFxlgbQYZmoEoe&quot;
  709. },
  710. &quot;type&quot;: &quot;m.room.message&quot;,
  711. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  712. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  713. &quot;sender&quot;: &quot;@example:example.org&quot;,
  714. &quot;origin_server_ts&quot;: 1432735824653,
  715. &quot;unsigned&quot;: {
  716. &quot;age&quot;: 1234
  717. }
  718. }
  719. ],
  720. &quot;start&quot;: &quot;t27-54_2_0_2&quot;,
  721. &quot;state&quot;: [
  722. {
  723. &quot;content&quot;: {
  724. &quot;creator&quot;: &quot;@example:example.org&quot;,
  725. &quot;room_version&quot;: &quot;1&quot;,
  726. &quot;m.federate&quot;: true,
  727. &quot;predecessor&quot;: {
  728. &quot;event_id&quot;: &quot;$something:example.org&quot;,
  729. &quot;room_id&quot;: &quot;!oldroom:example.org&quot;
  730. }
  731. },
  732. &quot;type&quot;: &quot;m.room.create&quot;,
  733. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  734. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  735. &quot;sender&quot;: &quot;@example:example.org&quot;,
  736. &quot;origin_server_ts&quot;: 1432735824653,
  737. &quot;unsigned&quot;: {
  738. &quot;age&quot;: 1234
  739. },
  740. &quot;state_key&quot;: &quot;&quot;
  741. },
  742. {
  743. &quot;content&quot;: {
  744. &quot;membership&quot;: &quot;join&quot;,
  745. &quot;avatar_url&quot;: &quot;mxc://example.org/SEsfnsuifSDFSSEF&quot;,
  746. &quot;displayname&quot;: &quot;Alice Margatroid&quot;
  747. },
  748. &quot;type&quot;: &quot;m.room.member&quot;,
  749. &quot;event_id&quot;: &quot;$143273582443PhrSn:example.org&quot;,
  750. &quot;room_id&quot;: &quot;!636q39766251:example.com&quot;,
  751. &quot;sender&quot;: &quot;@example:example.org&quot;,
  752. &quot;origin_server_ts&quot;: 1432735824653,
  753. &quot;unsigned&quot;: {
  754. &quot;age&quot;: 1234
  755. },
  756. &quot;state_key&quot;: &quot;@alice:example.org&quot;
  757. }
  758. ]
  759. }
  760. </code></pre>
  761. </main>
  762. <nav class="nav-wrapper" aria-label="Page navigation">
  763. <!-- Mobile navigation buttons -->
  764. <a rel="prev" href="../admin_api/room_membership.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  765. <i class="fa fa-angle-left"></i>
  766. </a>
  767. <a rel="next" href="../admin_api/server_notices.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  768. <i class="fa fa-angle-right"></i>
  769. </a>
  770. <div style="clear: both"></div>
  771. </nav>
  772. </div>
  773. </div>
  774. <nav class="nav-wide-wrapper" aria-label="Page navigation">
  775. <a rel="prev" href="../admin_api/room_membership.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
  776. <i class="fa fa-angle-left"></i>
  777. </a>
  778. <a rel="next" href="../admin_api/server_notices.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
  779. <i class="fa fa-angle-right"></i>
  780. </a>
  781. </nav>
  782. </div>
  783. <script type="text/javascript">
  784. window.playground_copyable = true;
  785. </script>
  786. <script src="../elasticlunr.min.js" type="text/javascript" charset="utf-8"></script>
  787. <script src="../mark.min.js" type="text/javascript" charset="utf-8"></script>
  788. <script src="../searcher.js" type="text/javascript" charset="utf-8"></script>
  789. <script src="../clipboard.min.js" type="text/javascript" charset="utf-8"></script>
  790. <script src="../highlight.js" type="text/javascript" charset="utf-8"></script>
  791. <script src="../book.js" type="text/javascript" charset="utf-8"></script>
  792. <!-- Custom JS scripts -->
  793. <script type="text/javascript" src="../docs/website_files/table-of-contents.js"></script>
  794. </body>
  795. </html>