Mastodon API for developers and AI agents

Mastodon publishing without rebuilding instance discovery, per-server OAuth, media upload, queues, and webhook status handling.

No credit card required

import { KavenioClient } from "@kavenio/sdk";

const kavenio = new KavenioClient({
  authToken: process.env.KAVENIO_API_KEY,
});

// Send your user to their Mastodon instance to authorize publishing.
const { authorizationUrl } = await kavenio.connect.begin({
  profileId: "acctset_123",
  platform: "mastodon",
  mastodonInstance: "mastodon.social",
});

// Publish to the connected Mastodon account.
await kavenio.posts.create({
  content: "Publishing to Mastodon through one social API.",
  publishNow: true,
  platforms: [
    {
      platform: "mastodon",
      accountId: "acct_mastodon_123",
      platformSpecificData: {
        visibility: "public",
        spoilerText: "Launch notes",
        language: "en",
      },
    },
  ],
});

How it works

Collect the user's instance, connect the account through OAuth, publish to the selected Mastodon account, and use webhooks for status changes.
  1. kavenio.connect.begin(...)

    Pass the user's Mastodon instance and create the authorization URL for that specific server.

  2. kavenio.posts.create(...)

    Publish now or schedule a Mastodon status with visibility, content warning, media, language, or poll options.

  3. kavenio.webhooks.create(...)

    Trigger your automation when Mastodon publishing succeeds, fails, retries, or needs attention instead of polling for state.

Formats

Publish the Mastodon status formats your product needs

Let customers choose visibility, content warnings, media, language metadata, and polls without building a separate Mastodon-only workflow.
Text statuses
Images
GIFs
Videos
Audio
Polls
Content warnings
Visibility control
Developer workflow

Build Mastodon publishing without Fediverse plumbing

Keep your product focused on the customer workflow while Kavenio handles instance discovery, OAuth, status publishing, queues, and status events.

Per-instance connection

Accept an instance like mastodon.social, register on that server, and redirect the user to the right OAuth authorization screen.

Status publishing

Publish text, supported media, content warnings, visibility settings, language metadata, and polls through the same posts API.

Capability-aware options

Use stored instance metadata for Mastodon-specific behavior such as quote-post support on newer compatible servers.

Queue and webhooks

Schedule posts, publish now, retry rate-limited jobs, and trigger automation from post lifecycle webhooks.

Instance-aware OAuth

Connect Mastodon accounts without a central app review queue

Mastodon is decentralized. Kavenio asks for the user's instance, registers the OAuth app on that server, and stores the resulting credentials server-side.

Register per Mastodon instance

Ask for the user's server, register an OAuth application on that instance, and send the user through that instance's authorization screen.

Keep instance credentials server-side

Store the dynamic client secret and user token behind a connected account so your product never handles raw Mastodon credentials.

Build the Mastodon publishing workflow once

Stop rebuilding instance discovery, per-server OAuth, media rules, retries, and status events for every product surface.

Reuse the same connect and publishing workflow for the next supported platform.

Mastodon API questions

Practical details for building Mastodon publishing into your product.

Does Mastodon require developer app approval?

Usually no. Mastodon app registration happens per instance during connect, then the user authorizes the requested scopes on their server.

Can I publish Mastodon posts through Kavenio?

Yes. Connect a Mastodon account by instance and publish statuses through the same posts API used for other content platforms.

Can I publish media and polls?

Yes. Mastodon publishing supports text, supported image, GIF, video, and audio media, plus polls when the post does not include media.

Can I schedule Mastodon posts?

Yes. Use Kavenio scheduling and background jobs for Mastodon targets, with retry behavior for provider rate limits.