1
0
This commit is contained in:
reivilibre
2022-01-31 16:25:00 +00:00
parent 05b406dd7c
commit 7c06ce4e65
12 changed files with 42 additions and 132 deletions

View File

@@ -183,13 +183,13 @@
</div>
<h1 id="user-admin-api"><a class="header" href="#user-admin-api">User Admin API</a></h1>
<p>To use it, you will need to authenticate by providing an <code>access_token</code>
for a server admin: see <a href="../usage/administration/admin_api">Admin API</a>.</p>
<h2 id="query-user-account"><a class="header" href="#query-user-account">Query User Account</a></h2>
<p>This API returns information about a specific user account.</p>
<p>The api is:</p>
<pre><code>GET /_synapse/admin/v2/users/&lt;user_id&gt;
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>It returns a JSON body like the following:</p>
<pre><code class="language-jsonc">{
&quot;name&quot;: &quot;@user:example.com&quot;,
@@ -270,8 +270,6 @@ specific <code>user_id</code>.</p>
&quot;user_type&quot;: null
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>Returns HTTP status code:</p>
<ul>
<li><code>201</code> - When a new user object was created.</li>
@@ -322,8 +320,6 @@ users do not login via single-sign-on, a new <code>password</code> must be provi
By default, the response is ordered by ascending user ID.</p>
<pre><code>GET /_synapse/admin/v2/users?from=0&amp;limit=10&amp;guests=false
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;users&quot;: [
@@ -447,8 +443,6 @@ This allows user type specific behaviour. There are also types <code>support</co
</code></pre>
<p>See also: <a href="https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid">Client Server
API Whois</a>.</p>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>It returns a JSON body like the following:</p>
<pre><code class="language-json">{
&quot;user_id&quot;: &quot;&lt;user_id&gt;&quot;,
@@ -490,8 +484,6 @@ were sent, but hidden from users joining the room afterwards.</p>
&quot;erase&quot;: true
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>The erase parameter is optional and defaults to <code>false</code>.
An empty body may be passed for backwards compatibility.</p>
<p>The following actions are performed when deactivating an user:</p>
@@ -542,16 +534,12 @@ is set to <code>true</code>:</p>
&quot;logout_devices&quot;: true
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>The parameter <code>new_password</code> is required.
The parameter <code>logout_devices</code> is optional and defaults to <code>true</code>.</p>
<h2 id="get-whether-a-user-is-a-server-administrator-or-not"><a class="header" href="#get-whether-a-user-is-a-server-administrator-or-not">Get whether a user is a server administrator or not</a></h2>
<p>The api is:</p>
<pre><code>GET /_synapse/admin/v1/users/&lt;user_id&gt;/admin
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;admin&quot;: true
@@ -567,15 +555,11 @@ server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
&quot;admin&quot;: true
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<h2 id="list-room-memberships-of-a-user"><a class="header" href="#list-room-memberships-of-a-user">List room memberships of a user</a></h2>
<p>Gets a list of all <code>room_id</code> that a specific <code>user_id</code> is member.</p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v1/users/&lt;user_id&gt;/joined_rooms
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json"> {
&quot;joined_rooms&quot;: [
@@ -677,8 +661,6 @@ The newest media is on top. You can change the order with parameters
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v1/users/&lt;user_id&gt;/media
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;media&quot;: [
@@ -790,8 +772,6 @@ The newest media is deleted first. You can change the order with parameters
<p>The API is:</p>
<pre><code>DELETE /_synapse/admin/v1/users/&lt;user_id&gt;/media
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;deleted_media&quot;: [
@@ -840,8 +820,6 @@ same.</p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v2/users/&lt;user_id&gt;/devices
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;devices&quot;: [
@@ -902,8 +880,6 @@ any access token associated with them.</p>
],
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>An empty JSON dict is returned.</p>
<p><strong>Parameters</strong></p>
<p>The following parameters should be set in the URL:</p>
@@ -919,8 +895,6 @@ server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v2/users/&lt;user_id&gt;/devices/&lt;device_id&gt;
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;device_id&quot;: &quot;&lt;device_id&gt;&quot;,
@@ -957,8 +931,6 @@ devices was last seen. (May be a few minutes out of date, for efficiency reasons
&quot;display_name&quot;: &quot;My other phone&quot;
}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>An empty JSON dict is returned.</p>
<p><strong>Parameters</strong></p>
<p>The following parameters should be set in the URL:</p>
@@ -979,8 +951,6 @@ and invalidates any access token associated with it.</p>
{}
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>An empty JSON dict is returned.</p>
<p><strong>Parameters</strong></p>
<p>The following parameters should be set in the URL:</p>
@@ -993,8 +963,6 @@ server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v1/users/&lt;user_id&gt;/pushers
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;pushers&quot;: [
@@ -1093,8 +1061,6 @@ A shadow-banned user will be unable to contact anyone on the server.</p>
<p>To un-shadow-ban a user the API is:</p>
<pre><code>DELETE /_synapse/admin/v1/users/&lt;user_id&gt;/shadow_ban
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>An empty JSON dict is returned in both cases.</p>
<p><strong>Parameters</strong></p>
<p>The following parameters should be set in the URL:</p>
@@ -1109,8 +1075,6 @@ There are specific APIs to set, get and delete a ratelimit.</p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v1/users/&lt;user_id&gt;/override_ratelimit
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;messages_per_second&quot;: 0,
@@ -1138,8 +1102,6 @@ being limited.</li>
<p>The API is:</p>
<pre><code>POST /_synapse/admin/v1/users/&lt;user_id&gt;/override_ratelimit
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>A response body like the following is returned:</p>
<pre><code class="language-json">{
&quot;messages_per_second&quot;: 0,
@@ -1172,8 +1134,6 @@ being limited.</li>
<p>The API is:</p>
<pre><code>DELETE /_synapse/admin/v1/users/&lt;user_id&gt;/override_ratelimit
</code></pre>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>An empty JSON dict is returned.</p>
<pre><code class="language-json">{}
</code></pre>
@@ -1192,9 +1152,8 @@ for more information.</p>
<p>The API is:</p>
<pre><code>GET /_synapse/admin/v1/username_available?username=$localpart
</code></pre>
<p>The request and response format is the same as the <a href="https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available">/_matrix/client/r0/register/available</a> API.</p>
<p>To use it, you will need to authenticate by providing an <code>access_token</code> for a
server admin: <a href="../usage/administration/admin_api">Admin API</a></p>
<p>The request and response format is the same as the
<a href="https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available">/_matrix/client/r0/register/available</a> API.</p>
</main>