REST API (Webhooks by Zapier) · Mastodon

A Zapier Mastodon bot that asks first

Community managers often keep a spreadsheet of announcements and publish them by hand. With Zapier and SocialHandoff, each approved row becomes a Mastodon draft through the REST API. The approval inbox adds a last check for fediverse details that spreadsheets miss, like alt text, a content warning, and whether the hashtags are CamelCase. You review each post in the inbox before it reaches your followers.

Prompt

When a row in the 'Announcements' Google Sheet gets Status = Ready, send the Text column to the REST API as a Mastodon draft, networks ["mastodon"], mode submit, idempotencyKey = the row id.

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. Choose the trigger app Pick the trigger: a new blog item, a Notion page, a spreadsheet row, a calendar event, or anything else Zapier watches.
  3. Add a Webhooks by Zapier POST Send JSON to https://app.socialhandoff.com/v1/posts with an Authorization: Bearer header. Map body from the trigger, set networks to ["mastodon"], and mode to "submit".
  4. Test and turn on Run the test step, open the approval inbox, and check the draft. Then turn the Zap on. Every run creates a pending post, never a live one.

Example draft

Our community forum is moving to a new home next week. Your account, posts, and bookmarks move with it; nothing to do on your side. Expect about 30 minutes of read-only time on Tuesday morning UTC.

Thank you for your patience while we make the switch.

#Community #OpenSource

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.
  • Zapier can replay a step on errors. Send an idempotencyKey built from the trigger record's id so a replay returns the same Mastodon draft instead of a second one.
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

Is there a native Zapier app?
Not today. Use Webhooks by Zapier to call the REST API. It needs one POST step and a bearer header.
Will a retried Zapier 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.
Which Mastodon instances work?
Any Mastodon server. You enter your instance URL, sign in through that server's OAuth screen, and choose the account the agent drafts for.

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