diff options
author | richvdh <richvdh@users.noreply.github.com> | 2021-08-11 19:30:23 +0000 |
---|---|---|
committer | richvdh <richvdh@users.noreply.github.com> | 2021-08-11 19:30:23 +0000 |
commit | 4a2a96e055b0792de1517f3ab53b3690a4508a29 (patch) | |
tree | 172af428aebc90b7a7d64db4cf358603acc553cd /develop/print.html | |
parent | deploy: 339c3918e1301d53b998c98282137b12d9d16c45 (diff) | |
download | synapse-4a2a96e055b0792de1517f3ab53b3690a4508a29.tar.xz |
deploy: 915b37e5efd4e0fb9e57ce9895300017b4b3dd43
Diffstat (limited to 'develop/print.html')
-rw-r--r-- | develop/print.html | 90 |
1 files changed, 54 insertions, 36 deletions
diff --git a/develop/print.html b/develop/print.html index ffaabecf17..7b7aa28daa 100644 --- a/develop/print.html +++ b/develop/print.html @@ -8732,6 +8732,7 @@ have a canonical alias set.</li> <ul> <li><a href="admin_api/media_admin_api.html#delete-a-specific-local-media">Delete a specific local media</a></li> <li><a href="admin_api/media_admin_api.html#delete-local-media-by-date-or-size">Delete local media by date or size</a></li> +<li><a href="admin_api/media_admin_api.html#delete-media-uploaded-by-a-user">Delete media uploaded by a user</a></li> </ul> </li> <li><a href="admin_api/media_admin_api.html#purge-remote-media-api">Purge Remote Media API</a></li> @@ -8760,7 +8761,8 @@ server admin: see <a href="admin_api/../usage/administration/admin_api">Admin AP </code></pre> <h2 id="list-all-media-uploaded-by-a-user"><a class="header" href="#list-all-media-uploaded-by-a-user">List all media uploaded by a user</a></h2> <p>Listing all media that has been uploaded by a local user can be achieved through -the use of the <a href="admin_api/user_admin_api.html#list-media-of-a-user">List media of a user</a> +the use of the +<a href="admin_api/user_admin_api.html#list-media-uploaded-by-a-user">List media uploaded by a user</a> Admin API.</p> <h1 id="quarantine-media"><a class="header" href="#quarantine-media">Quarantine media</a></h1> <p>Quarantining media means that it is marked as inaccessible by users. It applies @@ -8920,6 +8922,9 @@ If <code>false</code> these files will be deleted. Defaults to <code>true</code> <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> +<h2 id="delete-media-uploaded-by-a-user"><a class="header" href="#delete-media-uploaded-by-a-user">Delete media uploaded by a user</a></h2> +<p>You can find details of how to delete multiple media uploaded by a user in +<a href="admin_api/user_admin_api.html#delete-media-uploaded-by-a-user">User Admin API</a>.</p> <h1 id="purge-remote-media-api"><a class="header" href="#purge-remote-media-api">Purge Remote Media API</a></h1> <p>The purge remote media API allows server admins to purge old cached remote media.</p> <p>The API is:</p> @@ -10269,7 +10274,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 @@ -10362,44 +10368,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-1"><a class="header" href="#delete-media-uploaded-by-a-user-1">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/<user_id>/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="admin_api/../usage/administration/admin_api">Admin API</a></p> +<p>A response body like the following is returned:</p> +<pre><code class="language-json">{ + "deleted_media": [ + "abcdefghijklmnopqrstuvwx" + ], + "total": 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="admin_api/user_admin_api.html#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> |