staqlydocs

Mastodon

Publish posts with pictures or a video, content warnings and replies to any Mastodon server, with an access token made on your own server.

Edit on GitHub

Staqly publishes to a Mastodon account (or any server that speaks Mastodon's API, such as GoToSocial or Akkoma) with an access token you make on your own server. Mastodon apps belong to one server each, so there is nothing for whoever runs staqly to register: every person brings their server's address and a token. A published target links to the post on your server.

Make an access token

On your Mastodon server, open Preferences → Development → New application:

FieldWhat
Application nameanything, for example staqly
Scopesuntick everything, then tick write:statuses, write:media and read:accounts

Save, open the application and copy Your access token.

Connect the account

In Channels → Add channel → Mastodon, enter:

FieldWhat
Serveryour server's address, for example https://mastodon.social (the default)
Access tokenthe token from the previous step

The channel shows your display name, @username@server and picture. Staqly keeps the token sealed.

Limits

Text500 characters (Mastodon's default; staqly keeps to 500 even on servers that allow more)
Mediaup to 4 pictures, or one video alone

Your server processes a video before the post goes out; a long video makes the publish wait for it.

Settings per post

SettingWhat it does
Who can see it (visibility)public (default), unlisted (quiet public: not in public timelines) or private (followers only)
Content warning (spoiler_text)Hides the post (and marks its media sensitive) behind this text until a reader opens it

Over the API: {"visibility": "unlisted", "spoiler_text": "Spoilers for episode 3"} in the target's settings.

Replies

A post's thread goes out as replies, each under the one before, with the post's visibility and content warning.

When publishing fails

Mastodon saysStaqly does
The token is invalid, revoked or lacks a scopeMarks the channel Needs reconnect and fails the target; make a new token and reconnect
Rate limit, the server is down or can't be reachedRetries through the job queue (after 1, 5, then 15 minutes)
A refused post (too long, a file the server doesn't take, a deleted post replied to)Fails the target with Mastodon's reason

Every post is sent with an idempotency key: when its answer is lost, the next attempt gets the post Mastodon already made instead of a second one. Mastodon remembers the key for an hour, so retrying a failed target by hand much later could post twice: check the profile first.

On this page