{"openapi":"3.1.0","info":{"title":"Loopah API","version":"1.0.0","description":"Agent-facing API for Loopah — generate, schedule and publish branded social content. Authenticate with a Loopah API key (loopah_sk_...) as an HTTP Bearer token. Keys are scoped to specific brands and capabilities (generate/schedule/publish). An MCP server wrapping these endpoints is available at /api/mcp."},"servers":[{"url":"https://loopah.good-scratch.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Loopah API key, e.g. 'loopah_sk_<id>_<secret>'. Mint at /g/autoposter/admin/keys."}}},"security":[{"apiKey":[]}],"paths":{"/api/autoposter/clients":{"get":{"summary":"List brands this key can access","operationId":"listBrands","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/ideas":{"get":{"summary":"List post ideas for a brand","operationId":"listIdeas","parameters":[{"name":"client","in":"query","required":true,"schema":{"type":"string"},"description":"Brand slug, e.g. 'pasul'."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/ideas/generate":{"post":{"summary":"Brainstorm new post ideas (requires 'generate')","operationId":"generateIdeas","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["client"],"properties":{"client":{"type":"string"},"n":{"type":"integer","minimum":1,"maximum":10},"kind":{"type":"string","enum":["mixed","carousel","static"]},"steer":{"type":"string","maxLength":400}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/generate":{"post":{"summary":"Generate a carousel (requires 'generate')","operationId":"generateCarousel","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["client","topic"],"properties":{"client":{"type":"string"},"topic":{"type":"string"},"vibe":{"type":"string"},"slideCount":{"type":"integer","minimum":1,"maximum":10},"personalityId":{"type":"string"},"url":{"type":"string"},"info":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/generate-static":{"post":{"summary":"Generate a single-image post (requires 'generate')","operationId":"generateStatic","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["client","topic"],"properties":{"client":{"type":"string"},"topic":{"type":"string"},"pillar":{"type":"string"},"concept":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/history":{"get":{"summary":"List saved carousels/statics for a brand","operationId":"getHistory","parameters":[{"name":"client","in":"query","required":true,"schema":{"type":"string"},"description":"Brand slug, e.g. 'pasul'."},{"name":"kind","in":"query","schema":{"type":"string","enum":["carousel","static"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/clients/{slug}/calendar":{"get":{"summary":"Get the publishing calendar for a brand","operationId":"getCalendar","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/clients/{slug}/carousels/{carouselSlug}/schedule":{"post":{"summary":"Schedule a carousel for auto-publishing (requires 'schedule')","operationId":"scheduleCarousel","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}},{"name":"carouselSlug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slotDate":{"type":"string","description":"YYYY-MM-DD (optional; omit to auto-assign)."},"slotTime":{"type":"string","description":"HH:MM 24h (optional)."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}},"/api/autoposter/clients/{slug}/instagram/publish":{"post":{"summary":"Publish a carousel to the brand's Instagram now (requires 'publish')","operationId":"publishCarousel","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["carouselSlug"],"properties":{"carouselSlug":{"type":"string"},"dryRun":{"type":"boolean","description":"Validate without actually posting."},"captionOverride":{"type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key."},"402":{"description":"Out of trial credits (see body for a payment pointer)."},"403":{"description":"API key lacks the required capability or brand access."}}}}}}