Mastodon API for any federated server
Building across the Fediverse means dynamically registering OAuth apps on every user’s Mastodon domain, storing per-instance client secrets, handling async media attachment processing and threading replies manually. PostSyncer connects any Mastodon server behind one REST API.
- Connects any Mastodon instance via hosted OAuth (mastodon_instance)
- Multi-post threads, visibility scopes, spoiler_text content warnings and sensitive flags
- Polls, quote posts, 420-character media alt text, replies and boost/favourite stats
- Cancel anytime
- Unlimited posts on paid plans
curl -X POST "https://postsyncer.com/api/v1/posts" \
-H "Authorization: Bearer $POSTSYNCER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 4815,
"schedule_type": "schedule",
"schedule_for": {
"date": "2026-12-09",
"time": "11:30",
"timezone": "America/Los_Angeles"
},
"content": [
{
"text": "Behind the bar: how we dial in a washed Ethiopian espresso each morning.",
"media": [
"https://cdn.postsyncer.com/examples/espresso-shot.jpg"
]
},
{
"text": "Full grind size and water mineral notes are up on our blog."
}
],
"accounts": [
{
"id": 16246,
"settings": {
"visibility": "public",
"spoiler_text": "Coffee roasting nerdery",
"sensitive": false,
"language": "en"
}
}
]
}'PostSyncer propagates visibility, spoiler_text, sensitive and language across every post in the Mastodon thread automatically.
01 Quick start
Live on Mastodon in three steps
- 1
Connect any Mastodon server
Authorize accounts on mastodon.social, fosstodon.org or self-hosted domains in PostSyncer or via
POST /accounts/connect-linkswithmastodon_instance. - 2
Send posts, threads, polls or quotes
Call
POST /postswith text, photos or video, visibility,spoiler_textcontent warnings, polls,in_reply_to_idorquoted_status_id. - 3
Answer replies and track boosts
Sync replies from the instance via
/comments, reply with photos or a video, and track favourites, replies, boosts and quotes via/analytics.
02 Endpoints
Mastodon endpoints on one REST API
Every Mastodon operation runs on https://postsyncer.com/api/v1 with Bearer API keys and resource:action permissions.
| Endpoint | Permission | What it does |
|---|---|---|
POST/api/v1/posts | posts:create / schedule / publish | Publish Mastodon posts, threads, polls, replies and quote posts on any federated instance. |
POST/api/v1/accounts/connect-links | accounts:create | Create a hosted connect link for provider: mastodon specifying mastodon_instance (for example mastodon.social). |
DELETE/api/v1/posts/{id} | posts:delete | Cancel scheduled posts or ask the Mastodon server to delete the first post of a thread. |
GET/api/v1/comments | comments:read | List Mastodon replies synced on schedule or via POST /comments/sync. |
POST/api/v1/comments | comments:create | Reply to a Mastodon comment as the account, optionally attaching photos or a video. |
GET/api/v1/analytics/posts/{id} | analytics:read | Read favourites (likes), replies (comments), boosts (shares) and quotes. |
03 Media and text specs
What you can publish to Mastodon
Verified media limits, text caps and platform behaviors PostSyncer enforces when sending to Mastodon.
| Type | Formats | Limit | Notes |
|---|---|---|---|
| Photos | JPG, PNG, GIF, WebP | Up to 4 · 10 MB each | Alt text set in the PostSyncer media library travels with each photo up to 420 characters. |
| Video | MP4, MOV, WebM | 1 video · up to 40 MB | Videos are sent without transcoding; server duration caps apply. Cannot mix with photos. |
| Text & CW | Plain text | 500 chars post · 500 chars CW | Single posts trim to 500 characters even on custom instances; use content[] threads for longer writing. |
| Polls | 2–4 options | 50 chars/option · 5m–43,829m | Supports multiple: true and hide_totals: true; Mastodon 4.6+ allows combining polls with media. |
| Visibility | 4 Fediverse scopes | public, unlisted, private, direct | Applies to every post of a thread automatically alongside spoiler_text, sensitive and language. |
Platform behavior
Mastodon at a glance
- platform key
- mastodon
- Instance discovery
- Works with any Mastodon server; connect links require
mastodon_instance(e.g. mastodon.social). - Threads & first comment
- Multi-item content[] chains replies on the instance;
is_first_commentreplies at the end (delay 0 sends inline). - Deleting posts
DELETE /posts/{id} requests the server to delete the first post; later thread replies remain up.- Comments API
- Synced on schedule; reply with media and delete own replies. Mastodon cannot hide replies (returns 422).
- Analytics metrics
- likes (favourites), comments, shares (boosts) and quotes (impressions and
engagement_rateare null).
04 Capabilities and settings
Everything the Mastodon API handles for you
Mastodon communities expect proper content warnings, alt text, unlisted thread replies and server-agnostic authentication. PostSyncer handles every Fediverse nuance cleanly.
Dynamic per-instance OAuth
Skip writing custom dynamic app registration tables for every Mastodon domain. Pass provider: mastodon and
mastodon_instancetoPOST /accounts/connect-linksand let PostSyncer handle the handshake.Thread-wide visibility & content warnings
Set visibility (public, unlisted, private or direct),
spoiler_text, sensitive media blur, language andquoted_status_idonce — PostSyncer propagates them cleanly across every post in your thread.Accessible alt text from the media library
Attach up to 420 characters of image description in the PostSyncer media library and PostSyncer forwards it natively to Mastodon on every post and thread reply.
Multi-choice & hidden-total polls
Create polls with 2–4 choices up to 50 characters each (counting emoji flags accurately as 1 character), durations from 5 minutes to a month (43,829 minutes), multiple selections and
hide_totals.Quote posts & quote approval policies
Quote statuses via
quoted_status_idon servers that support quote posts, and declarequote_approval_policy(public, followers or nobody) on public and unlisted posts.Cross-post alongside Bluesky, X & Threads
Publish open-web announcements simultaneously across Mastodon, Bluesky, Threads and X from one
POST /postscall while giving Mastodon its own content warning or visibility.
Mastodon per-post settings keys
Pass any of these optional keys inside accounts[].settings on POST /posts or PATCH /posts/{id}. Keys for other networks are ignored when cross-posting.
| Setting key | Value | What it controls |
|---|---|---|
text | string (cut at 500 chars) | Mastodon-specific copy for the first post, overriding content[0].text. |
visibility | "public" | "unlisted" | "private" | "direct" | Fediverse post scope applied across the whole thread (defaults to public). |
spoiler_text | string (cut at 500 chars) | Content warning banner displayed above every post of the thread. |
sensitive | boolean | Marks attached photos or video as sensitive across the thread. |
language | string | ISO 639-1 language code (e.g. en) or auto to let the Mastodon instance detect it. |
poll | object | Poll with enabled, options (2–4 unique choices ≤ 50 chars), duration_minutes (5–43829), multiple and hide_totals. |
in_reply_to_id | string | Status ID on the same instance that the first post replies to. |
quoted_status_id | string | Status ID to quote on Mastodon servers supporting quote posts. |
quote_approval_policy | "public" | "followers" | "nobody" | Who may quote this post (sent alongside quoted_status_id on public/unlisted posts). |
media | number[] | Replaces the first item’s media with Mastodon-specific media library IDs. |
Why federated Mastodon integrations break standard OAuth libraries
Unlike centralized social networks with one OAuth base URL and one static client ID, Mastodon is distributed across thousands of independent domains. Supporting end users directly requires calling /api/v1/apps dynamically on each new domain, persisting per-domain client credentials, rotating tokens and guarding against SSRF when accepting arbitrary instance URLs.
PostSyncer solves federated OAuth once. Your backend creates a hosted connect link with provider: mastodon and mastodon_instance (such as mastodon.social), and once connected every Mastodon account uses the exact same POST /api/v1/posts schema as every other network in your workspace.
Poll validation and Mastodon server version differences
Mastodon poll rules differ subtly from X and LinkedIn: choices can run up to 50 characters, emoji flags count as a single character, case-distinct strings like Yes and yes count as separate options, and durations accept any whole minute count from 5 up to 43,829 (one month, defaulting to 1 day). PostSyncer validates all of those rules before scheduling and returns 422 with exact remediation instructions.
Because Mastodon 4.6 added polls alongside media while older servers refuse that combination, PostSyncer surfaces the server’s clear failure reason if an older instance declines a media-plus-poll post.
Replies, moderation boundaries and Fediverse metrics
PostSyncer syncs Mastodon replies an hour after publishing, every 6 hours on day one, and daily through day seven (plus on-demand POST /comments/sync). You can reply with photos or video via POST /comments and delete replies authored by your account. Because Mastodon does not support hiding replies, PATCH /comments/{id}/hide returns 422.
On the analytics side, Mastodon tracks favourites (likes), replies (comments), boosts (shares) and quotes — leaving impressions and engagement_rate null since federated servers do not collect impression telemetry.
05 Response and MCP
Same Mastodon rules over REST and MCP
Use the REST API from your backend or connect an AI agent to the Mastodon MCP server using the same accounts, permissions and rate limits.
AI agent alternative
Publish to your Mastodon server from ChatGPT, Claude or Codex via MCP
Connect your AI agent to PostSyncer’s MCP server to write Mastodon threads with content warnings, configure polls and reply to Fediverse conversations without managing instance tokens.
“Draft a 2-post Mastodon thread for Wednesday at 11:30 AM with the content warning "Coffee roasting nerdery" and language set to English.”
PostSyncer MCP server
https:// postsyncer.com/ mcpCross-posting
Ship Mastodon plus all 12 networks from one schema
Add more account IDs to the same POST /posts request to publish to Mastodon, Instagram, YouTube, LinkedIn, X and the rest together. Each account reads its own settings block while sharing the media upload and schedule.
Limits and plans
What each plan allows
The Mastodon REST API is available on every PostSyncer plan, Free included. Paid plans remove the monthly post cap; every plan shares 60 requests a minute.
| Plan | Social accounts | Posts | API posts a day, per network |
|---|---|---|---|
| Free | 2 | 20 a month | Within the 20 |
| Starter$29 a month | 10 | Unlimited | Unlimited |
| Pro$49 a month | 30 | Unlimited | Unlimited |
| Agency$99 a month | 100, then $1/mo each | Unlimited | Unlimited |
Every plan: 60 requests a minute for each PostSyncer user, across all their keys, the API and the MCP server together.
401The API key is missing, wrong or past its end date.403The key lacks the resource:action permission, or the plan limit was reached (plan_limit_reached).422A field failed validation or the network’s rules refused a file, setting or text length.429Too many requests: more than 60 in a minute across your user’s keys, API and MCP together.
Docs
Read more in the docs
- Mastodon platform guideMedia limits, settings, comments and analytics on Mastodon
- Create a postFull POST /posts request schema and platform settings
- QuickstartAPI keys, workspace IDs and your first scheduled post
- Authentication and permissionsBearer API keys and resource:action permissions
- Media uploads and video coversURL imports, file uploads and cover frames
- Compare all 12 networksSide-by-side matrix of media, threads, comments and deletes
All 12 networks
Explore every platform API on PostSyncer
FAQ
Mastodon API questions
Need help with a specific endpoint or webhook? Ask us in live chat.
Chat with usDoes the Mastodon API work with any Mastodon instance or only mastodon.social?
It works with any Mastodon server. Pass the domain (such as mastodon.social or your own self-hosted server) in mastodon_instance when creating a connect link or connecting in the app.
Can I set Mastodon content warnings (spoiler_text) and visibility per post?
Yes. Pass visibility (public, unlisted, private or direct), spoiler_text (up to 500 characters) and sensitive: true in accounts[].settings; PostSyncer applies them to every post in the thread.
How are Mastodon threads and alt text handled?
Multiple objects in content[] publish as chained replies on the server, and image alt text saved in your PostSyncer media library is sent automatically up to 420 characters.
Can I publish Mastodon polls with multiple choice or hidden vote totals?
Yes. Pass settings.poll with enabled: true, 2–4 options (up to 50 chars), duration_minutes (5 to 43,829), and optional multiple: true or hide_totals: true.
Can I hide replies on Mastodon via the API?
No. Mastodon does not support hiding replies, so PATCH /comments/{id}/hide returns 422. You can delete replies written by your own account via DELETE /comments/{id}.
What analytics does Mastodon return?
PostSyncer returns favourites (likes), replies (comments), boosts (shares) and quotes. Impressions and engagement_rate are null because Mastodon does not report impression counts.
Ship federated Mastodon publishing without per-server OAuth.
Create a Bearer API key in Settings → API and connect any Mastodon instance in seconds.
- No card for free
- Cancel anytime
- Unlimited posts on paid plans