So, as of Mastodon 4.0, there's FINALLY an API endpoint for automating defederation! However i've not seen anyone have a tool yet so I made one!

Enjoy Masto Defed 0.0.1, first version, no error checking, just mash in an auth token and your fedi instance, and have a list ready, and push the button!

This can be run from anywhere you can access your account from and run python -- a masto server, your laptop, i guess an android device...

Download defedlist.txt


  • Mastodon 4.x
  • Python 3.10 ( I wrote this with Python 3.10.9 )
  • pip install
  • A list of instances to defederate in a text file, one per line.
  • Auth token with Admin Write privs

    How to use:

Go into your mastodon profile/settings, and go to Development. Click on New Application, fill in Application name with whatever you like and ensure that admin:write is checked, then click Submit.

Then, select it in the application list, and copy the text next to Your access token, and replace the text TokenGoesHere in Change the api_base_url with your instance URL, aaaand you should be set!

No error tests in this initial version, it's a very quick and dirty loop.

Next Post Previous Post