From 4a2a96e055b0792de1517f3ab53b3690a4508a29 Mon Sep 17 00:00:00 2001 From: richvdh Date: Wed, 11 Aug 2021 19:30:23 +0000 Subject: deploy: 915b37e5efd4e0fb9e57ce9895300017b4b3dd43 --- develop/admin_api/user_admin_api.html | 83 ++++++++++++++++++++--------------- 1 file changed, 48 insertions(+), 35 deletions(-) (limited to 'develop/admin_api/user_admin_api.html') diff --git a/develop/admin_api/user_admin_api.html b/develop/admin_api/user_admin_api.html index b977883066..0a49fadba1 100644 --- a/develop/admin_api/user_admin_api.html +++ b/develop/admin_api/user_admin_api.html @@ -553,7 +553,8 @@ member are returned.

  • joined_rooms - An array of room_id.
  • total - Number of rooms.
  • -

    List media of a user

    +

    User media

    +

    List media uploaded by a user

    Gets a list of all local media that a specific user_id 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 +647,56 @@ database, especially for large environments.

    Response

    The following fields are returned in the JSON response body:

    +

    Delete media uploaded by a user

    +

    This API deletes the local media from the disk of your own server +that a specific user_id has created. This includes any local thumbnails.

    +

    This API will not affect media that has been uploaded to external +media repositories (e.g https://github.com/turt2live/matrix-media-repo/).

    +

    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 +order_by and dir. If no limit is set the API deletes 100 files per request.

    +

    The API is:

    +
    DELETE /_synapse/admin/v1/users/<user_id>/media
    +
    +

    To use it, you will need to authenticate by providing an access_token for a +server admin: Admin API

    +

    A response body like the following is returned:

    +
    {
    +  "deleted_media": [
    +    "abcdefghijklmnopqrstuvwx"
    +  ],
    +  "total": 1
    +}
    +
    +

    The following fields are returned in the JSON response body:

    + +

    Note: There is no next_token. This is not useful for deleting media, because +after deleting media the remaining media have a new order.

    +

    Parameters

    +

    This API has the same parameters as +List media uploaded by a user. +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.

    Login as a user

    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.

    -- cgit 1.5.1