Sign inJoin ↗
SOPOSTAI FOR DEVELOPERS & AI BOTS

SOPostAI REST API & MCP Server

Automate your social media from any AI bot or workflow tool — Grok Bot, Cursor, Claude, ChatGPT, n8n, Zapier, Make or your own scripts. Every request uses your own API key and follows the same safety rules as the SOPostAI workspace: content moderation, package limits, upload limits and a 2-minute anti-spam spacing between posts.

1. Get an API key

Sign in, activate a paid package, then open API & MCP in your workspace sidebar and create a key. Choose Read + Post to publish, or Read-only for reporting. The key (it starts with spai_live_) is shown once. Send it on every request:

Authorization: Bearer spai_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Create a free account ↗ Sign in

2. Connect an AI bot with MCP

SOPostAI runs a Model Context Protocol server over Streamable HTTP (JSON-RPC 2.0) at https://sopostai.com/api/mcp (also /mcp). Add this to your MCP client configuration (Cursor mcp.json, Claude, Grok Bot and other MCP clients):

{
    "mcpServers": {
        "sopostai": {
            "url": "https://sopostai.com/api/mcp",
            "headers": {
                "Authorization": "Bearer YOUR_API_KEY"
            }
        }
    }
}

For clients that only run local stdio servers, use the mcp-remote bridge:

{
    "mcpServers": {
        "sopostai": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-remote",
                "https://sopostai.com/api/mcp",
                "--header",
                "Authorization: Bearer YOUR_API_KEY"
            ]
        }
    }
}

Supported methods: initialize, notifications/initialized, ping, tools/list and tools/call. Protocol versions 2025-06-18, 2025-03-26, 2024-11-05.

3. MCP tools

ToolWhat it doesArguments
get_account_statusReturns the SOPostAI package, remaining monthly posts and account slots, connected account count, API rate limit and anti-spam cooldown status. Call this first.—
list_connected_accountsLists the connected social accounts/pages (id, platform, name, status, can_post). Use the returned ids as account_ids for create_post. OAuth tokens are never exposed.platform
create_postPublishes now or schedules a post to one or more connected accounts. Enforces content moderation, package limits and the 2-minute anti-spam spacing per account (later posts are queued automatically). Requires a Read + Post API key.caption*, account_ids*, title, scheduled_at, link, hashtags, media_ids, media_urls, network_captions, youtube_audience, youtube_privacy, first_comment, draft, idempotency_key
list_postsLists recent, scheduled, published or failed posts, newest first.status, platform, limit, offset
get_post_statusReturns a post with per-account delivery status, published links and errors.post_id*
cancel_postCancels the pending or scheduled deliveries of a post. Already published posts stay on their platforms. Requires a Read + Post API key.post_id*

* required. Validation, moderation and limit problems come back as a tool result with isError: true so the bot can fix the request.

Example: create_post

{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
        "name": "create_post",
        "arguments": {
            "caption": "New blog post is live! 🚀",
            "account_ids": [
                12,
                15
            ],
            "hashtags": [
                "SOPostAI",
                "SocialMedia"
            ],
            "scheduled_at": "2026-12-25T10:30:00+05:30"
        }
    }
}

4. REST API v1

Base URL https://sopostai.com/api/v1. Requests and responses are JSON. Success: {"ok": true, "data": …}. Failure: {"ok": false, "error": "…", "code": "…"}. If your host does not support clean URLs, https://sopostai.com/index.php?r=api_v1&endpoint=posts works too.

MethodEndpointDescriptionKey
GET/api/v1/meYour profile, active package, remaining posts and account slots, cooldown status and API rate limit.Any
GET/api/v1/accountsConnected social accounts/pages: id, platform, name, status, can_post. Never returns OAuth tokens. Filter: ?platform=facebook.Any
GET/api/v1/postsYour posts, newest first. Filters: ?status=draft|queued|scheduled|published|partial|cancelled|failed, ?platform=, ?limit=1-100, ?offset=.Any
GET/api/v1/posts/{id}One post with per-account delivery status, published links and errors.Any
POST/api/v1/postsPublish now or schedule. JSON: caption (or content), account_ids, title, scheduled_at (ISO 8601), link, hashtags, media_ids or media_urls, network_captions, youtube_audience, draft. Send an Idempotency-Key header to make retries safe.Read + Post
POST/api/v1/mediamultipart/form-data field "file". Returns media_id and a signed URL. Enforces upload size and real file-type limits.Read + Post
POST/api/v1/posts/{id}/cancelCancel pending/scheduled deliveries (also DELETE /api/v1/posts/{id}).Read + Post

Check your plan, limits and cooldown

curl -H "Authorization: Bearer YOUR_API_KEY" https://sopostai.com/api/v1/me

List connected accounts (get account_ids)

curl -H "Authorization: Bearer YOUR_API_KEY" https://sopostai.com/api/v1/accounts

Publish now to two accounts

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"caption":"Hello from my AI bot!","account_ids":[12,15],"hashtags":["SOPostAI"]}' \
  https://sopostai.com/api/v1/posts

Schedule a post (ISO 8601)

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"caption":"Festive offer goes live!","account_ids":[12],"scheduled_at":"2026-12-25T10:30:00+05:30"}' \
  https://sopostai.com/api/v1/posts

Upload an image or video

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" -F "file=@photo.jpg" https://sopostai.com/api/v1/media

Check a post

curl -H "Authorization: Bearer YOUR_API_KEY" https://sopostai.com/api/v1/posts/101

Cancel a scheduled post

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" https://sopostai.com/api/v1/posts/101/cancel

5. Status codes & errors

HTTPMeaning
200 / 201Success / created (post queued or media uploaded).
400Malformed request or invalid JSON.
401Missing, invalid or revoked API key (MCP: JSON-RPC error -32001).
403Read-only key trying to post, staff account, API disabled, no active paid package, or not included in your package.
404Post or endpoint not found.
422Validation, package-limit or moderation failure (content_blocked), upload too large or wrong file type.
429Rate limit reached. Wait for the seconds in Retry-After.

MCP JSON-RPC codes: -32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params / unknown tool, -32001 unauthorized, -32029 rate limited.

6. Rate limits & safety rules

Supported platforms: Facebook, Instagram, Threads, LinkedIn, Pinterest, X / Twitter, YouTube, Blogger, Google Business, Reddit, WordPress. Actual publishing depends on each platform’s approval, account type and media rules.

← Back home