{"openapi":"3.1.0","info":{"title":"GrowSocmed API","version":"1","description":"Publish and schedule posts to Instagram, Facebook Pages and Threads; read and answer comments and Instagram DMs; statistics, short links, ideas, AI agents and webhooks.\n\n- JSON in snake_case, times in ISO 8601 UTC.\n- Errors: `{ \"error\": { \"code\", \"message\", \"details\" } }` with stable codes.\n- Rate limit: 60 requests a minute + 5 per active social account (at most 600), shared by all your keys and MCP; headers `RateLimit-*`, 429 with `Retry-After`.\n- `POST /posts` takes an `Idempotency-Key` header.\n- Webhooks are signed: `Grow-Signature: t=…,v1=HMAC-SHA256(\"<t>.<body>\")`.\n- MCP server: `/api/mcp` (OAuth or API key).\n- API keys are long-lived: they keep working after you sign out and end only when you delete them (Developer → API keys). OAuth grants end when you sign out of GrowPaces, and 90 days after you allowed them."},"servers":[{"url":"https://socmed.growpaces.com/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"API key from Developer → API keys (gs_…). An unbound key takes the workspace from the X-Workspace header."}},"schemas":{},"parameters":{}},"paths":{"/api/v1/me":{"get":{"tags":["Me"],"summary":"The signed-in user, the current workspace and every workspace they can open","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"image":{"type":["string","null"]}},"required":["id","name","email","image"]},"workspace_id":{"type":"string"},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"is_default":{"type":"boolean"}},"required":["id","name","role","is_default"]}},"access":{"type":"object","properties":{"role":{"type":"string"},"permissions":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["role","permissions"]},"is_admin":{"type":"boolean"},"display_mode":{"type":"string","enum":["business","developer"]},"language":{"type":["string","null"],"enum":["en","id","ms","th","zh",null]}},"required":["user","workspace_id","workspaces","access","is_admin","display_mode","language"]}}}}}},"delete":{"tags":["Me"],"summary":"Delete your GrowSocmed data: the workspaces you own (accounts, posts, media) and your place in others. Your GrowPaces account stays. Send confirm: \"DELETE\".","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"string","enum":["DELETE"]}},"required":["confirm"]}}}},"responses":{"204":{"description":"Deleted"}}}},"/api/v1/workspaces":{"post":{"tags":["Me"],"summary":"Create a workspace (you own it) and switch to it","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"is_default":{"type":"boolean"}},"required":["id","name","role","is_default"]}}}}}},"get":{"tags":["Me"],"summary":"Your workspaces with their settings and number of accounts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"is_default":{"type":"boolean"},"external_id":{"type":["string","null"]},"media_retention_days":{"type":"number","description":"Days files stay after their posts are published: 0 (about an hour), 1, 7 or 30"},"posting_times":{"type":"array","items":{"type":"string"},"description":"Daily \"HH:MM\" slots the composer offers"},"accounts":{"type":"number"},"created_at":{"type":"string"}},"required":["id","name","role","is_default","external_id","media_retention_days","posting_times","accounts","created_at"]}}},"required":["data"]}}}}}}},"/api/v1/workspaces/{id}/activate":{"post":{"tags":["Me"],"summary":"Work in another of your workspaces (the dashboard session switches)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"}},"required":["workspace_id"]}}}}}}},"/api/v1/workspaces/{id}":{"get":{"tags":["Me"],"summary":"One of your workspaces","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"is_default":{"type":"boolean"},"external_id":{"type":["string","null"]},"media_retention_days":{"type":"number","description":"Days files stay after their posts are published: 0 (about an hour), 1, 7 or 30"},"posting_times":{"type":"array","items":{"type":"string"},"description":"Daily \"HH:MM\" slots the composer offers"},"accounts":{"type":"number"},"created_at":{"type":"string"}},"required":["id","name","role","is_default","external_id","media_retention_days","posting_times","accounts","created_at"]}}}}}},"patch":{"tags":["Me"],"summary":"Rename a workspace or change its settings (owners and admins)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"external_id":{"type":["string","null"],"maxLength":200},"media_retention_days":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]},{"type":"number","enum":[7]},{"type":"number","enum":[30]}]},"posting_times":{"type":"array","items":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"maxItems":48}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"is_default":{"type":"boolean"},"external_id":{"type":["string","null"]},"media_retention_days":{"type":"number","description":"Days files stay after their posts are published: 0 (about an hour), 1, 7 or 30"},"posting_times":{"type":"array","items":{"type":"string"},"description":"Daily \"HH:MM\" slots the composer offers"},"accounts":{"type":"number"},"created_at":{"type":"string"}},"required":["id","name","role","is_default","external_id","media_retention_days","posting_times","accounts","created_at"]}}}}}},"delete":{"tags":["Me"],"summary":"Delete a workspace with its accounts, posts, media and settings (owner only; send its name to confirm). Your last workspace stays.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm_name":{"type":"string"}},"required":["confirm_name"]}}}},"responses":{"204":{"description":"Deleted"}}}},"/api/v1/me/settings":{"get":{"tags":["Me"],"summary":"Your email notifications and dashboard view","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"email_settings":{"type":"object","properties":{"post_failed":{"type":"boolean"},"account_reconnect":{"type":"boolean"},"weekly_recap":{"type":"boolean"},"outlier_posts":{"type":"boolean"},"getting_started":{"type":"boolean"}}},"display_mode":{"type":"string","enum":["business","developer"]},"language":{"type":["string","null"],"enum":["en","id","ms","th","zh",null]}},"required":["email_settings","display_mode","language"]}}}}}},"patch":{"tags":["Me"],"summary":"Turn emails on or off, switch the dashboard view, or save the dashboard language","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email_settings":{"type":"object","properties":{"post_failed":{"type":"boolean"},"account_reconnect":{"type":"boolean"},"weekly_recap":{"type":"boolean"},"outlier_posts":{"type":"boolean"},"getting_started":{"type":"boolean"}}},"display_mode":{"type":"string","enum":["business","developer"]},"language":{"type":["string","null"],"enum":["en","id","ms","th","zh",null]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"email_settings":{"type":"object","properties":{"post_failed":{"type":"boolean"},"account_reconnect":{"type":"boolean"},"weekly_recap":{"type":"boolean"},"outlier_posts":{"type":"boolean"},"getting_started":{"type":"boolean"}}},"display_mode":{"type":"string","enum":["business","developer"]},"language":{"type":["string","null"],"enum":["en","id","ms","th","zh",null]}},"required":["email_settings","display_mode","language"]}}}}}}},"/api/v1/media":{"get":{"tags":["Media"],"summary":"List the workspace's media library, newest first","parameters":[{"schema":{"type":"string","enum":["image","video","document"]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Cursor: created_at of the last file of the previous page"},"required":false,"description":"Cursor: created_at of the last file of the previous page","name":"before","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}}}},"post":{"tags":["Media"],"summary":"Start a presigned upload: PUT the file to upload_url, then call complete","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255},"mime_type":{"type":"string"},"size_bytes":{"type":"integer","exclusiveMinimum":0}},"required":["file_name","mime_type","size_bytes"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]},"upload_url":{"type":"string"}},"required":["media","upload_url"]}}}}}}},"/api/v1/media/usage":{"get":{"tags":["Media"],"summary":"Storage used over every workspace of the owner, and the plan's limit","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"used_bytes":{"type":"number"},"limit_bytes":{"type":"number"},"files":{"type":"number"}},"required":["used_bytes","limit_bytes","files"]}}}}}}},"/api/v1/media/{id}":{"get":{"tags":["Media"],"summary":"One file of the media library","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"required":["media"]}}}}}},"patch":{"tags":["Media"],"summary":"Change a file's alt text, name, or whether it is kept (never deleted automatically)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alt_text":{"type":["string","null"],"maxLength":1000},"original_name":{"type":"string","minLength":1,"maxLength":255},"keep":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"required":["media"]}}}}}},"delete":{"tags":["Media"],"summary":"Delete a file (not while a scheduled post uses it)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}}}}},"/api/v1/media/bulk-delete":{"post":{"tags":["Media"],"summary":"Delete several files at once (none is deleted when a scheduled post uses one)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}}}}},"/api/v1/media/upload":{"post":{"tags":["Media"],"summary":"Upload a file in one request (multipart field `file`, up to 100 MB); larger files use /media/uploads","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"required":["media"]}}}}}}},"/api/v1/media/uploads":{"post":{"tags":["Media"],"summary":"Start a chunked upload: PUT each part (part_size bytes, the last one shorter) to /media/{id}/parts/{n}, then call complete. Parts can be sent again and in any order.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_name":{"type":"string","minLength":1,"maxLength":255},"mime_type":{"type":"string"},"size_bytes":{"type":"integer","exclusiveMinimum":0}},"required":["file_name","mime_type","size_bytes"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]},"part_size":{"type":"number"},"part_count":{"type":"number"}},"required":["media","part_size","part_count"]}}}}}}},"/api/v1/media/{id}/parts/{part}":{"put":{"tags":["Media"],"summary":"Upload one part (raw bytes in the body) of a chunked upload","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"part","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"part":{"type":"number"},"size_bytes":{"type":"number"}},"required":["part","size_bytes"]}}}}}}},"/api/v1/media/{id}/complete":{"post":{"tags":["Media"],"summary":"Tell the server the upload finished (parts are joined first); the file is checked in the background","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"required":["media"]}}}}}}},"/api/v1/media/from-url":{"post":{"tags":["Media"],"summary":"Copy a JPEG, PNG, MP4 or MOV from a public URL into the media library; it is checked in the background","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"file_name":{"type":"string","minLength":1,"maxLength":255}},"required":["url"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"page_count":{"type":["number","null"]},"status":{"type":"string","enum":["pending","ready","failed","expired"]},"original_name":{"type":"string"},"mime_type":{"type":"string"},"size_bytes":{"type":"number"},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"duration_ms":{"type":["number","null"]},"frame_rate":{"type":["number","null"]},"fail_reason":{"type":["string","null"]},"alt_text":{"type":["string","null"]},"keep":{"type":"boolean","description":"Kept files are never deleted automatically"},"used_in_posts":{"type":"number"},"expires_at":{"type":["string","null"],"description":"When the file is deleted automatically; null = never"},"url":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","type","status","original_name","mime_type","size_bytes","width","height","duration_ms","frame_rate","fail_reason","alt_text","keep","url","created_at"]}},"required":["media"]}}}}}}},"/api/v1/media/upload-links":{"post":{"tags":["Media"],"summary":"A link that uploads files into the media library without an API key (for AI agents with a terminal): POST multipart field `file` (≤ 100 MB) or PUT the raw bytes with ?name= (any size up to the plan's limit). It works 30 minutes from its last use, at most 6 hours.","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string"},"expires_at":{"type":"string"},"curl":{"type":"string"}},"required":["upload_url","expires_at","curl"]}}}}}}},"/api/v1/admin/overview":{"get":{"tags":["Admin"],"summary":"Users, accounts, plans and revenue at a glance","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/users":{"get":{"tags":["Admin"],"summary":"Users, newest first, with plan, balance and accounts","parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/users/{id}/subscription":{"put":{"tags":["Admin"],"summary":"Set a user's plan by hand (e.g. a partner, a refund, a complimentary period)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan_code":{"type":"string"},"period_end":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["active","trialing","expired"],"default":"active"}},"required":["plan_code","period_end"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/users/{id}/wallet":{"post":{"tags":["Admin"],"summary":"Add to or take from a user's balance (adjustment with a note)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"integer"},"note":{"type":"string","minLength":1,"maxLength":200}},"required":["amount","note"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/plans":{"get":{"tags":["Admin"],"summary":"Plans with their prices and limits","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/plans/{code}":{"patch":{"tags":["Admin"],"summary":"Change a plan's name, monthly price in US dollars, limits or availability","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"price_monthly_usd":{"type":"number","minimum":0},"limits":{"type":"object","properties":{"accounts":{"type":["integer","null"]},"posts_per_month":{"type":["integer","null"]},"storage_gb":{"type":"number"},"uploads_per_hour":{"type":"integer"},"video_mb":{"type":"integer"},"members":{"type":["integer","null"]},"api":{"type":"boolean"},"inbox":{"type":"boolean"},"automations":{"type":"boolean"},"links":{"type":"integer"},"custom_link_names":{"type":"boolean"},"agents":{"type":"integer"},"knowledge":{"type":"integer"},"knowledge_chars":{"type":"integer"},"knowledge_per_day":{"type":"integer"}}},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/billing-settings":{"get":{"tags":["Admin"],"summary":"Exchange rate (rupiah per US dollar) and the add-on pack's monthly price in US dollars","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["Admin"],"summary":"Change the exchange rate or the add-on pack's price","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"usd_idr_rate":{"type":"number","exclusiveMinimum":0},"addon_price_usd":{"type":"number","exclusiveMinimum":0}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/vouchers":{"get":{"tags":["Admin"],"summary":"Vouchers","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Admin"],"summary":"Create a voucher (percent, rupiah amount, or free months of a plan)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Za-z0-9_-]{3,40}$"},"kind":{"type":"string","enum":["percent","amount","free_plan"]},"value":{"type":"integer","minimum":1},"plan_code":{"type":["string","null"]},"max_redemptions":{"type":["integer","null"],"minimum":1},"expires_at":{"type":["string","null"],"format":"date-time"}},"required":["code","kind","value"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/vouchers/{code}":{"patch":{"tags":["Admin"],"summary":"Turn a voucher on or off","parameters":[{"schema":{"type":"string"},"required":true,"name":"code","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/totp/status":{"get":{"tags":["Admin"],"summary":"Whether a second factor is set and this session is elevated","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/totp/setup":{"post":{"tags":["Admin"],"summary":"Start setting a second factor: scan the otpauth link, then verify a code","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/totp/verify":{"post":{"tags":["Admin"],"summary":"Verify a code: finishes the setup, or elevates this session for 30 minutes","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":8}},"required":["code"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/totp/lock":{"post":{"tags":["Admin"],"summary":"End this session's elevation now (lock the admin panel)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/blocked-domains":{"get":{"tags":["Admin"],"summary":"Domains no short link may point to (admin list; Komdigi counted)","parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Admin"],"summary":"Block a domain (and its subdomains); active links to it are blocked","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","minLength":3,"maxLength":253},"reason":{"type":"string","maxLength":200}},"required":["domain"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/blocked-domains/{domain}":{"delete":{"tags":["Admin"],"summary":"Unblock a domain (blocked links stay blocked until changed)","parameters":[{"schema":{"type":"string"},"required":true,"name":"domain","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/link-reports":{"get":{"tags":["Admin"],"summary":"Abuse reports on short links, newest first","parameters":[{"schema":{"type":"string","enum":["open","resolved"],"default":"open"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/link-reports/{id}":{"patch":{"tags":["Admin"],"summary":"Resolve a report, optionally blocking its link","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"block_link":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/connect-pauses":{"get":{"tags":["Admin"],"summary":"Platforms where connecting new accounts is paused","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/connect-pauses/{platform}":{"put":{"tags":["Admin"],"summary":"Pause connecting new accounts on a platform (existing accounts keep working)","parameters":[{"schema":{"type":"string","maxLength":30},"required":true,"name":"platform","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Admin"],"summary":"Allow connecting again","parameters":[{"schema":{"type":"string","maxLength":30},"required":true,"name":"platform","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/headless-requests":{"get":{"tags":["Admin"],"summary":"Workspaces that asked for headless connect, and those allowed","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/headless-requests/{workspace_id}":{"patch":{"tags":["Admin"],"summary":"Allow or stop headless connect for a workspace","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workspace_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean"}},"required":["approved"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/analytics":{"get":{"tags":["Admin"],"summary":"Acquisition (sign-ups per day), retention (weekly cohorts still posting), engagement (posts, replies, DMs per day) and API/MCP use, last 30 days","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/feed/sources":{"get":{"tags":["Feed"],"summary":"What Feed can search and reply to on each platform","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/accounts/{id}/feed/search":{"get":{"tags":["Feed"],"summary":"Find public posts through a connected account: Threads keyword/tag, Instagram account (by username) or hashtag, Facebook Page, YouTube keyword, X keyword. Same search within 5 minutes is cached. X searches are paid from the owner's balance per post returned.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["keyword","tag","account","hashtag","page"],"default":"keyword"},"required":false,"name":"mode","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":512},"required":true,"name":"q","in":"query"},{"schema":{"type":"string","enum":["top","recent"],"default":"top"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string","enum":["text","image","video"]},"required":false,"name":"media_type","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/accounts/{id}/feed/posts/{postId}/thread":{"get":{"tags":["Feed"],"summary":"The top post of a found reply's thread, and the post it answers when different (Threads)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"required":true,"name":"postId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/accounts/{id}/feed/posts/{postId}/reply":{"post":{"tags":["Feed"],"summary":"Reply publicly to a found post on Threads, YouTube (a comment) or X (paid from balance). 20 an hour, 150 a day per account; one reply per post; no same text to another post within a day.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,64}$"},"required":true,"name":"postId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":10000}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"charged":{"type":"number"}},"required":["id","charged"]}}}}}}},"/api/v1/accounts":{"get":{"tags":["Accounts"],"summary":"Social accounts connected to the workspace","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["active","expired","disconnected"]},"plan_suspended":{"type":"boolean"},"expired_reason":{"type":["string","null"]},"token_expires_at":{"type":["string","null"]},"connected_at":{"type":"string"},"grants":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"]}},"required":["provider","scopes","expires_at"]}}},"required":["id","platform","username","display_name","avatar_url","status","plan_suspended","expired_reason","token_expires_at","connected_at","grants"]}}},"required":["data"]}}}}}}},"/api/v1/accounts/{id}":{"delete":{"tags":["Accounts"],"summary":"Disconnect an account: its tokens and the data read from it are deleted","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected"}}}},"/api/v1/accounts/{id}/activate":{"post":{"tags":["Accounts"],"summary":"Make a suspended account active; when the plan is full, the most recently connected active account is suspended instead","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suspended_account_id":{"type":["string","null"]}},"required":["suspended_account_id"]}}}}}}},"/api/v1/accounts/{id}/move":{"post":{"tags":["Accounts"],"summary":"Move an account to another workspace of the same owner. Its scheduled posts here are canceled; its comments, DMs and automations go with it (automations stop using this workspace's AI agents).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","format":"uuid"}},"required":["workspace_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"},"canceled_targets":{"type":"number"}},"required":["workspace_id","canceled_targets"]}}}}}}},"/api/v1/accounts/youtube/upload-quota":{"get":{"tags":["Accounts"],"summary":"YouTube uploads left today: the API quota is shared by every GrowSocmed user and resets at midnight Pacific time","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":"number"},"remaining":{"type":"number"},"resets_at":{"type":"string"}},"required":["used","limit","remaining","resets_at"]}}}}}}},"/api/v1/accounts/{id}/publishing-limit":{"get":{"tags":["Accounts"],"summary":"Posts published on the account in the last 24 hours against the platform's limit; over it, new posts wait (they do not fail)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"used":{"type":"number"},"limit":{"type":["number","null"]},"remaining":{"type":["number","null"]},"next_slot_at":{"type":["string","null"]}},"required":["used","limit","remaining","next_slot_at"]}}}}}}},"/api/v1/posts/import":{"post":{"tags":["Posts"],"summary":"Schedule up to 100 posts from CSV (columns time/waktu, text/teks, media, accounts, options). Each row goes to account_ids, or to the accounts named in its `accounts` column (usernames or ids, separated by |); `options` is a JSON object keyed by platform ({\"youtube\":{\"title\":\"…\",\"made_for_kids\":false}}). Times are read in `timezone` (any IANA zone). dry_run only checks the rows; importing the same file again creates no duplicates.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":50},"account_id":{"type":"string","format":"uuid"},"timezone":{"type":"string","maxLength":64,"default":"Asia/Jakarta"},"csv":{"type":"string","maxLength":500000},"dry_run":{"type":"boolean","default":true}},"required":["csv"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/platform-rules":{"get":{"tags":["Posts"],"summary":"What each platform accepts (text, media, limits)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"object","additionalProperties":{}}},"required":["rules"]}}}}}}},"/api/v1/posts":{"post":{"tags":["Posts"],"summary":"Create a post for one or more accounts, now or scheduled. Every account is checked first; one invalid account rejects the whole post unless skip_invalid is true.","parameters":[{"schema":{"type":"string","maxLength":200},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":70000,"default":""},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"targets":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"text":{"type":"string","maxLength":70000},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20},"options":{"type":"object","additionalProperties":{}}},"required":["account_id"]},"minItems":1,"maxItems":50},"scheduled_at":{"type":"string","format":"date-time"},"idea_id":{"type":"string","format":"uuid"},"skip_invalid":{"type":"boolean"}},"required":["targets"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]},"replayed":{"type":"boolean"},"skipped":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"issues":{"type":"array","items":{"type":"object","additionalProperties":{}}}},"required":["account_id","issues"]}}},"required":["post","replayed","skipped"]}}}}}},"get":{"tags":["Posts"],"summary":"List posts, newest schedule first; from/to filter by schedule time (calendar)","parameters":[{"schema":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["scheduled","history"]},"required":false,"name":"view","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}}}}},"/api/v1/posts/counts":{"get":{"tags":["Posts"],"summary":"Number of posts in each status","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"counts":{"type":"object","additionalProperties":{"type":"number"}},"scheduled":{"type":"number"}},"required":["counts","scheduled"]}}}}}}},"/api/v1/posts/{id}":{"get":{"tags":["Posts"],"summary":"Get a post","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}},"patch":{"tags":["Posts"],"summary":"Change a post's text, media, per-account content or options, or time. A scheduled post can change for every account; a failed or partly published post only for the accounts that failed (then call retry).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":70000},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20},"scheduled_at":{"type":"string","format":"date-time"},"targets":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"text":{"type":["string","null"],"maxLength":70000},"media_ids":{"type":["array","null"],"items":{"type":"string","format":"uuid"},"maxItems":20},"options":{"type":"object","additionalProperties":{}}},"required":["account_id"]},"maxItems":50}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}},"delete":{"tags":["Posts"],"summary":"Cancel the accounts of a post that have not published yet","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}}},"/api/v1/posts/{id}/retry":{"post":{"tags":["Posts"],"summary":"Publish the failed accounts of a post again, now","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}}},"/api/v1/posts/{id}/remove":{"post":{"tags":["Posts"],"summary":"Remove a finished post (published, failed, canceled) from the history; nothing is deleted on the platforms","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"}}}},"/api/v1/posts/{id}/targets/{targetId}/remote":{"delete":{"tags":["Posts"],"summary":"Delete a published post on the platform (where the platform allows it: see platform-rules capabilities.deletePost). The post stays in the history with removed_at. X bills it from the balance.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"targetId","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}},"patch":{"tags":["Posts"],"summary":"Change the text of a published post on the platform (where the platform allows it: see platform-rules capabilities.editPost). The account's text in GrowSocmed becomes the new text.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"targetId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":70000}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}}},"/api/v1/posts/{id}/targets/{targetId}/comments":{"post":{"tags":["Posts"],"summary":"Turn comments off or on for a published Instagram post (comment_enabled on the media)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"targetId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"status":{"type":"string","enum":["scheduled","publishing","published","partial","failed","canceled"]},"source":{"type":"string"},"scheduled_at":{"type":"string"},"created_at":{"type":"string"},"created_by":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["image","video","document"]},"url":{"type":["string","null"]}},"required":["id","type","url"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"status":{"type":"string","enum":["pending","publishing","published","failed","canceled"]},"text":{"type":["string","null"]},"media_ids":{"type":["array","null"],"items":{"type":"string"}},"permalink":{"type":["string","null"]},"error_code":{"type":["string","null"]},"error_message":{"type":["string","null"]},"published_at":{"type":["string","null"]},"options":{"type":"object","additionalProperties":{}},"removed_at":{"type":["string","null"]},"comments_disabled":{"type":"boolean"},"remote":{"type":"object","properties":{"edit":{"type":"boolean"},"delete":{"type":"boolean"},"reconnect":{"type":"boolean"},"comment_toggle":{"type":"boolean"}},"required":["edit","delete","reconnect","comment_toggle"]}},"required":["id","account_id","platform","username","display_name","avatar_url","status","text","media_ids","permalink","error_code","error_message","published_at","options","removed_at","comments_disabled","remote"]}}},"required":["id","text","status","source","scheduled_at","created_at","created_by","media","targets"]}},"required":["post"]}}}}}}},"/api/v1/composer-settings":{"get":{"tags":["Posts"],"summary":"Saved account groups and each account's last options","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":60},"account_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":200}},"required":["id","name","account_ids"]},"maxItems":50},"defaults":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}}},"required":["groups","defaults"]}}}}}},"patch":{"tags":["Posts"],"summary":"Replace the saved groups and/or merge accounts' last options (TikTok privacy and interactions are never kept)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":60},"account_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":200}},"required":["id","name","account_ids"]},"maxItems":50},"defaults":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":64},"name":{"type":"string","minLength":1,"maxLength":60},"account_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":200}},"required":["id","name","account_ids"]},"maxItems":50},"defaults":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{}}}},"required":["groups","defaults"]}}}}}}},"/api/v1/comments":{"get":{"tags":["Comments"],"summary":"Comments from people (not the account's own replies), newest first, with the replies under them","parameters":[{"schema":{"type":"string","enum":["unreplied","replied","ignored","all"],"default":"unreplied"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"account_id","in":"query"},{"schema":{"type":"string","enum":["comment","mention","all"],"default":"all"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","enum":["recent","likes"],"default":"recent"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":30},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]}},"required":["id","platform","username","display_name"]},"post":{"type":"object","properties":{"platform_post_id":{"type":"string"},"text":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","text","permalink","thumbnail_url","published_at"]},"author":{"type":"object","properties":{"id":{"type":["string","null"]},"username":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["id","username","name"]},"text":{"type":"string"},"is_hidden":{"type":"boolean"},"is_liked":{"type":"boolean"},"like_count":{"type":["number","null"]},"reply_status":{"type":"string","enum":["unreplied","replied","ignored"]},"kind":{"type":"string","enum":["comment","mention"]},"commented_at":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"is_own":{"type":"boolean"},"author":{"type":["string","null"]},"commented_at":{"type":"string"}},"required":["id","text","is_own","author","commented_at"]}}},"required":["id","account","post","author","text","is_hidden","is_liked","like_count","reply_status","kind","commented_at","replies"]}},"next_cursor":{"type":["string","null"]}},"required":["data","next_cursor"]}}}}}}},"/api/v1/comments/counts":{"get":{"tags":["Comments"],"summary":"Unreplied comments, in all and per account","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"by_account":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"count":{"type":"number"}},"required":["account_id","count"]}}},"required":["total","by_account"]}}}}}}},"/api/v1/comments/sync":{"get":{"tags":["Comments"],"summary":"When comments were last refreshed by hand and when the next refresh is allowed","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"last_sync_at":{"type":["string","null"]},"next_allowed_at":{"type":"string"}},"required":["last_sync_at","next_allowed_at"]}}}}}},"post":{"tags":["Comments"],"summary":"Read the latest comments from the platforms (once a minute)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"number"}},"required":["queued"]}}}}}}},"/api/v1/comments/{id}":{"get":{"tags":["Comments"],"summary":"One comment with the replies under it","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]},"display_name":{"type":["string","null"]}},"required":["id","platform","username","display_name"]},"post":{"type":"object","properties":{"platform_post_id":{"type":"string"},"text":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","text","permalink","thumbnail_url","published_at"]},"author":{"type":"object","properties":{"id":{"type":["string","null"]},"username":{"type":["string","null"]},"name":{"type":["string","null"]}},"required":["id","username","name"]},"text":{"type":"string"},"is_hidden":{"type":"boolean"},"is_liked":{"type":"boolean"},"like_count":{"type":["number","null"]},"reply_status":{"type":"string","enum":["unreplied","replied","ignored"]},"kind":{"type":"string","enum":["comment","mention"]},"commented_at":{"type":"string"},"replies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"is_own":{"type":"boolean"},"author":{"type":["string","null"]},"commented_at":{"type":"string"}},"required":["id","text","is_own","author","commented_at"]}}},"required":["id","account","post","author","text","is_hidden","is_liked","like_count","reply_status","kind","commented_at","replies"]}},"required":["comment"]}}}}}},"delete":{"tags":["Comments"],"summary":"Delete a comment on the platform: any comment on the account's posts on Instagram, Facebook and Telegram (under 48 hours); only the account's own on Threads, YouTube and TikTok (hide others'). See platform-rules capabilities.deleteComment.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}},"patch":{"tags":["Comments"],"summary":"Mark a comment replied, ignored or unreplied (GrowSocmed only)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reply_status":{"type":"string","enum":["unreplied","replied","ignored"]}},"required":["reply_status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/comments/{id}/like":{"post":{"tags":["Comments"],"summary":"Like a comment as the account, or take the like back (Facebook Pages, TikTok with TikTok Business)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"liked":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/comments/resolve":{"post":{"tags":["Comments"],"summary":"Mark several comments done without replying (or back to needing a reply)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":200},"reply_status":{"type":"string","enum":["ignored","replied","unreplied"],"default":"ignored"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}}}}},"/api/v1/comments/{id}/reply":{"post":{"tags":["Comments"],"summary":"Reply publicly as the account","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":2200}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/comments/{id}/hide":{"post":{"tags":["Comments"],"summary":"Hide or show a comment on the platform (Telegram: deletes it, under 48 hours old)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"hidden":{"type":"boolean"}},"required":["hidden"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/inbox/conversations":{"get":{"tags":["Inbox"],"summary":"DM conversations, latest message first","parameters":[{"schema":{"type":"string","enum":["open","needs_you","done","all"],"default":"open"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]}},"required":["id","platform","username"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":["string","null"]},"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}},"required":["id","username","name","avatar_url"]},"status":{"type":"string","enum":["open","done"]},"unread_count":{"type":"number"},"last_message_at":{"type":["string","null"]},"last_message_preview":{"type":["string","null"]},"last_message_direction":{"type":["string","null"]},"window_expires_at":{"type":["string","null"]},"handed_off_at":{"type":["string","null"]}},"required":["id","account","contact","status","unread_count","last_message_at","last_message_preview","last_message_direction","window_expires_at","handed_off_at"]}}},"required":["data"]}}}}}}},"/api/v1/inbox/conversations/{id}/messages":{"get":{"tags":["Inbox"],"summary":"Messages of a conversation, oldest first (marks it read)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"type":"string"},"source":{"type":"string"},"text":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":["string","null"]}},"required":["type","url"]}},"status":{"type":"string"},"error_code":{"type":["string","null"]},"sent_at":{"type":"string"},"reaction":{"type":["string","null"]}},"required":["id","direction","source","text","attachments","status","error_code","sent_at","reaction"]}}},"required":["data"]}}}}}},"post":{"tags":["Inbox"],"summary":"Send a DM: text (Instagram, Facebook Page, X, Telegram, TikTok) and/or, on Instagram, one photo (≤ 8 MB) or video (≤ 25 MB) from the media library. Instagram: within 24 hours of the person's last message; Facebook: 24 hours, then up to 7 days as a human agent; X bills each DM. A refused message is kept as failed (retry it).","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":1000},"media_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"message_id":{"type":["string","null"]}},"required":["ok","message_id"]}}}}}}},"/api/v1/inbox/messages/{id}/retry":{"post":{"tags":["Inbox"],"summary":"Send a failed DM again","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/inbox/messages/{id}/react":{"post":{"tags":["Inbox"],"summary":"Put a heart on the person's message (Instagram's only reaction), or take it back","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reaction":{"type":["string","null"],"enum":["love"]}},"required":["reaction"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/inbox/messages/{id}/attachments/{index}":{"get":{"tags":["Inbox"],"summary":"Download a file the person sent (while Instagram still serves it)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0},"required":false,"name":"index","in":"path"}],"responses":{"200":{"description":"The file"}}}},"/api/v1/inbox/conversations/{id}/typing":{"post":{"tags":["Inbox"],"summary":"Show \"typing…\" to the person (or stop); Instagram shows it while they have the app open","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"typing":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/inbox/conversations/{id}":{"get":{"tags":["Inbox"],"summary":"One DM conversation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"conversation":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]}},"required":["id","platform","username"]},"contact":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":["string","null"]},"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]}},"required":["id","username","name","avatar_url"]},"status":{"type":"string","enum":["open","done"]},"unread_count":{"type":"number"},"last_message_at":{"type":["string","null"]},"last_message_preview":{"type":["string","null"]},"last_message_direction":{"type":["string","null"]},"window_expires_at":{"type":["string","null"]},"handed_off_at":{"type":["string","null"]}},"required":["id","account","contact","status","unread_count","last_message_at","last_message_preview","last_message_direction","window_expires_at","handed_off_at"]}},"required":["conversation"]}}}}}},"patch":{"tags":["Inbox"],"summary":"Mark a conversation done or open (GrowSocmed only)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","done"]},"needs_you":{"type":"boolean","enum":[false]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/inbox/conversations/resolve":{"post":{"tags":["Inbox"],"summary":"Mark several conversations done (or open again)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":200},"status":{"type":"string","enum":["done","open"],"default":"done"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]}}}}}}},"/api/v1/accounts/{id}/contacts/{platform_id}":{"get":{"tags":["Inbox"],"summary":"A person's Instagram profile and whether they follow the account (only people who messaged the account)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100},"required":true,"name":"platform_id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":["string","null"]},"name":{"type":["string","null"]},"avatar_url":{"type":["string","null"]},"follower_count":{"type":["number","null"]},"is_verified":{"type":["boolean","null"]},"follows_account":{"type":["boolean","null"]},"followed_by_account":{"type":["boolean","null"]}},"required":["id","username","name","avatar_url","follower_count","is_verified","follows_account","followed_by_account"]}}}}}}},"/api/v1/inbox/summary":{"get":{"tags":["Inbox"],"summary":"Open conversations count","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"open_count":{"type":"number"}},"required":["open_count"]}}}}}}},"/api/v1/inbox/sync":{"post":{"tags":["Inbox"],"summary":"Read the latest DMs (once a minute)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"number"}},"required":["queued"]}}}}}}},"/api/v1/saved-replies":{"get":{"tags":["Inbox"],"summary":"Saved replies","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"}},"required":["id","name","text"]}}},"required":["data"]}}}}}},"post":{"tags":["Inbox"],"summary":"Create a saved reply","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["name","text"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"}},"required":["id","name","text"]}}}}}}},"/api/v1/saved-replies/{id}":{"put":{"tags":["Inbox"],"summary":"Change a saved reply","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["name","text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"}},"required":["id","name","text"]}}}}}},"delete":{"tags":["Inbox"],"summary":"Delete a saved reply","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/comments/{id}/draft":{"post":{"tags":["Comments"],"summary":"Let an agent draft a reply to a comment (nothing is sent)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"}},"required":["agent_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"reply":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["status","reply","reason"]}}}}}}},"/api/v1/inbox/conversations/{id}/draft":{"post":{"tags":["Inbox"],"summary":"Let an agent draft a reply in a DM conversation (nothing is sent)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid"}},"required":["agent_id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"reply":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["status","reply","reason"]}}}}}}},"/api/v1/automations":{"get":{"tags":["Automations"],"summary":"Automations with what they have done","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string"},"account_username":{"type":["string","null"]},"name":{"type":"string"},"kind":{"type":"string"},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string"},"once_per_person":{"type":"boolean"},"enabled":{"type":"boolean"},"enabled_at":{"type":["string","null"]},"paused_until":{"type":["string","null"]},"stats":{"type":"object","properties":{"sent":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"},"queued":{"type":"number"},"clicks":{"type":"number"},"follows":{"type":"number"},"ctr":{"type":["number","null"]}},"required":["sent","skipped","failed","queued","clicks","follows","ctr"]},"posts":{"type":"array","items":{"type":"object","properties":{"platform_post_id":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","caption","permalink","thumbnail_url","published_at"]}}},"required":["id","account_id","platform","account_username","name","kind","trigger","actions","delay","once_per_person","enabled","enabled_at","paused_until","stats","posts"]}}},"required":["data"]}}}}}},"post":{"tags":["Automations"],"summary":"Create an automation (answers only what arrives after it is switched on)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["comment_to_dm","comment_reply","dm_keyword","default_reply","comment_hide","comment_like","story_reply","story_mention","ice_breaker"]},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string","enum":["fast","natural","relaxed"],"default":"natural"},"once_per_person":{"type":"boolean","default":true},"enabled":{"type":"boolean","default":false}},"required":["account_id","name","kind","trigger","actions"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string"},"account_username":{"type":["string","null"]},"name":{"type":"string"},"kind":{"type":"string"},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string"},"once_per_person":{"type":"boolean"},"enabled":{"type":"boolean"},"enabled_at":{"type":["string","null"]},"paused_until":{"type":["string","null"]},"stats":{"type":"object","properties":{"sent":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"},"queued":{"type":"number"},"clicks":{"type":"number"},"follows":{"type":"number"},"ctr":{"type":["number","null"]}},"required":["sent","skipped","failed","queued","clicks","follows","ctr"]},"posts":{"type":"array","items":{"type":"object","properties":{"platform_post_id":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","caption","permalink","thumbnail_url","published_at"]}}},"required":["id","account_id","platform","account_username","name","kind","trigger","actions","delay","once_per_person","enabled","enabled_at","paused_until","stats","posts"]}},"required":["automation"]}}}}}}},"/api/v1/automations/{id}":{"get":{"tags":["Automations"],"summary":"One automation with what it has done","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string"},"account_username":{"type":["string","null"]},"name":{"type":"string"},"kind":{"type":"string"},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string"},"once_per_person":{"type":"boolean"},"enabled":{"type":"boolean"},"enabled_at":{"type":["string","null"]},"paused_until":{"type":["string","null"]},"stats":{"type":"object","properties":{"sent":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"},"queued":{"type":"number"},"clicks":{"type":"number"},"follows":{"type":"number"},"ctr":{"type":["number","null"]}},"required":["sent","skipped","failed","queued","clicks","follows","ctr"]},"posts":{"type":"array","items":{"type":"object","properties":{"platform_post_id":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","caption","permalink","thumbnail_url","published_at"]}}},"required":["id","account_id","platform","account_username","name","kind","trigger","actions","delay","once_per_person","enabled","enabled_at","paused_until","stats","posts"]}},"required":["automation"]}}}}}},"patch":{"tags":["Automations"],"summary":"Change an automation or switch it on/off","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"type":"string","enum":["comment_to_dm","comment_reply","dm_keyword","default_reply","comment_hide","comment_like","story_reply","story_mention","ice_breaker"]},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string","enum":["fast","natural","relaxed"],"default":"natural"},"once_per_person":{"type":"boolean","default":true},"enabled":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"automation":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string"},"account_username":{"type":["string","null"]},"name":{"type":"string"},"kind":{"type":"string"},"trigger":{"type":"object","properties":{"posts":{"anyOf":[{"type":"string","enum":["all","next"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all"},"match":{"type":"string","enum":["any","contains","exact"],"default":"contains"},"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":60},"maxItems":200,"default":[]},"includeReplies":{"type":"boolean","default":false},"frequency":{"type":"string","enum":["hour","day","week"]}}},"actions":{"type":"object","properties":{"dmText":{"type":"string","minLength":1,"maxLength":1000},"replyVariants":{"type":"array","items":{"type":"string","minLength":1,"maxLength":500},"maxItems":5},"agentId":{"type":["string","null"],"format":"uuid"},"buttons":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":20},"url":{"type":"string","maxLength":2000,"format":"uri"}},"required":["title","url"]},"maxItems":3},"trackClicks":{"type":"boolean"},"requireFollow":{"type":["object","null"],"properties":{"askText":{"type":"string","minLength":1,"maxLength":640},"buttonTitle":{"type":"string","minLength":1,"maxLength":20}},"required":["askText","buttonTitle"]},"heart":{"type":"boolean"},"markAutomated":{"type":"boolean"},"iceBreakers":{"type":"array","items":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":80},"reply":{"type":"string","minLength":1,"maxLength":1000}},"required":["question","reply"]},"minItems":1,"maxItems":4}}},"delay":{"type":"string"},"once_per_person":{"type":"boolean"},"enabled":{"type":"boolean"},"enabled_at":{"type":["string","null"]},"paused_until":{"type":["string","null"]},"stats":{"type":"object","properties":{"sent":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"},"queued":{"type":"number"},"clicks":{"type":"number"},"follows":{"type":"number"},"ctr":{"type":["number","null"]}},"required":["sent","skipped","failed","queued","clicks","follows","ctr"]},"posts":{"type":"array","items":{"type":"object","properties":{"platform_post_id":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":["string","null"]}},"required":["platform_post_id","caption","permalink","thumbnail_url","published_at"]}}},"required":["id","account_id","platform","account_username","name","kind","trigger","actions","delay","once_per_person","enabled","enabled_at","paused_until","stats","posts"]}},"required":["automation"]}}}}}},"delete":{"tags":["Automations"],"summary":"Delete an automation and its history","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}}},"/api/v1/automations/{id}/runs":{"get":{"tags":["Automations"],"summary":"Latest runs with their outcome and reason","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"reason":{"type":["string","null"]},"person":{"type":["string","null"]},"trigger_text":{"type":["string","null"]},"run_at":{"type":"string"},"finished_at":{"type":["string","null"]},"clicked_at":{"type":["string","null"]},"followed_at":{"type":["string","null"]}},"required":["id","status","reason","person","trigger_text","run_at","finished_at","clicked_at","followed_at"]}}},"required":["data"]}}}}}}},"/api/v1/insights/accounts/{id}":{"get":{"tags":["Insights"],"summary":"Account figures for the last 7, 30 or 90 days, the period before, and per day","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start day (YYYY-MM-DD); with `to` it replaces `days`"},"required":false,"description":"Start day (YYYY-MM-DD); with `to` it replaces `days`","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"platform":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","additionalProperties":{"type":"number"}},"previous":{"type":"object","additionalProperties":{"type":"number"}},"engagement_rate":{"type":["number","null"]},"previous_engagement_rate":{"type":["number","null"]},"highlights":{"type":"object","properties":{"posts":{"type":"number"},"previous_posts":{"type":"number"},"unreplied_comments":{"type":"number"},"top_post":{"type":["object","null"],"properties":{"id":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"interactions":{"type":"number"}},"required":["id","caption","permalink","interactions"]}},"required":["posts","previous_posts","unreplied_comments","top_post"]},"followers":{"type":"object","properties":{"current":{"type":["number","null"]},"change":{"type":["number","null"]}},"required":["current","change"]},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"number"}},"followers":{"type":["number","null"]}},"required":["day","metrics","followers"]}},"synced_at":{"type":["string","null"]}},"required":["account_id","platform","from","to","totals","previous","engagement_rate","previous_engagement_rate","highlights","followers","daily","synced_at"]}}}}}}},"/api/v1/insights/accounts/{id}/posts":{"get":{"tags":["Insights"],"summary":"Posts published in the period (in the app or outside it) with their figures and outlier score","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start day (YYYY-MM-DD); with `to` it replaces `days`"},"required":false,"description":"Start day (YYYY-MM-DD); with `to` it replaces `days`","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["published","views","interactions","outlier","engagement"],"default":"published"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform_post_id":{"type":"string"},"kind":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":"string"},"from_app":{"type":"boolean"},"post_id":{"type":["string","null"]},"metrics":{"type":"object","additionalProperties":{"type":"number"}},"views":{"type":["number","null"]},"interactions":{"type":"number"},"engagement_rate":{"type":["number","null"]},"outlier_score":{"type":["number","null"]},"fetched_at":{"type":["string","null"]}},"required":["id","platform_post_id","kind","caption","permalink","thumbnail_url","published_at","from_app","post_id","metrics","views","interactions","engagement_rate","outlier_score","fetched_at"]}}},"required":["data"]}}}}}}},"/api/v1/insights/accounts/{id}/posts.csv":{"get":{"tags":["Insights"],"summary":"The account's posts in the period with their figures, as CSV (Excel/Sheets)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start day (YYYY-MM-DD); with `to` it replaces `days`"},"required":false,"description":"Start day (YYYY-MM-DD); with `to` it replaces `days`","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"CSV"}}}},"/api/v1/insights/summary":{"get":{"tags":["Insights"],"summary":"Several accounts at once: combined totals vs the period before, per day, per account, and the biggest outliers","parameters":[{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Start day (YYYY-MM-DD); with `to` it replaces `days`"},"required":false,"description":"Start day (YYYY-MM-DD); with `to` it replaces `days`","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","description":"Comma-separated; default every account with statistics"},"required":false,"description":"Comma-separated; default every account with statistics","name":"account_ids","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"totals":{"type":"object","additionalProperties":{"type":"number"}},"previous":{"type":"object","additionalProperties":{"type":"number"}},"engagement_rate":{"type":["number","null"]},"followers":{"type":["number","null"]},"posts":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"number"}}},"required":["day","metrics"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"platform":{"type":"string"},"username":{"type":["string","null"]},"posts":{"type":"number"},"followers":{"type":["number","null"]},"totals":{"type":"object","additionalProperties":{"type":"number"}},"engagement_rate":{"type":["number","null"]}},"required":["account_id","platform","username","posts","followers","totals","engagement_rate"]}},"outliers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform_post_id":{"type":"string"},"kind":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":"string"},"from_app":{"type":"boolean"},"post_id":{"type":["string","null"]},"metrics":{"type":"object","additionalProperties":{"type":"number"}},"views":{"type":["number","null"]},"interactions":{"type":"number"},"engagement_rate":{"type":["number","null"]},"outlier_score":{"type":["number","null"]},"fetched_at":{"type":["string","null"]},"account_id":{"type":"string"},"platform":{"type":"string"}},"required":["id","platform_post_id","kind","caption","permalink","thumbnail_url","published_at","from_app","post_id","metrics","views","interactions","engagement_rate","outlier_score","fetched_at","account_id","platform"]}}},"required":["from","to","totals","previous","engagement_rate","followers","posts","daily","accounts","outliers"]}}}}}}},"/api/v1/insights/accounts/{id}/audience":{"get":{"tags":["Insights"],"summary":"Who follows the account: shares by country, city, age and gender (Instagram and Threads need 100+ followers); Instagram also reach by follower or not","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"audience":{"type":["object","null"],"additionalProperties":{}},"fetched_at":{"type":["string","null"]}},"required":["audience","fetched_at"]}}}}}}},"/api/v1/insights/accounts/{id}/stories":{"get":{"tags":["Insights"],"summary":"Instagram stories still up (24 hours) with their figures so far, read live from Instagram (figures appear after 5 viewers)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"media_type":{"type":"string"},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":"string"},"expires_at":{"type":"string"},"metrics":{"type":"object","additionalProperties":{"type":"number"}}},"required":["id","media_type","permalink","thumbnail_url","published_at","expires_at","metrics"]}}},"required":["data"]}}}}}}},"/api/v1/insights/accounts/{id}/best-times":{"get":{"tags":["Insights"],"summary":"Average interactions per weekday and 2-hour block, from the posts of the last 90 days (needs 5 posts)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","maxLength":64,"default":"Asia/Jakarta"},"required":false,"name":"tz","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"number"},"min_posts":{"type":"number"},"tz":{"type":"string"},"blocks":{"type":"array","items":{"type":"object","properties":{"weekday":{"type":"number"},"hour":{"type":"number"},"posts":{"type":"number"},"avg_interactions":{"type":"number"}},"required":["weekday","hour","posts","avg_interactions"]}}},"required":["posts","min_posts","tz","blocks"]}}}}}}},"/api/v1/insights/sync":{"post":{"tags":["Insights"],"summary":"Read the latest statistics from the platforms (once every 5 minutes); ?days=N also reads again the posts published in the last N days (up to 90)","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365},"required":false,"name":"days","in":"query"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"number"}},"required":["queued"]}}}}}}},"/api/v1/posts/{id}/insights":{"get":{"tags":["Insights"],"summary":"Lifetime figures of a GrowSocmed post on each account it went to (as last read from the platforms)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"target_id":{"type":"string"},"account_id":{"type":["string","null"]},"platform":{"type":"string"},"permalink":{"type":["string","null"]},"metrics":{"type":"object","additionalProperties":{"type":"number"}},"interactions":{"type":["number","null"]},"engagement_rate":{"type":["number","null"]},"fetched_at":{"type":["string","null"]}},"required":["target_id","account_id","platform","permalink","metrics","interactions","engagement_rate","fetched_at"]}}},"required":["data"]}}}}}}},"/api/v1/platform-posts":{"get":{"tags":["Insights"],"summary":"Posts made outside GrowSocmed (in the platforms' own apps), as read with the statistics; for the calendar (read-only)","parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"account_id","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string"},"kind":{"type":"string"},"caption":{"type":["string","null"]},"permalink":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"published_at":{"type":"string"}},"required":["id","account_id","platform","kind","caption","permalink","thumbnail_url","published_at"]}}},"required":["data"]}}}}}}},"/api/v1/api-keys":{"get":{"tags":["Developer"],"summary":"Your API keys (dashboard only)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scope":{"type":"string","enum":["read","write"]},"workspace":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"last_used_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","prefix","scope","workspace","last_used_at","created_at"]}}},"required":["data"]}}}}}},"post":{"tags":["Developer"],"summary":"Create an API key; the key is shown once","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"scope":{"type":"string","enum":["read","write"],"default":"write"},"workspace_id":{"type":["string","null"],"format":"uuid","default":null}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scope":{"type":"string","enum":["read","write"]},"workspace":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"last_used_at":{"type":["string","null"]},"created_at":{"type":"string"},"key":{"type":"string"}},"required":["id","name","prefix","scope","workspace","last_used_at","created_at","key"]}}}}}}},"/api/v1/api-keys/{id}":{"delete":{"tags":["Developer"],"summary":"Revoke an API key at once","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Revoked"}}}},"/api/v1/connected-apps":{"get":{"tags":["Developer"],"summary":"Apps you allowed to use GrowSocmed (MCP clients)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"client_id":{"type":"string"},"name":{"type":["string","null"]},"uri":{"type":["string","null"]},"icon":{"type":["string","null"]},"workspace":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"scopes":{"type":"array","items":{"type":"string"}},"granted_at":{"type":"string"}},"required":["id","client_id","name","uri","icon","workspace","scopes","granted_at"]}}},"required":["data"]}}}}}}},"/api/v1/connected-apps/{id}":{"delete":{"tags":["Developer"],"summary":"Remove an app's access: its tokens stop working","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Removed"}}}},"/api/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"Webhook endpoints of the workspace, and the events they can receive","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"consecutive_failures":{"type":"number"},"disabled_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","url","events","active","consecutive_failures","disabled_at","created_at"]}},"events":{"type":"array","items":{"type":"string"}}},"required":["data","events"]}}}}}},"post":{"tags":["Webhooks"],"summary":"Add a webhook endpoint; its signing secret is shown once","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["account.connected","account.expired","account.disconnected","post.published","post.failed","comment.created","comment.replied","comment.hidden","comment.unhidden","comment.deleted","message.received","message.sent","automation.run"]},"minItems":1}},"required":["url","events"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"consecutive_failures":{"type":"number"},"disabled_at":{"type":["string","null"]},"created_at":{"type":"string"},"secret":{"type":"string"}},"required":["id","url","events","active","consecutive_failures","disabled_at","created_at","secret"]}}}}}}},"/api/v1/webhooks/{id}":{"patch":{"tags":["Webhooks"],"summary":"Change the URL or events, or turn the endpoint on or off","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["account.connected","account.expired","account.disconnected","post.published","post.failed","comment.created","comment.replied","comment.hidden","comment.unhidden","comment.deleted","message.received","message.sent","automation.run"]},"minItems":1},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"consecutive_failures":{"type":"number"},"disabled_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","url","events","active","consecutive_failures","disabled_at","created_at"]}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint and its delivery log","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Deliveries of the last 30 days, newest first","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"before","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"status":{"type":"string","enum":["pending","success","failed"]},"attempts":{"type":"number"},"response_status":{"type":["number","null"]},"response_body":{"type":["string","null"]},"error":{"type":["string","null"]},"duration_ms":{"type":["number","null"]},"next_attempt_at":{"type":["string","null"]},"last_attempt_at":{"type":["string","null"]},"created_at":{"type":"string"},"payload":{"type":"object","additionalProperties":{}}},"required":["id","event_id","event_type","status","attempts","response_status","response_body","error","duration_ms","next_attempt_at","last_attempt_at","created_at","payload"]}},"next_before":{"type":["string","null"]}},"required":["data","next_before"]}}}}}}},"/api/v1/webhooks/{id}/deliveries/{deliveryId}/resend":{"post":{"tags":["Webhooks"],"summary":"Send one delivery again now","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"deliveryId","in":"path"}],"responses":{"202":{"description":"Queued"}}}},"/api/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a webhook.test event to this endpoint","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Queued"}}}},"/api/v1/billing":{"get":{"tags":["Billing"],"summary":"Your plan, its limits and use, your balance, and the plans on offer","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/channels":{"get":{"tags":["Billing"],"summary":"Payment channels (virtual account, retail, QRIS)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/quote":{"post":{"tags":["Billing"],"summary":"Price of an order: discounts, voucher, balance used, channel fee","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["plan","topup","addon"]},"account_packs":{"type":"integer","minimum":0,"maximum":50},"storage_packs":{"type":"integer","minimum":0,"maximum":50},"plan_code":{"type":"string"},"months":{"type":"integer"},"amount":{"type":"integer"},"voucher":{"type":"string","maxLength":40},"use_wallet":{"type":"boolean","default":true},"method":{"type":"string","maxLength":40}},"required":["kind"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/checkout":{"post":{"tags":["Billing"],"summary":"Create an invoice; the balance is used first, the rest is paid through the chosen channel","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["plan","topup","addon"]},"account_packs":{"type":"integer","minimum":0,"maximum":50},"storage_packs":{"type":"integer","minimum":0,"maximum":50},"plan_code":{"type":"string"},"months":{"type":"integer"},"amount":{"type":"integer"},"voucher":{"type":"string","maxLength":40},"use_wallet":{"type":"boolean","default":true},"method":{"type":"string","maxLength":40}},"required":["kind"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/invoices":{"get":{"tags":["Billing"],"summary":"Your invoices, newest first","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/invoices/{id}":{"get":{"tags":["Billing"],"summary":"One invoice with its payment code and steps","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/invoices/{id}/check":{"post":{"tags":["Billing"],"summary":"Check the payment status with Tripay now","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/invoices/{id}/cancel":{"post":{"tags":["Billing"],"summary":"Cancel an unpaid invoice; the balance it used comes back","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/wallet":{"get":{"tags":["Billing"],"summary":"Balance and its history","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/billing/subscription":{"patch":{"tags":["Billing"],"summary":"Turn renewing from the balance on or off","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"auto_renew":{"type":"boolean"}},"required":["auto_renew"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"auto_renew":{"type":"boolean"}},"required":["auto_renew"]}}}}}}},"/api/v1/billing/invoices/{id}/pdf":{"get":{"tags":["Billing"],"summary":"A paid invoice as PDF","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"PDF"}}}},"/api/v1/pricing":{"get":{"tags":["Pricing"],"summary":"Plans and their monthly prices in US dollars (public)","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"currency":{"type":"string","enum":["USD"]},"plans":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"price_monthly_usd":{"type":"number","description":"Monthly price in US dollars"},"limits":{"type":"object","additionalProperties":{"anyOf":[{"type":"number"},{"type":"boolean"},{"type":"null"}]},"description":"What the plan allows; null = no limit"}},"required":["code","name","price_monthly_usd","limits"]}},"addon":{"type":"object","properties":{"price_monthly_usd":{"type":"number"},"accounts":{"type":"number"},"storage_gb":{"type":"number"}},"required":["price_monthly_usd","accounts","storage_gb"],"description":"One add-on pack on a paid plan: more accounts or more storage, per month"}},"required":["currency","plans","addon"]}}}}}}},"/api/v1/members":{"get":{"tags":["Members"],"summary":"Members of the workspace with their access, and pending invitations","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/members/invitations":{"post":{"tags":["Members"],"summary":"Invite someone by email (the link is valid 7 days)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":200,"format":"email"},"role":{"type":"string","enum":["admin","member"]},"permissions":{"type":"object","properties":{"posts":{"type":"string","enum":["none","view","manage"]},"ideas":{"type":"string","enum":["none","view","manage"]},"media":{"type":"string","enum":["none","view","manage"]},"links":{"type":"string","enum":["none","view","manage"]},"comments":{"type":"string","enum":["none","view","manage"]},"inbox":{"type":"string","enum":["none","view","manage"]},"automations":{"type":"string","enum":["none","view","manage"]},"agents":{"type":"string","enum":["none","view","manage"]},"insights":{"type":"string","enum":["none","view","manage"]},"accounts":{"type":"string","enum":["none","view","manage"]},"members":{"type":"string","enum":["none","view","manage"]}},"default":{}}},"required":["email","role"]}}}},"responses":{"201":{"description":"Invited","content":{"application/json":{"schema":{}}}}}}},"/api/v1/members/invitations/{id}":{"delete":{"tags":["Members"],"summary":"Cancel a pending invitation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Canceled"}}}},"/api/v1/invitations/{id}":{"get":{"tags":["Members"],"summary":"An invitation sent to you","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/invitations/{id}/accept":{"post":{"tags":["Members"],"summary":"Join the workspace of an invitation sent to you","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string"}},"required":["workspace_id"]}}}}}}},"/api/v1/invitations/{id}/reject":{"post":{"tags":["Members"],"summary":"Decline an invitation sent to you","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Declined"}}}},"/api/v1/members/{userId}":{"patch":{"tags":["Members"],"summary":"Change a member's role or access","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]},"permissions":{"type":"object","properties":{"posts":{"type":"string","enum":["none","view","manage"]},"ideas":{"type":"string","enum":["none","view","manage"]},"media":{"type":"string","enum":["none","view","manage"]},"links":{"type":"string","enum":["none","view","manage"]},"comments":{"type":"string","enum":["none","view","manage"]},"inbox":{"type":"string","enum":["none","view","manage"]},"automations":{"type":"string","enum":["none","view","manage"]},"agents":{"type":"string","enum":["none","view","manage"]},"insights":{"type":"string","enum":["none","view","manage"]},"accounts":{"type":"string","enum":["none","view","manage"]},"members":{"type":"string","enum":["none","view","manage"]}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}}}},"delete":{"tags":["Members"],"summary":"Remove a member from the workspace","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"userId","in":"path"}],"responses":{"204":{"description":"Removed"}}}},"/api/v1/activity":{"get":{"tags":["Members"],"summary":"Changes made in the workspace (dashboard, API, MCP), newest first, 90 days","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"before","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/ideas/board":{"get":{"tags":["Ideas"],"summary":"Every column, left to right, with its ideas top to bottom (text cut at 280 characters)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ideas":{"type":"array","items":{}}},"required":["id","name","ideas"]}}},"required":["columns"]}}}}}}},"/api/v1/ideas/{id}":{"get":{"tags":["Ideas"],"summary":"One idea with its full text","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"patch":{"tags":["Ideas"],"summary":"Change an idea, or move it: next to another idea (before_id/after_id) or to the top of a column","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":70000},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20},"column_id":{"type":"string","format":"uuid"},"before_id":{"type":"string","format":"uuid"},"after_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Ideas"],"summary":"Delete an idea (posts made from it stay)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/ideas":{"post":{"tags":["Ideas"],"summary":"Write down an idea (text or media); it goes to the top of the column (default: the first)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":70000,"default":""},"media_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"column_id":{"type":"string","format":"uuid"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/idea-columns":{"post":{"tags":["Ideas"],"summary":"Add a column on the right (at most 20)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/idea-columns/{id}":{"patch":{"tags":["Ideas"],"summary":"Rename a column or move it next to another (before_id/after_id)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"before_id":{"type":"string","format":"uuid"},"after_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Ideas"],"summary":"Delete a column; its ideas move to `move_to` (needed when it has ideas). The last column stays.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"move_to","in":"query"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/links":{"get":{"tags":["Links"],"summary":"Short links of the workspace with their clicks","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["Links"],"summary":"Create a short link (own name on Pro and Agency; it cannot be changed later)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"title":{"type":"string","maxLength":120},"code":{"type":"string","maxLength":40}},"required":["url"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/links/{id}":{"patch":{"tags":["Links"],"summary":"Change the target or title, or turn the link off and on","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","maxLength":2000,"format":"uri"},"title":{"type":["string","null"],"maxLength":120},"status":{"type":"string","enum":["active","disabled"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["Links"],"summary":"Delete a link for good (its name is not reused; the quota comes back)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/links/{id}/stats":{"get":{"tags":["Links"],"summary":"Clicks, unique visitors, bots, per day, sources, countries, cities and devices for 7, 30 or 90 days","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"number","default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/links/{id}/qr":{"get":{"tags":["Links"],"summary":"QR code of the short link (PNG or SVG)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["png","svg"],"default":"png"},"required":false,"name":"format","in":"query"}],"responses":{"200":{"description":"Image"}}}},"/api/v1/ai/connection":{"get":{"tags":["AI agents"],"summary":"The workspace's AI provider key (never returned) and its models","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"put":{"tags":["AI agents"],"summary":"Save the AI provider key (checked first; stored encrypted)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["anthropic","openai","gemini","openrouter","custom"]},"base_url":{"type":["string","null"],"maxLength":300,"format":"uri"},"api_key":{"type":"string","minLength":8,"maxLength":500}},"required":["provider","api_key"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["AI agents"],"summary":"Remove the AI key (agents stop answering)","responses":{"204":{"description":"Removed"}}}},"/api/v1/ai/connection/check":{"post":{"tags":["AI agents"],"summary":"Check the saved key again (after a top up) and refresh its models","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agents":{"get":{"tags":["AI agents"],"summary":"Agents of the workspace","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["AI agents"],"summary":"Create an agent","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"instructions":{"type":"string","maxLength":8000,"default":""},"model":{"type":["string","null"],"maxLength":120},"knowledge_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"handoff":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":30,"default":[]},"upset":{"type":"boolean","default":true},"unknown":{"type":"boolean","default":true}},"default":{"keywords":[],"upset":true,"unknown":true}},"disclosure":{"type":"boolean","default":true}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agents/{id}":{"patch":{"tags":["AI agents"],"summary":"Change an agent","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"instructions":{"type":"string","maxLength":8000,"default":""},"model":{"type":["string","null"],"maxLength":120},"knowledge_ids":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"handoff":{"type":"object","properties":{"keywords":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":30,"default":[]},"upset":{"type":"boolean","default":true},"unknown":{"type":"boolean","default":true}},"default":{"keywords":[],"upset":true,"unknown":true}},"disclosure":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["AI agents"],"summary":"Delete an agent (automations using it fall back to their own message)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/agents/{id}/test":{"post":{"tags":["AI agents"],"summary":"Try the agent: it answers the last customer message, nothing is sent","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"turns":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","enum":["customer","account"]},"text":{"type":"string","minLength":1,"maxLength":2000}},"required":["from","text"]},"minItems":1,"maxItems":30},"channel":{"type":"string","enum":["dm","comment"],"default":"dm"}},"required":["turns"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/agents/{id}/runs":{"get":{"tags":["AI agents"],"summary":"The agent's latest answers (and the ones it did not give, with why)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/knowledge":{"get":{"tags":["AI agents"],"summary":"Knowledge sources of the workspace","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"post":{"tags":["AI agents"],"summary":"Add knowledge: text, a web page, or the account's posts, saved replies or comment replies (files: POST /knowledge/file)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["text","link","posts","saved_replies","comment_replies"]},"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","maxLength":200000},"url":{"type":"string","maxLength":2000,"format":"uri"},"account_id":{"type":"string","format":"uuid"}},"required":["kind","title"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/knowledge/file":{"post":{"tags":["AI agents"],"summary":"Add a file as knowledge (PDF, DOCX, TXT, Markdown or CSV, up to 20 MB; multipart field `file`)","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}}}}},"/api/v1/knowledge/{id}":{"patch":{"tags":["AI agents"],"summary":"Rename a source, or change pasted text (read again)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","maxLength":200000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}},"delete":{"tags":["AI agents"],"summary":"Delete a knowledge source","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"}}}},"/api/v1/knowledge/{id}/reread":{"post":{"tags":["AI agents"],"summary":"Read a source again (the page, file or account content changed)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/connect-settings":{"get":{"tags":["Connect links"],"summary":"Name shown on connect pages and the origins clients may be sent back to","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"brand_name":{"type":["string","null"]},"redirect_origins":{"type":"array","items":{"type":"string"}},"headless_requested":{"type":"boolean"},"headless_approved":{"type":"boolean"}},"required":["brand_name","redirect_origins","headless_requested","headless_approved"]}}}}}},"patch":{"tags":["Connect links"],"summary":"Change the shown name or the allowed redirect origins","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"brand_name":{"type":["string","null"],"maxLength":60},"redirect_origins":{"type":"array","items":{"type":"string","maxLength":200},"maxItems":20}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"brand_name":{"type":["string","null"]},"redirect_origins":{"type":"array","items":{"type":"string"}}},"required":["brand_name","redirect_origins"]}}}}}}},"/api/v1/connect-settings/headless":{"post":{"tags":["Connect links"],"summary":"Ask to use headless connect (start_urls: clients go straight to a platform's login from your app); an admin allows it","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"headless_requested":{"type":"boolean"},"headless_approved":{"type":"boolean"}},"required":["headless_requested","headless_approved"]}}}}}}},"/api/v1/connect-links":{"post":{"tags":["Connect links"],"summary":"A one-time link (30 minutes) for a client to connect their own accounts into this workspace, without a GrowSocmed login","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string","enum":["instagram","facebook","threads","tiktok","youtube","linkedin","x","pinterest","discord"]},"maxItems":9},"redirect_url":{"type":"string","maxLength":2000,"format":"uri"},"state":{"type":"string","maxLength":200}},"default":{}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"expires_at":{"type":"string"},"start_urls":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url","expires_at","start_urls"]}}}}}},"get":{"tags":["Connect links"],"summary":"Latest connect links of the workspace (the links themselves are not stored)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/affiliate":{"get":{"tags":["Affiliate"],"summary":"Your affiliate link, the people you brought, and your commissions (held, available, paid out)","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/affiliate/code":{"post":{"tags":["Affiliate"],"summary":"Make your affiliate link (paid plans), with your own code or a random one","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9]{4,20}$"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string"},"link":{"type":"string"}},"required":["code","link"]}}}}}}},"/api/v1/affiliate/payouts":{"post":{"tags":["Affiliate"],"summary":"Pay out every available commission: into your balance at once, or to a bank account (an admin transfers it; at least Rp50.000)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["wallet","bank"]},"bank":{"type":"object","properties":{"bank_name":{"type":"string","minLength":2,"maxLength":60},"account_number":{"type":"string","pattern":"^\\d{5,20}$"},"account_holder":{"type":"string","minLength":2,"maxLength":80}},"required":["bank_name","account_number","account_holder"]}},"required":["kind"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"number"},"status":{"type":"string"}},"required":["id","amount","status"]}}}}}},"get":{"tags":["Affiliate"],"summary":"Your payouts","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/affiliate-payouts":{"get":{"tags":["Admin"],"summary":"Bank payouts asked for by affiliates","parameters":[{"schema":{"type":"string","enum":["requested","paid","rejected"],"default":"requested"},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}},"/api/v1/admin/affiliate-payouts/{id}":{"patch":{"tags":["Admin"],"summary":"Mark a bank payout transferred, or reject it (its commissions are available again)","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["paid","rejected"]}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}}}}},"webhooks":{}}