Skip to main content
Mastodon client registration is not done via the web interface, but by talking to the API directly. In the example below, we use curl to register a new client. Optionally check that you have jq installed on your system. You can normally install this with brew, apt-get, yum or chocolatey. If you don’t have jq installed, you can remove it from the command below.
The examples on this page use https://mastodon.social as the default Mastodon instance. If you are setting up Postiz to connect to a different self-hosted Mastodon instance (e.g., https://fosstodon.org), you must replace https://mastodon.social with your instance’s URL in the curl command below. You will also need to ensure the MASTODON_URL environment variable in your application’s .env file (or equivalent configuration for Docker, etc.) is set to your custom instance’s URL.
1

Register your client

Replace {provider} with mastodon in the redirect URI.Run the following curl command in a terminal to get the Mastodon client id and client secret.
curl -X POST -sS https://mastodon.social/api/v1/apps -F "client_name=YourAppName" -F "redirect_uris=http://localhost:4200/integrations/social/mastodon" -F "scopes=write:statuses write:media profile" | jq
This will give you output that looks something like this;
{
  "id": "1234567890",
  "redirect_uris": [
    "http://localhost:4200/integrations/social/mastodon"
  ],
  ...
  "client_id": "your_client_id",
  "client_secret": "your_client_secret"
}
2

Add credentials to your environment

Make a note of your client_id and client_secret and add them to your .env file.
MASTODON_CLIENT_ID="shown in the output from the above command"
MASTODON_CLIENT_SECRET="shown in the output from the above command"
MASTODON_URL="https://mastodon.social" # Change this if connecting to a different instance
3

Start Postiz

Stop Postiz if it is running, and then start it using the .env file with the Mastodon details. Click through the new channel setup and you should be asked to login on Mastodon.