REST API (HTTP module) · Mastodon

A Make Mastodon bot that asks first

Make works well for scheduled digests, which suit Mastodon's calmer pace better than a stream of single announcements. A scenario can gather a week of links from a database or RSS, aggregate them into one post, and send it to SocialHandoff as a Mastodon draft. An outbound webhook can then tell the scenario when the post is published. Every toot waits in the approval inbox until you approve it.

Prompt

Every Monday, aggregate the last 7 days of items from our 'Reading list' Notion database into a Mastodon post: a short intro line, then up to 4 titles with links. POST to the REST API with networks ["mastodon"] and mode submit.

How to do it

  1. Mint a Mastodon agent key In https://app.socialhandoff.com, open Connections, connect your Mastodon account, then create an agent key scoped to Mastodon with draft permission only. Copy the key when it is shown; only its hash is stored.
  2. Build the trigger module Start the scenario with a watch module: new RSS items, new rows, a webhook, or a scheduled run.
  3. Add HTTP Make a request Method POST, URL https://app.socialhandoff.com/v1/posts, header Authorization: Bearer with the key, body type JSON with body, networks ["mastodon"], and mode "submit".
  4. Map fields and run once Map the trigger's fields into body, run the scenario once, and approve or reject the result in the inbox before scheduling the scenario.

Example draft

Four things we read last week and liked:

The case for boring technology, revisited: example.com/r/1
Writing error messages people can act on: example.com/r/2
A gentle guide to CRDTs: example.com/r/3
What running a small instance taught one admin: example.com/r/4

#Reading #WebDev

Gotchas

  • Publishing uses idempotency keys, so a retried request after a timeout does not produce a duplicate toot.
  • Alt text is expected on the fediverse, and many people filter posts without it. The missing alt text guardrail flags drafts before they reach you.
  • Read your instance rules on automated posting. Many ask that bot-driven accounts tick the automated account box in profile settings.
  • Make runs the HTTP module once per bundle. If your trigger returns 20 items, you get 20 drafts; add a filter or limit before the request.
Mastodon
  • Character limit: 500 characters on a default Mastodon server. Each instance can raise it, so check yours.
  • Links: Every URL counts as 23 characters, however long it is.
  • Media per post: Up to 4 attachments on a default server.
  • File sizes: Images up to 16 MB and video up to about 99 MB on a default install. Instances can set their own limits.
Mastodon scheduler with approval for any instance

Frequently asked questions

Can Make read the approval result?
Yes. Register an outbound webhook for post.published or post.failed and point it at a Make custom webhook to continue the scenario.
Will a retried Make run post the same toot twice?
Not if you send an idempotencyKey. A second request with the same key returns the existing post instead of creating a new one.
Is posting to Mastodon from an agent good etiquette?
It can be, if the account is labeled as automated where your instance asks for it, posts carry alt text, and a person reviews each post. The approval inbox covers the last part.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial