{"openapi":"3.1.0","info":{"title":"CreatorFlow AI Social Automation API","description":"API for AI assistants and ChatGPT Custom GPTs to schedule posts, publish reels and videos, inspect analytics, and manage social media accounts across Facebook, Instagram, YouTube, and Threads.","version":"1.0.0"},"servers":[{"url":"https://api.creatorflow.in","description":"Production API Server"}],"paths":{"/upload_media":{"post":{"summary":"Upload Image or Video (Base64)","description":"Upload a media file (Base64 data or Data URI) from ChatGPT sandbox to CreatorFlow cloud storage. Returns a permanent public media_url.","operationId":"uploadMedia","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base64":{"type":"string","description":"Base64 encoded media string or Data URI (e.g. data:image/jpeg;base64,...)"},"filename":{"type":"string","description":"Filename with extension (e.g. poster.jpg, graphic.png)"},"mime_type":{"type":"string","description":"MIME type (e.g. image/jpeg, image/png, video/mp4)"}},"required":["base64"]}}}},"responses":{"200":{"description":"Media uploaded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"media_id":{"type":"string"},"media_url":{"type":"string"},"mime_type":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"}}}}}}},"security":[{"BearerAuth":[]}]}},"/create_post":{"post":{"summary":"Immediately Publish Post Across Social Media","description":"Immediately publish a post (text, image, or video reel) to connected accounts using the permanent media_url.","operationId":"createPost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caption":{"type":"string","description":"The caption / text content of the post."},"media_url":{"type":"string","description":"Public media URL returned by upload_media."},"title":{"type":"string","description":"Optional title for YouTube or Facebook post."},"first_comment":{"type":"string","description":"Optional first comment."}},"required":["caption"]}}}},"responses":{"200":{"description":"Post published successfully","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"BearerAuth":[]}]}},"/mcp":{"post":{"summary":"Execute CreatorFlow Tool via MCP JSON-RPC","description":"Execute actions like create_post, schedule_post, list_social_accounts, upload_media, get_analytics_overview via JSON-RPC. Supports base64 media_data for generated images.","operationId":"executeMcpTool","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","example":"2.0"},"id":{"type":"number","example":1},"method":{"type":"string","example":"tools/call"},"params":{"type":"object","properties":{"name":{"type":"string","example":"create_post"},"arguments":{"type":"object"}},"required":["name"]}},"required":["jsonrpc","method","params"]}}}},"responses":{"200":{"description":"Tool execution response","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"BearerAuth":[]}]}},"/api/automations/schedule-post":{"post":{"summary":"Schedule a Social Media Post","description":"Schedule a post (text, image, or video reel) to be published at a future date and time across connected accounts.","operationId":"schedulePost","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"caption_template":{"type":"string","description":"The caption and text content of the post."},"title_template":{"type":"string","description":"Title of the post or video (required for YouTube)."},"media_url_field":{"type":"string","description":"Public URL of an image or video to attach."},"first_comment_template":{"type":"string","description":"Optional first comment to automatically post."},"scheduled_at":{"type":"string","description":"ISO 8601 future timestamp (e.g. 2026-09-15T15:30:00Z)."},"targets":{"type":"array","description":"Target accounts list.","items":{"type":"object","properties":{"platform":{"type":"string","enum":["facebook","instagram","youtube","threads"]},"target_id":{"type":"string"}},"required":["platform"]}}},"required":["caption_template","scheduled_at","targets"]}}}},"responses":{"200":{"description":"Post scheduled successfully","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"BearerAuth":[]}]}},"/api/analytics/overview":{"get":{"summary":"Get Audience & Analytics Overview","description":"Fetch aggregate follower count, views, impressions, and engagement metrics across platforms.","operationId":"getAnalyticsOverview","responses":{"200":{"description":"Analytics overview data","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"BearerAuth":[]}]}},"/api/automations/scheduled-posts":{"get":{"summary":"List Scheduled Posts Queue","description":"Fetch upcoming scheduled posts and recent publishing statuses.","operationId":"listScheduledPosts","responses":{"200":{"description":"List of scheduled posts","content":{"application/json":{"schema":{"type":"object"}}}}},"security":[{"BearerAuth":[]}]}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Enter your CreatorFlow API key (cf_live_...)"}}}}