# Unified Social Media Publishing API

Human page: https://pubnio.com/social-media-api

## Summary

PubNio is a unified social media publishing API covering 7 platform integrations across 12 placements through one OpenAPI contract, TypeScript SDK, CLI, and hosted MCP server. Connect unlimited social accounts for $0 and pay only for confirmed live deliveries, starting with 100 free publishes per month.

## Capabilities & contract

| Capability | PubNio contract |
| --- | --- |
| Live publishing providers | Facebook Pages, Instagram, LinkedIn, Pinterest, TikTok, X (Twitter), and YouTube |
| Supported placements | Feed posts, Threads, Reels, Stories, Carousels, 100 MB LinkedIn PDF documents, Image Pins, and YouTube Shorts |
| Connected account fee | $0 per connected account across Pay as you go, Pro, Platform, and Enterprise |
| Free allowance & rates | 100 free confirmed publishes/mo, then $5/1,000 PAYG; Pro $29/mo (10k); Platform $149/mo (50k + white-label OAuth) |
| Preflight validation | 27 typed IssueCode checks covering captions, media dimensions, OAuth scopes, and TikTok privacy/disclosures |
| Reliability & webhooks | Required idempotency keys, reliable delivery, per-target retries, and HMAC-SHA256 delivery webhooks |

## What you skip building in-house

- Seven separate OAuth 2.0 refresh loops, Meta Page linkage checks, and TikTok creator audit gates.
- Provider-specific media container polling (Instagram Reels, TikTok chunked uploads, YouTube resumable uploads).
- Fragile multi-destination retry logic that risks duplicate posts when one provider times out.
- Custom webhook signing and out-of-order delivery reconciliation.

## Built into the PubNio core contract

- One canonical Draft -> Validate -> Publish lifecycle shared across REST, SDK, CLI, and hosted MCP.
- Per-target delivery isolation: an expired X token never blocks LinkedIn or triggers a duplicate retry.
- Failed attempts, drafts, preflight validation, and scheduled queues always cost $0.
- Direct X API fees pass through at exact provider cost ($0.015 post / $0.200 with URL) with $0 markup.

## TypeScript SDK example

```ts
import { createPubNioClient } from "@pubnio/sdk";

const client = createPubNioClient({
  baseUrl: "https://pubnio.com",
  apiKey: process.env.PUBNIO_API_KEY!,
});
const ws = client.workspace(process.env.PUBNIO_WORKSPACE_ID!);

const draft = await ws.posts.create({
  isDraft: true,
  text: "PubNio v2.4 ships normalized TikTok analytics and 100 MB LinkedIn PDFs.",
  targets: [
    { accountId: linkedinId, placement: "feed" },
    { accountId: xId, placement: "feed" },
  ],
});

const check = await ws.posts.validate(draft.postId);
if (!check.valid) throw new Error(check.issues.map((i) => i.code).join(", "));

const post = await ws.posts.publish(draft.postId, {
  idempotencyKey: "release-v2-4-launch",
});
```

## Hosted MCP example

```sh
claude mcp add --transport http pubnio https://pubnio.com/mcp

# Prompt inside Claude Code, Codex, Cursor, or OpenCode:
"List my connected LinkedIn and X accounts, draft our v2.4 changelog,
run preflight validation, and publish with idempotency key release-v2-4."
```

## CLI example

```sh
pnio posts create --draft --file release.json
pnio posts validate pst_01j9k4
pnio posts publish pst_01j9k4 --revision 1 --idempotency-key release-v2-4
pnio posts status --post-id pst_01j9k4
```

## FAQs

### How is PubNio priced compared to per-account social APIs?

PubNio charges $0 per connected social account on every plan. You start with 100 free confirmed publishes per month on Pay as you go ($5 per 1,000 after), or upgrade to Pro ($29/mo for 10,000 publishes) or Platform ($149/mo for 50,000 publishes plus white-label OAuth).

### Do failed publish attempts or drafts count toward my bill?

No. Draft creation, media staging, preflight validation, scheduling, and failed provider attempts always cost $0. Only confirmed live deliveries (or explicit provider_draft uploads on TikTok) count.

### Does PubNio provide an OpenAPI spec and typed SDK?

Yes. The live OpenAPI JSON is published at https://pubnio.com/api/v1/openapi, the interactive reference is at https://pubnio.com/api/v1/docs, and @pubnio/sdk ships full TypeScript types generated from the same contract.
