Authentication & Base Endpoints

The MuxPost REST API v1 exposes clean JSON endpoints for validating drafts, managing multi-tenant workspace profiles, listing connected channels, and publishing or scheduling posts across 12 overseas social platforms. Every write operation uses explicit Bearer authentication (Authorization: Bearer mp_live_...), while /api/v1/platforms and /api/v1/validate work without authentication so CI checks and pre-flight scripts run free.

  • Live API Base URL: https://muxpost.com
  • Authentication Header: Authorization: Bearer mp_live_YOUR_API_KEY (mint keys in Console → Settings → API Keys)
  • OpenAPI 3.1 Contract: GET /api/v1/openapi.json
  • Agent Skill Spec: GET /skill.md
  • Interactive Sandbox Check: Test validation payloads directly in your browser on our social media posting API pre-flight validator.

Core REST API v1 Endpoints

Endpoint Method Auth Purpose
/api/v1/platforms GET Public Return capabilities, max characters, and media rules for all 12 networks
/api/v1/validate POST Public Run zero-cost pre-flight validation (23-char URL math, media rules, X link-tax alerts)
/api/v1/profiles GET / POST mp_live_ List or create isolated multi-tenant client workspace profiles
/api/v1/accounts GET mp_live_ List connected OAuth, Bluesky App Password, BYOK, or Sandbox channels
/api/v1/posts GET / POST mp_live_ List posts or publish / save draft / schedule future dispatches with idempotencyKey
/api/v1/posts/:id GET / DELETE mp_live_ Inspect per-target delivery URLs/errors or cancel queued scheduled posts

Quickstart SDK Examples (curl, TypeScript, Python)

1. Pre-Flight Validate Before Dispatch (curl)

Always call POST /api/v1/validate before creating a post to detect oversized captions, missing video URLs, or $0.20 external link triggers on X:

curl -X POST https://muxpost.com/api/v1/validate \
  -H "Content-Type: application/json" \
  -d '{
    "platforms": ["x", "linkedin", "instagram"],
    "content": "Launching our new analytics module! Check benchmarks: https://muxpost.com",
    "mediaUrls": ["https://cdn.example.com/benchmark.png"]
  }'

2. Zero-Dependency TypeScript Client

Use native fetch in Node 20+, Cloudflare Workers, or Deno with idempotencyKey deduplication and per-platform caption overrides (platformSettings.customCaptions):

export class MuxPostClient {
  constructor(
    private readonly apiKey: string,
    private readonly baseUrl = 'https://muxpost.com'
  ) {}

  async publishPost(payload: {
    accountIds: string[];
    content: string;
    mediaUrls?: string[];
    scheduledAt?: string | null;
    platformSettings?: Record<string, unknown>;
    idempotencyKey: string;
  }) {
    const res = await fetch(`${this.baseUrl}/api/v1/posts`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${this.apiKey}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(payload),
    });
    const json = await res.json();
    if (!res.ok) throw new Error(json?.message || `HTTP ${res.status}`);
    return json.data;
  }
}

3. Python Integration (requests)

import os
import requests

BASE_URL = "https://muxpost.com"
HEADERS = {"Authorization": f"Bearer {os.environ['MUXPOST_API_KEY']}"}

accounts = requests.get(f"{BASE_URL}/api/v1/accounts", headers=HEADERS, timeout=15).json()["data"]["accounts"]
target_ids = [a["id"] for a in accounts if a["platform"] in ("x", "linkedin", "bluesky")]

res = requests.post(
    f"{BASE_URL}/api/v1/posts",
    headers=HEADERS,
    json={
        "accountIds": target_ids,
        "content": "Automated product changelog across X, LinkedIn, and Bluesky.",
        "platformSettings": {
            "x": {"threadReplies": ["Read the changelog: https://muxpost.com/docs"]}
        },
        "idempotencyKey": "changelog-2026-12-05",
    },
    timeout=20,
)
res.raise_for_status()
print(res.json())

Signed Webhooks & Security Verification

Credential & API Key Security

  • Encrypted OAuth & BYOK Tokens: Production workspace OAuth access tokens, refresh tokens, and Bring-Your-Own-Key (BYOK) X developer tokens are encrypted at rest with Web Crypto AES-256-GCM inside isolated workspace profiles.
  • Hashed API Keys: Developer mp_live_ API keys are stored only as cryptographic hashes and verified via constant-time comparison—plaintext API keys cannot be recovered from storage.

Webhook Signature Verification

MuxPost signs delivery notifications (post.published, post.failed, webhook.test) with HMAC-SHA256 in the X-MuxPost-Signature header (sha256=<hex>). Verify signatures using constant-time HMAC comparison before updating internal records:

export async function verifyMuxPostWebhook(
  rawBody: string,
  signatureHeader: string,
  secret: string
): Promise<boolean> {
  const key = await crypto.subtle.importKey(
    'raw',
    new TextEncoder().encode(secret),
    { name: 'HMAC', hash: 'SHA-256' },
    false,
    ['sign']
  );
  const mac = await crypto.subtle.sign('HMAC', key, new TextEncoder().encode(rawBody));
  const expected = 'sha256=' + Array.from(new Uint8Array(mac)).map((b) => b.toString(16).padStart(2, '0')).join('');
  return signatureHeader === expected;
}

Idempotency, Scheduling & Plan Rate Limits

Pass a deterministic idempotencyKey (for example a release slug or daily hash) on every POST /api/v1/posts request—if your worker retries after a timeout, MuxPost returns the existing post record cleanly (idempotentReplay: true) instead of duplicating posts. Future scheduledAt UTC timestamps enter the edge cron dispatcher (*/2 * * * *) automatically. Review tier limits on our pricing page, wire AI coding clients via our Hosted MCP guide, or jump straight into platform-specific walkthroughs for Instagram Posting API and LinkedIn Posting API. Need higher enterprise throughput? Message our team on the contact page.

Frequently Asked Questions

Can I call /api/v1/validate without an API key?

Yes. POST /api/v1/validate and GET /api/v1/platforms require no Bearer token, allowing CI scripts or client forms to run pre-flight character and media validation free.

How does idempotencyKey prevent duplicate social posts on retries?

Every POST /api/v1/posts request accepts an idempotencyKey scoped per user workspace. Retrying the same idempotencyKey returns the original created post instead of publishing duplicates.

Can I customize text per network in a single POST /api/v1/posts request?

Pass platformSettings.customCaptions keyed by platform ID (such as x, linkedin, bluesky) alongside optional platformSettings.x.threadReplies to split links into Reply #2.

How do I verify MuxPost delivery webhook signatures?

Inspect the X-MuxPost-Signature header (sha256=<hex>) against your raw request body using HMAC-SHA256 and your configured webhook secret from Console settings.

Ready to test your workflow in 60 seconds?

Try the free browser validator, spin up 12-platform Sandbox channels, or wire Claude and Cursor to Hosted MCP.

Run Pre-Flight Validator