{"openapi":"3.1.0","info":{"title":"PostPlan.io Developer API","version":"1.0.0","description":"Simple, high-performance REST and Hosted Model Context Protocol (MCP) API for scheduling and publishing content across 10 social networks (Instagram, TikTok, YouTube, X/Twitter, LinkedIn, Facebook, Pinterest, Threads, Bluesky, Snapchat).","contact":{"name":"PostPlan Support","url":"https://postplan.io"}},"servers":[{"url":"https://postplan.io","description":"Production Server"},{"url":"http://localhost:4000","description":"Local Development Server"}],"security":[{"BearerAuth":[]}],"paths":{"/api/v1/accounts":{"get":{"summary":"List Connected Accounts","description":"Returns all connected social media accounts within the authorized workspace.","operationId":"listAccounts","responses":{"200":{"description":"Array of connected accounts with network platforms and identifiers"},"401":{"description":"Invalid or missing Bearer API key"},"429":{"description":"Rate limit exceeded (60 req/min)"}}}},"/api/v1/posts":{"get":{"summary":"List Posts","description":"List scheduled, published, and draft posts with platform fan-out outcomes.","operationId":"listPosts","responses":{"200":{"description":"List of posts"},"401":{"description":"Unauthorized"}}},"post":{"summary":"Create and Schedule/Publish Post","description":"Schedules or immediately publishes a post across multiple social network accounts.","operationId":"createPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["content","accountIds"],"properties":{"content":{"type":"string","description":"Post caption content"},"accountIds":{"type":"array","items":{"type":"string"},"description":"List of connected account IDs"},"scheduledFor":{"type":"string","format":"date-time","description":"ISO timestamp for scheduled publication"},"firstComment":{"type":"string","description":"Optional first comment"},"mediaUrls":{"type":"array","items":{"type":"string"},"description":"Public media URLs (images or videos)"},"platformConfigurations":{"type":"object","description":"Per-platform overrides (YouTube titles, Pinterest boards, TikTok privacy, Reels)"}}}}}},"responses":{"200":{"description":"Post created and scheduled/published successfully"},"400":{"description":"Validation error or invalid targets"},"401":{"description":"Unauthorized"}}}},"/api/v1/posts/{id}":{"get":{"summary":"Get Post Details","description":"Retrieves status, fan-out records, and live social media URLs for a post.","operationId":"getPost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Post details"},"404":{"description":"Post not found"}}},"delete":{"summary":"Cancel or Delete Post","description":"Deletes a post and cancels any pending remote schedule executions.","operationId":"deletePost","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Post cancelled and deleted"},"404":{"description":"Post not found"}}}},"/api/v1/post-results":{"get":{"summary":"List Delivery Results","description":"Returns per-target delivery results with live post links (e.g. x.com, instagram.com).","operationId":"listPostResults","responses":{"200":{"description":"Delivery results array"}}}},"/api/v1/social-accounts/connect-link":{"post":{"summary":"Create White-Label Connect Link","description":"Generates an OAuth authorization link to connect social media accounts without branding.","operationId":"createConnectLink","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["platform"],"properties":{"platform":{"type":"string","example":"instagram"},"returnUrl":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"OAuth link generated"}}}},"/api/mcp":{"post":{"summary":"Hosted Model Context Protocol (MCP) JSON-RPC","description":"JSON-RPC 2.0 endpoint for AI assistants (Cursor, Claude, Copilot) using Bearer API keys.","operationId":"mcpRpc","responses":{"200":{"description":"JSON-RPC 2.0 response"}}},"get":{"summary":"MCP Server-Sent Events (SSE) Stream","description":"Persistent SSE stream for streaming AI agent tool calling.","operationId":"mcpSse","responses":{"200":{"description":"Event stream (text/event-stream)"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"pp_live_...","description":"Enter your workspace API key (starts with pp_live_)"}}}}