summary refs log tree commit diff
path: root/latest/admin_api/user_admin_api.html
diff options
context:
space:
mode:
authorerikjohnston <erikjohnston@users.noreply.github.com>2021-08-24 16:08:09 +0000
committererikjohnston <erikjohnston@users.noreply.github.com>2021-08-24 16:08:09 +0000
commitc14582101be8646429d3c4d5c69d13d4df3e4e16 (patch)
treeffd914f32ab09a34799c8eaecf6233193a04035c /latest/admin_api/user_admin_api.html
parentdeploy: 86415f162d5dca9f38054a76e00130d947f2e8e2 (diff)
downloadsynapse-c14582101be8646429d3c4d5c69d13d4df3e4e16.tar.xz
deploy: f03cafb50c49a1569f1f99485f9cc42abfdc7b21
Diffstat (limited to 'latest/admin_api/user_admin_api.html')
-rw-r--r--latest/admin_api/user_admin_api.html155
1 files changed, 99 insertions, 56 deletions
diff --git a/latest/admin_api/user_admin_api.html b/latest/admin_api/user_admin_api.html

index a6a1be7f97..33e351185d 100644 --- a/latest/admin_api/user_admin_api.html +++ b/latest/admin_api/user_admin_api.html
@@ -99,7 +99,7 @@ <nav id="sidebar" class="sidebar" aria-label="Table of contents"> <div class="sidebar-scrollbox"> - <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="../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="../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="../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.html">Pluggable Modules</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Third Party Rules</div></li><li class="chapter-item expanded "><a href="../spam_checker.html">Spam Checker</a></li><li class="chapter-item expanded "><a href="../presence_router_module.html">Presence Router</a></li><li class="chapter-item expanded "><div>Media Storage Providers</div></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/purge_room.html">Purge Rooms</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="../admin_api/room_membership.html">Manipulate Room Membership</a></li><li class="chapter-item expanded "><a href="../admin_api/rooms.html">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/shutdown_room.html">Shutdown Room</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" class="active">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> + <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="../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.html">Pluggable Modules</a></li><li><ol class="section"><li class="chapter-item expanded "><div>Third Party Rules</div></li><li class="chapter-item expanded "><a href="../spam_checker.html">Spam Checker</a></li><li class="chapter-item expanded "><a href="../presence_router_module.html">Presence Router</a></li><li class="chapter-item expanded "><div>Media Storage Providers</div></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/purge_room.html">Purge Rooms</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="../admin_api/room_membership.html">Manipulate Room Membership</a></li><li class="chapter-item expanded "><a href="../admin_api/rooms.html">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/shutdown_room.html">Shutdown Room</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" class="active">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> </div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> @@ -248,6 +248,16 @@ specific <code>user_id</code>.</p> &quot;address&quot;: &quot;&lt;user_mail_2&gt;&quot; } ], + &quot;external_ids&quot;: [ + { + &quot;auth_provider&quot;: &quot;&lt;provider1&gt;&quot;, + &quot;external_id&quot;: &quot;&lt;user_id_provider_1&gt;&quot; + }, + { + &quot;auth_provider&quot;: &quot;&lt;provider2&gt;&quot;, + &quot;external_id&quot;: &quot;&lt;user_id_provider_2&gt;&quot; + } + ], &quot;avatar_url&quot;: &quot;&lt;avatar_url&gt;&quot;, &quot;admin&quot;: false, &quot;deactivated&quot;: false @@ -255,36 +265,44 @@ specific <code>user_id</code>.</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>Returns HTTP status code:</p> +<ul> +<li><code>201</code> - When a new user object was created.</li> +<li><code>200</code> - When a user was modified.</li> +</ul> <p>URL parameters:</p> <ul> <li><code>user_id</code>: fully-qualified user id: for example, <code>@user:server.com</code>.</li> </ul> <p>Body parameters:</p> <ul> -<li> -<p><code>password</code>, optional. If provided, the user's password is updated and all -devices are logged out.</p> -</li> -<li> -<p><code>displayname</code>, optional, defaults to the value of <code>user_id</code>.</p> -</li> -<li> -<p><code>threepids</code>, optional, allows setting the third-party IDs (email, msisdn) -belonging to a user.</p> -</li> -<li> -<p><code>avatar_url</code>, optional, must be a -<a href="https://matrix.org/docs/spec/client_server/r0.6.0#matrix-content-mxc-uris">MXC URI</a>.</p> +<li><code>password</code> - string, optional. If provided, the user's password is updated and all +devices are logged out.</li> +<li><code>displayname</code> - string, optional, defaults to the value of <code>user_id</code>.</li> +<li><code>threepids</code> - array, optional, allows setting the third-party IDs (email, msisdn) +<ul> +<li><code>medium</code> - string. Kind of third-party ID, either <code>email</code> or <code>msisdn</code>.</li> +<li><code>address</code> - string. Value of third-party ID. +belonging to a user.</li> +</ul> </li> -<li> -<p><code>admin</code>, optional, defaults to <code>false</code>.</p> +<li><code>external_ids</code> - array, optional. Allow setting the identifier of the external identity +provider for SSO (Single sign-on). Details in +<a href="../usage/configuration/homeserver_sample_config.html">Sample Configuration File</a> +section <code>sso</code> and <code>oidc_providers</code>. +<ul> +<li><code>auth_provider</code> - string. ID of the external identity provider. Value of <code>idp_id</code> +in homeserver configuration.</li> +<li><code>external_id</code> - string, user ID in the external identity provider.</li> +</ul> </li> -<li> -<p><code>deactivated</code>, optional. If unspecified, deactivation state will be left +<li><code>avatar_url</code> - string, optional, must be a +<a href="https://matrix.org/docs/spec/client_server/r0.6.0#matrix-content-mxc-uris">MXC URI</a>.</li> +<li><code>admin</code> - bool, optional, defaults to <code>false</code>.</li> +<li><code>deactivated</code> - bool, optional. If unspecified, deactivation state will be left unchanged on existing accounts and set to <code>false</code> for new accounts. A user cannot be erased by deactivating with this API. For details on -deactivating users see <a href="#deactivate-account">Deactivate Account</a>.</p> -</li> +deactivating users see <a href="#deactivate-account">Deactivate Account</a>.</li> </ul> <p>If the user already exists then optional parameters default to the current value.</p> <p>In order to re-activate an account <code>deactivated</code> must be set to <code>false</code>. If @@ -553,7 +571,8 @@ member are returned.</p> <li><code>joined_rooms</code> - An array of <code>room_id</code>.</li> <li><code>total</code> - Number of rooms.</li> </ul> -<h2 id="list-media-of-a-user"><a class="header" href="#list-media-of-a-user">List media of a user</a></h2> +<h2 id="user-media"><a class="header" href="#user-media">User media</a></h2> +<h3 id="list-media-uploaded-by-a-user"><a class="header" href="#list-media-uploaded-by-a-user">List media uploaded by a user</a></h3> <p>Gets a list of all local media that a specific <code>user_id</code> has created. By default, the response is ordered by descending creation date and ascending media ID. The newest media is on top. You can change the order with parameters @@ -646,44 +665,56 @@ database, especially for large environments.</p> <p><strong>Response</strong></p> <p>The following fields are returned in the JSON response body:</p> <ul> -<li> -<p><code>media</code> - An array of objects, each containing information about a media. -Media objects contain the following fields:</p> +<li><code>media</code> - An array of objects, each containing information about a media. +Media objects contain the following fields: <ul> -<li> -<p><code>created_ts</code> - integer - Timestamp when the content was uploaded in ms.</p> -</li> -<li> -<p><code>last_access_ts</code> - integer - Timestamp when the content was last accessed in ms.</p> -</li> -<li> -<p><code>media_id</code> - string - The id used to refer to the media.</p> -</li> -<li> -<p><code>media_length</code> - integer - Length of the media in bytes.</p> -</li> -<li> -<p><code>media_type</code> - string - The MIME-type of the media.</p> -</li> -<li> -<p><code>quarantined_by</code> - string - The user ID that initiated the quarantine request -for this media.</p> -</li> -<li> -<p><code>safe_from_quarantine</code> - bool - Status if this media is safe from quarantining.</p> -</li> -<li> -<p><code>upload_name</code> - string - The name the media was uploaded with.</p> -</li> +<li><code>created_ts</code> - integer - Timestamp when the content was uploaded in ms.</li> +<li><code>last_access_ts</code> - integer - Timestamp when the content was last accessed in ms.</li> +<li><code>media_id</code> - string - The id used to refer to the media.</li> +<li><code>media_length</code> - integer - Length of the media in bytes.</li> +<li><code>media_type</code> - string - The MIME-type of the media.</li> +<li><code>quarantined_by</code> - string - The user ID that initiated the quarantine request +for this media.</li> +<li><code>safe_from_quarantine</code> - bool - Status if this media is safe from quarantining.</li> +<li><code>upload_name</code> - string - The name the media was uploaded with.</li> </ul> </li> -<li> -<p><code>next_token</code>: integer - Indication for pagination. See above.</p> -</li> -<li> -<p><code>total</code> - integer - Total number of media.</p> -</li> +<li><code>next_token</code>: integer - Indication for pagination. See above.</li> +<li><code>total</code> - integer - Total number of media.</li> </ul> +<h3 id="delete-media-uploaded-by-a-user"><a class="header" href="#delete-media-uploaded-by-a-user">Delete media uploaded by a user</a></h3> +<p>This API deletes the <em>local</em> media from the disk of your own server +that a specific <code>user_id</code> has created. This includes any local thumbnails.</p> +<p>This API will not affect media that has been uploaded to external +media repositories (e.g https://github.com/turt2live/matrix-media-repo/).</p> +<p>By default, the API deletes media ordered by descending creation date and ascending media ID. +The newest media is deleted first. You can change the order with parameters +<code>order_by</code> and <code>dir</code>. If no <code>limit</code> is set the API deletes <code>100</code> files per request.</p> +<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;: [ + &quot;abcdefghijklmnopqrstuvwx&quot; + ], + &quot;total&quot;: 1 +} +</code></pre> +<p>The following fields are returned in the JSON response body:</p> +<ul> +<li><code>deleted_media</code>: an array of strings - List of deleted <code>media_id</code></li> +<li><code>total</code>: integer - Total number of deleted <code>media_id</code></li> +</ul> +<p><strong>Note</strong>: There is no <code>next_token</code>. This is not useful for deleting media, because +after deleting media the remaining media have a new order.</p> +<p><strong>Parameters</strong></p> +<p>This API has the same parameters as +<a href="#list-media-uploaded-by-a-user">List media uploaded by a user</a>. +With the parameters you can for example limit the number of files to delete at once or +delete largest/smallest or newest/oldest files first.</p> <h2 id="login-as-a-user"><a class="header" href="#login-as-a-user">Login as a user</a></h2> <p>Get an access token that can be used to authenticate as that user. Useful for when admins wish to do actions on behalf of a user.</p> @@ -1052,6 +1083,18 @@ server admin: <a href="../usage/administration/admin_api">Admin API</a></p> <li><code>user_id</code> - The fully qualified MXID: for example, <code>@user:server.com</code>. The user must be local.</li> </ul> +<h3 id="check-username-availability"><a class="header" href="#check-username-availability">Check username availability</a></h3> +<p>Checks to see if a username is available, and valid, for the server. See <a href="https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available">the client-server +API</a> +for more information.</p> +<p>This endpoint will work even if registration is disabled on the server, unlike +<code>/_matrix/client/r0/register/available</code>.</p> +<p>The API is:</p> +<pre><code>POST /_synapse/admin/v1/username_availabile?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> </main>