Before you start
Mastodon is a federated network: your account belongs to a specific server, such as mastodon.social. Use the server where your account is registered, even when you follow people on other servers.
- An active Mastodon account and its HTTPS server URL.
- A current SNAP installation with Mastodon in the network selector.
- A dedicated user access token created on that same Mastodon server.
Create your Mastodon access token
1. Open your server’s Development settings
Sign in to your Mastodon server in a browser. Open Preferences → Development, or visit https://YOUR-SERVER/settings/applications. Replace YOUR-SERVER with your own server’s hostname.
2. Create an application for SNAP
Choose New application, name it NextScripts SNAP, and use your WordPress website URL in the website field. For this manually generated token, keep the default redirect URI urn:ietf:wg:oauth:2.0:oob.
3. Set the permissions
Allow read:accounts to verify the connected account, write:statuses to publish posts, and write:media if you will attach images. On servers that show only broader permissions, select read and write. Save the application.
4. Copy the access token
Open the application you just created and copy Your access token. Use this token in SNAP, rather than the Client key, Client secret, or your Mastodon password. Keep the token private.
Add Mastodon in SNAP
1. Add the network
In WordPress, open SNAP → Accounts → Add new account and select Mastodon. Give the connection a recognizable account nickname.
2. Enter the server URL and token
Enter your Mastodon server’s base URL, for example https://mastodon.social, and paste the access token from that server. The server URL is not your @username@server handle, a profile URL, or an /api/ endpoint.
3. Configure your message
Choose the message template and available image options, then save the account. A useful starting template is:
%TITLE%
%EXCERPT%
%URL%Keep the final message within your Mastodon server’s character limit. Configure any available visibility options for the audience you intend to reach.
Check your first post
Send one test post from SNAP. Open the returned Mastodon post link and check the account, message, article URL, image, and visibility. Once the test succeeds, enable this destination for your automatic publishing workflow.
Troubleshooting
- Mastodon is missing from the network selector: update SNAP to a version that includes the Mastodon connector, then reload its Accounts screen.
- 401 or invalid access token: confirm that the token belongs to the server URL entered in SNAP. Replace a revoked or expired token.
- 403 or insufficient permissions: check the application’s scopes and whether your Mastodon account is active and confirmed. Generate a new token after changing its permissions if required.
- 422 or a message-length error: shorten the generated message and check the character limit on your server.
- An image fails: check
write:media, your server’s media limits, and whether the image URL is publicly accessible. - A connection or SSL error: use the HTTPS base URL of your own server and check that your WordPress host can reach it.
More help
Mastodon authentication documentation · Mastodon permission scopes · SNAP help / FAQ