One API Call to Post on Mastodon

The Mastodon API varies across instances with different versions, rate limits, and custom configurations. RelayAPI handles OAuth, rate limits, media hosting, and API changes.

No credit card required · Free plan available

POST /v1/posts
const res = await fetch("https:">//api.relayapi.dev/v1/posts", {
  method: "POST",
  headers: {
    Authorization: "Bearer rlay_live_xxxx",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    content: "Check out our latest update!",
    platforms: ["mastodon"],
    media: ["https:">//cdn.example.com/image.jpg"],
  }),
});

Mastodon API

  • Each Mastodon instance runs different software versions with varying API compatibility and feature support
  • OAuth app registration must be done per-instance, requiring dynamic client registration for multi-instance support
  • Rate limits vary by instance (default 300/5min) and some instances enforce stricter custom limits
  • Media uploads have instance-specific file size limits and supported format lists that differ from the spec
  • Content visibility (public, unlisted, followers-only, direct) and content warnings interact in non-obvious ways

RelayAPI

  • RelayAPI normalizes API differences across Mastodon instances and forks (Pleroma, Akkoma, Misskey) into a consistent interface
  • We handle per-instance OAuth app registration, token management, and dynamic client creation automatically
  • Instance-specific rate limits are detected and tracked automatically with per-instance queuing and backoff
  • Upload media to RelayAPI and we validate against the target instance's limits, convert formats, and handle thumbnails
  • Simple visibility parameters with automatic content warning handling and instance-specific rule compliance
Save 3+ hours of development time

Supported content types

Text PostsImagesVideosPollsAudio

How it works

1

Connect your account

Authorize your Mastodon account via OAuth in about 30 seconds.

2

Build your integration

Use the REST API or our SDKs to publish content from your stack.

3

We handle the rest

RelayAPI manages publishing, rate limits, and delivery notifications.

Ship Faster

Post to any Mastodon instance with a single API call. No per-instance OAuth registration, no version detection, no format negotiation. Specify your instance and content, we handle the rest.

Official API, Zero Hassle

RelayAPI uses the official Mastodon API. Your posts appear natively in timelines with full ActivityPub federation, while we handle instance compatibility, OAuth, and rate limits.

Multi-Instance Compatibility

The fediverse includes Mastodon, Pleroma, Akkoma, and other compatible platforms. RelayAPI detects the instance type and adapts API calls for maximum compatibility across the fediverse.

Frequently asked questions

Can I post to any Mastodon instance?

Yes. RelayAPI supports any Mastodon-compatible instance, including Pleroma, Akkoma, and other fediverse platforms. Connect your account from any instance and we handle the API differences.

What content types can I publish to Mastodon through RelayAPI?

RelayAPI supports text posts (up to instance character limit, typically 500), images (up to 4), videos, polls, and audio attachments. Content warnings and visibility levels are fully supported.

How does RelayAPI handle different Mastodon instance configurations?

We detect instance software, version, and configuration automatically. This includes character limits, file size limits, supported media formats, and custom rate limits. Your posts are validated against the target instance's specific configuration.

Does posting through RelayAPI federate normally?

Yes. Posts made through RelayAPI via the Mastodon API federate across the fediverse exactly like posts made through the Mastodon web interface. There is no difference in reach or federation behavior.

Start building with Mastodon.

Join developers who chose RelayAPI over wiring up Mastodon API by hand.