User Tools

Site Tools


guides:matrix_admin_tools

Matrix Admin Tools

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

Removing rooms from room directory

work in progress

#!/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.txt · Last modified: 2024/05/28 13:17 by admin