User Tools

Site Tools


guides:matrix_admin_tools

This is an old revision of the document!


Matrix Admin Tools

See Matrix on the command line for instructions on how to get your API key.

Removing rooms from room directory

#!/bin/bash
# Usage example:
# ./matrix_admin_remove_room.sh !longroomID:glasgow.social
msgtype=m.text
homeserver=glasgow.social
access_token=put_your_user_access_token_here
room_id=$1
 
curl -XPUT -d "$( jq -Rsc --arg msgtype "$msgtype" '{$msgtype, body:.}')" "https://$homeserver/_matrix/client/r0/rooms/$room/send/m.room.message?access_token=$access_token"
 
curl -X PUT "https://$homeserver/_matrix/client/r0/directory/list/room/{roomId}" \
    -H "Authorization: Bearer $access_token" \
    -H "Content-Type: application/json" \
    -d '{
        "visibility": "none"
    }'
guides/matrix_admin_tools.1716898631.txt.gz · Last modified: 2024/05/28 13:17 by admin