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
| Tool | What it does | Arguments |
|---|---|---|
get_account_status | Returns 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_accounts | Lists 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_post | Publishes 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_posts | Lists recent, scheduled, published or failed posts, newest first. | status, platform, limit, offset |
get_post_status | Returns a post with per-account delivery status, published links and errors. | post_id* |
cancel_post | Cancels 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.
| Method | Endpoint | Description | Key |
|---|---|---|---|
GET | /api/v1/me | Your profile, active package, remaining posts and account slots, cooldown status and API rate limit. | Any |
GET | /api/v1/accounts | Connected social accounts/pages: id, platform, name, status, can_post. Never returns OAuth tokens. Filter: ?platform=facebook. | Any |
GET | /api/v1/posts | Your 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/posts | Publish 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/media | multipart/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}/cancel | Cancel 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/postsSchedule 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/postsUpload 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
| HTTP | Meaning |
|---|---|
| 200 / 201 | Success / created (post queued or media uploaded). |
| 400 | Malformed request or invalid JSON. |
| 401 | Missing, invalid or revoked API key (MCP: JSON-RPC error -32001). |
| 403 | Read-only key trying to post, staff account, API disabled, no active paid package, or not included in your package. |
| 404 | Post or endpoint not found. |
| 422 | Validation, package-limit or moderation failure (content_blocked), upload too large or wrong file type. |
| 429 | Rate 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
- Rate limit: 60 API requests per hour per user (shared by all your keys). Over the limit you get
429 Too Many Requestswith aRetry-Afterheader. - Anti-spam spacing: posts to the same social account are spaced 2 minutes apart. Extra posts are queued automatically and the response tells you the delivery time.
- Content moderation: adult/nudity, abusive, hate and spam/scam words (plus words blocked by the administrator) are refused with
422and nothing is posted. - Upload limits: images up to 10 MB (JPG, PNG, WebP, GIF), videos up to 100 MB (MP4, MOV). The real file type is checked, not just the name.
- Package limits: your monthly posts, connected accounts and platforms are enforced exactly as in the web composer.
- Account lock: there is no disconnect endpoint. Connected accounts can only be removed by an administrator.
- Keys: each key is shown once and stored only as a SHA-256 hash. Read-only keys cannot post (
403). Revoke a key any time.
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