{"openapi":"3.1.0","info":{"title":"dmswift API","version":"3.1.0","description":"Run a Facebook Page and Instagram account from your own software or AI agent: publish and schedule posts, run comment campaigns that reply publicly and by private message, read comments, insights and the inbox. An MCP server over the same credentials is available at POST https://app.dmswift.com/mcp (OAuth 2.1 sign-in or an API key). Full guide: https://app.dmswift.com/llms.txt. Use of this API is subject to https://dmswift.com/acceptable-use. Never message people who did not contact the business first."},"servers":[{"url":"https://app.dmswift.com"}],"security":[{"bearerAuth":[]},{"oauth2":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key created in the dashboard (AI agents page). Scopes: pages:read (List channels and check their permissions); posts:read (Read posts); posts:write (Create, edit and delete posts; upload media); posts:publish (Publish or schedule a post on Facebook or Instagram; comment as the channel); campaigns:read (Read campaigns and dry-run matching); campaigns:write (Create and edit campaigns); analytics:read (Statistics, the conversion funnel and the activity log); contacts:read (Read the contact list and its tags); contacts:write (Tag contacts); kb:read (Search the business knowledge base); kb:write (Add knowledge base entries); inbox:read (Read inbox conversations); inbox:write (Reply in the inbox (24-hour window, never while a human took over)); comments:read (Read comments on live posts); comments:write (Reply to and like comments); comments:moderate (Hide, unhide and delete comments); insights:read (Read Meta insights for channels and posts)"},"oauth2":{"type":"oauth2","description":"OAuth 2.1 for MCP clients: dynamic client registration at /oauth/register, PKCE S256 required, public clients. The access token is an API key with the granted scopes; refresh tokens rotate.","flows":{"authorizationCode":{"authorizationUrl":"https://app.dmswift.com/oauth/authorize","tokenUrl":"https://app.dmswift.com/oauth/token","refreshUrl":"https://app.dmswift.com/oauth/token","scopes":{"pages:read":"List channels and check their permissions","posts:read":"Read posts","posts:write":"Create, edit and delete posts; upload media","posts:publish":"Publish or schedule a post on Facebook or Instagram; comment as the channel","campaigns:read":"Read campaigns and dry-run matching","campaigns:write":"Create and edit campaigns","analytics:read":"Statistics, the conversion funnel and the activity log","contacts:read":"Read the contact list and its tags","contacts:write":"Tag contacts","kb:read":"Search the business knowledge base","kb:write":"Add knowledge base entries","inbox:read":"Read inbox conversations","inbox:write":"Reply in the inbox (24-hour window, never while a human took over)","comments:read":"Read comments on live posts","comments:write":"Reply to and like comments","comments:moderate":"Hide, unhide and delete comments","insights:read":"Read Meta insights for channels and posts"}}}}},"schemas":{"Post":{"type":"object","properties":{"id":{"type":"integer"},"page_id":{"type":"string"},"platform":{"type":"string","enum":["facebook","instagram"],"readOnly":true},"message":{"type":"string","description":"Post text; the caption on Instagram (up to 2,200 characters, 30 hashtags, 20 @mentions)"},"link":{"type":"string","description":"Facebook only; refused on Instagram"},"media":{"type":"array","items":{"type":"object"}},"media_ids":{"type":"array","items":{"type":"string"},"writeOnly":true,"description":"Uploaded file ids (from POST /api/uploads), in order; used when media is absent"},"media_urls":{"type":"array","items":{"type":"string"},"writeOnly":true,"description":"Public image/video URLs fetched into the account first (SSRF-guarded); used when media is absent"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","error","canceled"]},"scheduled_at":{"type":"integer","description":"unix seconds; 0 = unscheduled"},"fb_schedule":{"type":"boolean","description":"Facebook: hand the schedule to Facebook itself (at least 10 minutes out). Ignored on Instagram, whose schedules run on dmswift's worker"},"ig_type":{"type":"string","enum":["feed","carousel","reel","story"],"description":"Instagram channels only (default feed; an edit keeps the current type): feed = exactly 1 photo, carousel = 2-20 photos/videos, reel = 1 video, story = 1 photo or video with no first comment. Photos must be JPEG up to 8 MB. A full 24-hour Instagram publishing quota is 400 err.ig_publish_limit"},"cover_url":{"type":"string","description":"Instagram reels: cover image - an uploaded JPEG or a public https URL. Stored as ig_cover"},"share_to_feed":{"type":"boolean","description":"Instagram reels: also show in the feed (default true). Stored as ig_share_to_feed"},"first_comment":{"type":"string","description":"Posted by the channel right after the post goes live; counts as a comment. Text only on Instagram"},"bg_preset":{"type":"string","description":"Facebook colored background (text-only posts up to 130 characters)"},"fb_post_id":{"type":"string"},"permalink":{"type":"string"},"error":{"type":"string"}}},"Campaign":{"type":"object","required":["name","dm_text"],"properties":{"id":{"type":"integer"},"page_id":{"type":"string"},"name":{"type":"string"},"keywords":{"type":"string","description":"Comma-separated; required unless match_all"},"exclude_keywords":{"type":"string"},"match_all":{"type":"integer","enum":[0,1]},"post_id":{"type":"string","description":"Empty = every post on the Page"},"public_reply":{"type":"string","description":"Newline-separated variants, picked at random"},"dm_text":{"type":"string","description":"Supports the {name} merge token (first name); see API.md for the full token list"},"button_title":{"type":"string"},"button_url":{"type":"string"},"extra_buttons":{"type":"array","maxItems":2,"items":{"type":"object","required":["title","url"],"properties":{"title":{"type":"string","maxLength":20},"url":{"type":"string"}}},"description":"Buttons 2-3, open-link only; requires button_url. Facebook only (Instagram sends just the main link). Returned by GET as the stored JSON string."},"active":{"type":"integer","enum":[0,1]},"hits":{"type":"integer","readOnly":true},"version":{"type":"integer","description":"Bumped by every write. Send the version you read with PUT/PATCH to get 409 err.rule_conflict instead of overwriting a newer save; omit it for last-write-wins."}}},"PlanLimit":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","const":"plan_limit"},"kind":{"type":"string","description":"e.g. agent_actions"},"message_key":{"type":"string"},"upgrade_url":{"type":"string"}}},"DailyCap":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","const":"daily_cap"},"kind":{"type":"string","enum":["publish","comment","dm"]},"cap":{"type":"integer"},"used":{"type":"integer"},"remaining":{"type":"integer"},"resets_at":{"type":"string","format":"date-time"}}}}},"paths":{"/api/pages":{"get":{"summary":"List connected Pages","operationId":"listPages","x-scope":"pages:read","parameters":[{"name":"include","in":"query","schema":{"type":"string","enum":["disconnected"]},"description":"Also list disconnected channels, each flagged disconnected: true"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-scopes":{"get":{"summary":"What this Page token may do","operationId":"pageScopes","x-scope":"pages:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/posts":{"get":{"summary":"List live and/or scheduled posts from Meta","operationId":"listMetaPosts","x-scope":"posts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"scheduled","in":"query","schema":{"type":"string","enum":["1"]},"description":"Return only scheduled posts (Facebook /{page-id}/scheduled_posts + local scheduled posts)"},{"name":"include_scheduled","in":"query","schema":{"type":"string","enum":["1"]},"description":"Include scheduled posts alongside live posts"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts":{"get":{"summary":"List posts","operationId":"listPosts","x-scope":"posts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"status","in":"query","schema":{"type":"string","enum":["draft","scheduled","publishing","published","error","canceled"]}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":500}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Post"}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"post":{"summary":"Create a Facebook or Instagram post (does not publish)","operationId":"createPost","x-scope":"posts:write","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"id":{"type":"integer"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts/{post_id}":{"parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"get":{"summary":"Get one post","operationId":"getPost","x-scope":"posts:read","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"put":{"summary":"Replace an unpublished post","operationId":"updatePost","x-scope":"posts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"delete":{"summary":"Delete a post","operationId":"deletePost","x-scope":"posts:write","parameters":[{"name":"remote","in":"query","schema":{"type":"string","enum":["1"]},"description":"Also delete from Facebook. Instagram media cannot be deleted through the API: the post is removed here only and the answer is { ok: true, remote_deleted: false, note, note_code }"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts/{post_id}/publish":{"post":{"summary":"Publish to Facebook or Instagram - public and irreversible","operationId":"publishPost","description":"Instagram: limit check, then media containers (polled until Meta has processed them), then media_publish, permalink and first comment. 400 err.ig_publish_limit when the 24-hour quota is used up (nothing is created); err.publish_interrupted when the outcome is unknown - never retry it. An approval-mode key gets 202 pending_approval.","x-scope":"posts:publish","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean","description":"Validate without publishing"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts/{post_id}/comments":{"post":{"summary":"Comment as the Page on a published post: Facebook text and/or image; Instagram text only (images refused with err.ig_comment_image_unsupported)","operationId":"commentOnPost","x-scope":"posts:publish","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Comment text (up to 8,000 characters)"},"media_id":{"type":"string","description":"Already-uploaded image filename/id from POST /api/uploads or upload_media"},"media_data":{"type":"string","description":"Base64-encoded image bytes or data:image/...;base64,... URL"},"media_mime":{"type":"string","description":"MIME type when using media_data (defaults to image/png)"},"media":{"type":"object","description":"Uploaded image object from POST /api/uploads"},"media_url":{"type":"string","description":"Publicly reachable image URL, signed URL, or /api/uploads/<file> URL to attach to the comment"},"media_alt":{"type":"string","description":"Optional accessibility alt text for the image"},"fb_object_id":{"type":"string","description":"Optional Facebook post or comment ID when post_id is 0"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"comment_id":{"type":"string"},"attachment_id":{"type":"string"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/uploads":{"post":{"summary":"Upload media by URL (agents) or base64 (browsers)","operationId":"upload","x-scope":"posts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"Publicly reachable image or video URL"},"data":{"type":"string","description":"base64 or data: URL"},"expected_sha256":{"type":"string","description":"With data: the SHA-256 (hex) of the file bytes before encoding. A mismatch is 400 err.checksum_mismatch and nothing is stored. A JPEG missing its end marker or a PNG with a bad CRC is 400 err.invalid_image."},"page_id":{"type":"string","description":"Which channel the file belongs to. Required for a key pinned to a channel that is not the first one on the account - the upload is owned by the account that will publish it, and a pinned key that names no channel is refused rather than guessed at."},"mime":{"type":"string"},"name":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/rules":{"get":{"summary":"List campaigns","operationId":"listCampaigns","x-scope":"campaigns:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"post":{"summary":"Create a campaign","operationId":"createCampaign","x-scope":"campaigns:write","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/rules/{rule_id}":{"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"get":{"summary":"Get one campaign","operationId":"getCampaign","x-scope":"campaigns:read","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"put":{"summary":"Replace a campaign (send the whole rule), or switch it on/off with only { active }","operationId":"updateCampaign","x-scope":"campaigns:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"patch":{"summary":"Change only the named fields; validates only what changes","operationId":"patchCampaign","x-scope":"campaigns:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"delete":{"summary":"Delete a campaign","operationId":"deleteCampaign","x-scope":"campaigns:write","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/test-match":{"post":{"summary":"Dry-run a comment against the campaigns","operationId":"testMatch","x-scope":"campaigns:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"post_id":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/stats":{"get":{"summary":"Engagement totals","operationId":"getStats","x-scope":"analytics:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/log":{"get":{"summary":"Recent automation activity","operationId":"getLog","x-scope":"analytics:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"group","in":"query","description":"Set to 1 to list ONLY comments that came from Facebook groups. They cannot be replied to or messaged, are excluded from every count, and never appear in the default listing.","schema":{"type":"string","enum":["1"]}},{"name":"before","in":"query","schema":{"type":"integer"},"description":"Only rows with id below this (keyset pagination)"},{"name":"commenter","in":"query","schema":{"type":"string"},"description":"Only this commenter_id"},{"name":"since","in":"query","schema":{"type":"string"},"description":"Inclusive UTC start: ISO 8601 or YYYY-MM-DD"},{"name":"until","in":"query","schema":{"type":"string"},"description":"Inclusive UTC end: ISO 8601 or YYYY-MM-DD (a bare date = end of that day)"},{"name":"q","in":"query","schema":{"type":"string","maxLength":200},"description":"Substring search over commenter name, comment text and campaign name"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object"}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/me":{"get":{"summary":"Who this key belongs to","operationId":"getMe","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/keys/self":{"get":{"summary":"This key: scopes, pinned channels, approval mode, caps left today, plan and monthly agent actions","operationId":"getKeySelf","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"integer"},"scopes":{"type":"array","items":{"type":"string"}},"page_ids":{"type":"array","items":{"type":"string"}},"approval":{"type":"string","enum":["auto","ask"]},"oauth":{"type":"boolean"}}},"caps":{"type":"object","properties":{"publish":{"type":"object"},"comment":{"type":"object"},"dm":{"type":"object"}}},"plan":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"api":{"type":"boolean"}}},"agent_actions":{"type":"object","properties":{"used":{"type":"integer"},"limit":{"type":["integer","null"]},"remaining":{"type":["integer","null"]}}}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/billing/status":{"get":{"summary":"Plan, trial, limits and usage (any scope may read)","operationId":"getBillingStatus","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"price_usd":{"type":"number"},"interval":{"type":"string"}}},"status":{"type":"string","enum":["trialing","active","past_due","canceled","frozen"]},"trial_ends_at":{"type":["string","null"]},"current_period_end":{"type":["string","null"]},"cancel_at_period_end":{"type":"boolean"},"limits":{"type":"object","properties":{"channels":{"type":"integer"},"dms":{"type":"integer"},"posts":{"type":"integer"},"agent_actions":{"type":"integer"},"keys":{"type":"integer"},"seats":{"type":"integer"}}},"usage":{"type":"object","properties":{"channels":{"type":"integer"},"dms":{"type":"integer"},"posts":{"type":"integer"},"agent_actions":{"type":"integer"}}},"upgrade_url":{"type":"string"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/posts/{post_id}/thumb":{"get":{"summary":"Thumbnail of a live post","operationId":"getPostThumb","x-scope":"posts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"post_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts/{post_id}/duplicate":{"post":{"summary":"Duplicate a post as a new draft","operationId":"duplicatePost","x-scope":"posts:write","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/page-posts/{post_id}/status":{"post":{"summary":"Cancel or re-schedule a post (scheduling needs posts:publish; a key can never set published)","operationId":"setPostStatus","x-scope":"posts:write","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","canceled"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/uploads/{file}":{"get":{"summary":"Download an uploaded file","operationId":"getUpload","x-scope":"posts:read","parameters":[{"name":"file","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/text-cards":{"post":{"summary":"Render text-on-background JPEGs (one card, or up to 10 slides for a carousel) and get media_ids for create_post. Plain text and fixed options only","operationId":"renderTextCards","x-scope":"posts:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"},"text":{"type":"string","maxLength":600,"description":"One card; a newline is a line break"},"slides":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":600},"description":"Several cards, carousel order"},"format":{"type":"string","enum":["portrait","square","story"],"description":"portrait 1080x1350 (default), square 1080x1080, story 1080x1920 (stories only)"},"preset":{"type":"string","enum":["red-blue","orange-purple","aqua","purple","green","fire","midnight","paper"]},"background":{"type":"object","properties":{"from":{"type":"string","description":"#rrggbb"},"to":{"type":"string","description":"#rrggbb"},"angle":{"type":"integer","minimum":0,"maximum":359}}},"text_color":{"type":"string","description":"#rrggbb"},"footer":{"type":"string","maxLength":40},"logo":{"type":"boolean","description":"false leaves the brand kit logo off"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/text-cards/brand":{"get":{"summary":"The channel text-card brand kit (null when none), with the preset and format names","operationId":"getBrandKit","x-scope":"posts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"put":{"summary":"Replace the channel text-card brand kit; { reset: true } deletes it","operationId":"setBrandKit","x-scope":"posts:write","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preset":{"type":"string"},"background":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"angle":{"type":"integer"}}},"text_color":{"type":"string"},"footer":{"type":"string","maxLength":40},"logo":{"type":["string","null"],"description":"media_id of a JPEG/PNG/WEBP in the account (5 MB, 4096 px); null removes it; omitted keeps it"},"reset":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/upload-links":{"post":{"summary":"Get a one-time upload link (30 minutes, up to max_files files): upload_url takes raw bytes from an agent, url is a page a person opens on their phone","operationId":"createUploadLink","x-scope":"posts:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"},"max_files":{"type":"integer","minimum":1,"maximum":20,"description":"Default 10"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/upload-links/{token}":{"get":{"summary":"The files uploaded through an upload link, as media_ids for create_post","operationId":"getUploadLink","x-scope":"posts:write","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["waiting","uploaded","expired"]},"expired":{"type":"boolean"},"count":{"type":"integer"},"media":{"type":"array","items":{"type":"object","properties":{"media_id":{"type":"string"},"mime":{"type":"string"},"size":{"type":"integer"},"name":{"type":"string"}}}}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/u/{token}/file":{"post":{"summary":"Upload one file through an upload link: the raw bytes as the body, the file's own Content-Type. No Authorization header - the token in the path is the credential. Save Instagram photos as JPEG up to 8 MB.","operationId":"uploadThroughLink","security":[],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-File-Name","in":"header","required":false,"schema":{"type":"string"},"description":"Optional file name (URL-encoded)"}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/gif":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}},"video/quicktime":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"count":{"type":"integer"},"left":{"type":"integer"}}}}}},"409":{"description":"The link has reached its file limit (err.upload_link_full)"},"410":{"description":"The link has expired (err.upload_link_expired)"}}}},"/api/comments":{"get":{"summary":"Comments on the channel's posts, newest first (without post_id: the 10 most recent posts, and next_cursor pages through posts)","operationId":"listComments","x-scope":"comments:read","parameters":[{"name":"page_id","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"post_id","in":"query","schema":{"type":"string"},"description":"Meta post or media id"},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string"},"description":"ISO 8601 or unix seconds"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"post_id":{"type":"string"},"platform":{"type":"string","enum":["facebook","instagram"]},"from":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"text":{"type":"string"},"created_time":{"type":"string"},"like_count":{"type":"integer"},"reply_count":{"type":"integer"},"hidden":{"type":"boolean"},"parent_id":{"type":"string"}}}},"next_cursor":{"type":["string","null"]}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/comments/{comment_id}/reply":{"post":{"summary":"Reply publicly to a comment (counts as a comment against the daily cap; 8,000 characters on Facebook, 2,200 on Instagram; 403 approval_required_for_comment for approval-mode keys)","operationId":"replyToComment","x-scope":"comments:write","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"},"text":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/comments/{comment_id}/hide":{"post":{"summary":"Hide or unhide a comment","operationId":"hideComment","x-scope":"comments:moderate","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"},"hidden":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/comments/{comment_id}/like":{"post":{"summary":"Like a comment (Facebook only; Instagram answers 400 unsupported_on_instagram)","operationId":"likeComment","x-scope":"comments:write","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/comments/{comment_id}":{"delete":{"summary":"Delete a comment (permanent)","operationId":"deleteComment","x-scope":"comments:moderate","parameters":[{"name":"comment_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"page_id","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/insights":{"get":{"summary":"Channel insights from Meta","operationId":"getInsights","x-scope":"insights:read","parameters":[{"name":"page_id","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"period","in":"query","schema":{"type":"string","enum":["day","week","days_28"]}},{"name":"since","in":"query","schema":{"type":"string"},"description":"Date, ISO date-time or unix seconds; default 28 days ago"},{"name":"until","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string"},"period":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"},"metrics":{"type":"object"},"series":{"type":"object"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/insights/posts/{post_id}":{"get":{"summary":"Insights for one live post","operationId":"getPostInsights","x-scope":"insights:read","parameters":[{"name":"page_id","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"post_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/inbox":{"get":{"summary":"Inbox conversations (people who wrote first)","operationId":"listConversations","x-scope":"inbox:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"status","in":"query","schema":{"type":"string","enum":["open","done","snoozed","all"]},"description":"Default open"},{"name":"unread","in":"query","schema":{"type":"string","enum":["1"]}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}},{"name":"offset","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","items":{"type":"object"}},"total":{"type":"integer"},"counts":{"type":"object","properties":{"open":{"type":"integer"},"unread":{"type":"integer"},"done":{"type":"integer"},"snoozed":{"type":"integer"}}}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/inbox/unread-count":{"get":{"summary":"Unread counts","operationId":"inboxUnreadCount","x-scope":"inbox:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"integer"},"conversations":{"type":"integer"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/inbox/{conversation_id}":{"get":{"summary":"One conversation with its messages (oldest first) and its 24-hour window","operationId":"getConversation","x-scope":"inbox:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"before","in":"query","schema":{"type":"integer"},"description":"Only messages with an id below this"},{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"conversation":{"type":"object"},"contact":{"type":"object"},"messages":{"type":"array","items":{"type":"object"}},"has_more":{"type":"boolean"},"window_open":{"type":"boolean"},"window_expires_at":{"type":"integer"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/inbox/{conversation_id}/reply":{"post":{"summary":"Reply privately - inside Meta's 24-hour window only (409 err.inbox_window_closed), never while a human took over (409 human_takeover), never to an opted-out person (409 err.inbox_opted_out), never for approval-mode keys (403 approval_required_for_dm); counts as a dm against the daily cap","operationId":"replyToConversation","x-scope":"inbox:write","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string"},"text":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/stats/{report}":{"get":{"summary":"Per-period statistics series","operationId":"getStatsReport","x-scope":"analytics:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"report","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/analytics/{report}":{"get":{"summary":"Analytics reports: overview, funnel, best-times, unanswered, …","operationId":"getAnalytics","x-scope":"analytics:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"report","in":"path","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","schema":{"type":"integer","enum":[7,14,30,90]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/analytics/export.csv":{"get":{"summary":"Activity export (CSV)","operationId":"exportAnalytics","x-scope":"analytics:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts":{"get":{"summary":"Contacts","operationId":"listContacts","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"search","in":"query","schema":{"type":"string"}},{"name":"tags","in":"query","schema":{"type":"string"}},{"name":"platform","in":"query","schema":{"type":"string","enum":["facebook","instagram"]}},{"name":"subscribed","in":"query","schema":{"type":"string"}},{"name":"seen_within_days","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/stats":{"get":{"summary":"Contact counts","operationId":"contactStats","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/tags":{"get":{"summary":"Tags in use","operationId":"contactTags","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/export.csv":{"get":{"summary":"Contacts export (CSV)","operationId":"exportContacts","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/{contact_id}":{"get":{"summary":"One contact","operationId":"getContact","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/{contact_id}/clicks":{"get":{"summary":"Links one contact clicked","operationId":"contactClicks","x-scope":"contacts:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="},{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/contacts/{contact_id}/tags":{"post":{"summary":"Add tags to a contact","operationId":"tagContact","x-scope":"contacts:write","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/kb":{"get":{"summary":"Knowledge base entries","operationId":"listKnowledge","x-scope":"kb:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}},"post":{"summary":"Add a knowledge base entry","operationId":"addKnowledge","x-scope":"kb:write","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"body":{"type":"string"},"kind":{"type":"string","enum":["faq","note","policy","product"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/kb/summary":{"get":{"summary":"Knowledge base summary","operationId":"knowledgeSummary","x-scope":"kb:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}},"/api/kb/search":{"post":{"summary":"Search the knowledge base (a read; never counted as an agent action)","operationId":"searchKnowledge","x-scope":"kb:read","parameters":[{"name":"page","in":"query","required":true,"schema":{"type":"string"},"description":"Channel id (Facebook Page or Instagram account). Every page-scoped route accepts it as ?page= or ?page_id="}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"401":{"description":"Missing, unknown, revoked or expired key or OAuth token (WWW-Authenticate names the resource metadata)"},"402":{"description":"plan_limit - the plan does not include this, or a monthly allowance is spent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanLimit"}}}},"403":{"description":"route_forbidden | missing_scope | page_forbidden"},"429":{"description":"daily_cap - the per-key daily cap for this kind is spent; or a rate limit with retry_after","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DailyCap"}}}}}}}}}