rooms.html 50 KB

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