{"openapi":"3.1.0","info":{"title":"RelayAPI","version":"1.0.0","description":"Unified social media API — post to 21 platforms via a single API"},"servers":[{"url":"https://api.relayapi.dev"}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"API key (rlay_live_* or rlay_test_*)"}},"schemas":{"ListInboxNotesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboxNote"}}},"required":["data"]},"InboxNote":{"type":"object","properties":{"id":{"type":"string","example":"note_abc123"},"conversation_id":{"type":"string"},"organization_id":{"type":"string"},"user_id":{"type":"string"},"author_name":{"type":"string","nullable":true},"author_email":{"type":"string","nullable":true},"text":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","organization_id","user_id","author_name","author_email","text","created_at","updated_at"]},"InboxNoteResponse":{"type":"object","properties":{"note":{"$ref":"#/components/schemas/InboxNote"}},"required":["note"]},"CreateInboxNoteBody":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":5000},"user_id":{"type":"string","description":"Acting user id (must be an org member)"}},"required":["text","user_id"]},"UpdateInboxNoteBody":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":5000},"user_id":{"type":"string","description":"Acting user id (must match the note's author)"}},"required":["text","user_id"]},"DeleteInboxNoteResponse":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"AutomationCatalog":{"type":"object","properties":{"node_kinds":{"type":"array","items":{"nullable":true}},"entrypoint_kinds":{"type":"array","items":{"nullable":true}},"binding_types":{"type":"array","items":{"nullable":true}},"action_types":{"type":"array","items":{"nullable":true}},"channel_capabilities":{"type":"object","additionalProperties":{"nullable":true}},"template_kinds":{"type":"array","items":{"type":"string"}}},"required":["node_kinds","entrypoint_kinds","binding_types","action_types","channel_capabilities","template_kinds"]}},"parameters":{}},"paths":{"/v1/posts":{"get":{"operationId":"listPosts","tags":["Posts"],"summary":"List posts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Filter by specific account ID"},"required":false,"description":"Filter by specific account ID","name":"account_id","in":"query"},{"schema":{"type":"string","enum":["draft","scheduled","publishing","published","failed"],"description":"Filter by post status"},"required":false,"description":"Filter by post status","name":"status","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of fields to include in the response (e.g. 'targets,media')"},"required":false,"description":"Comma-separated list of fields to include in the response (e.g. 'targets,media')","name":"include","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false","description":"When true, also return external posts merged by published_at (works with status=published or no status filter)"},"required":false,"description":"When true, also return external posts merged by published_at (works with status=published or no status filter)","name":"include_external","in":"query"}],"responses":{"200":{"description":"List of posts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createPost","tags":["Posts"],"summary":"Create a post","description":"Create a post. Use scheduled_at: \"now\" to publish immediately, \"draft\" to save as draft, or an ISO timestamp to schedule.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post text. Optional if target_options provide per-target content."},"targets":{"type":"array","items":{"type":"string","description":"Account ID (e.g. \"acc_abc123\"), platform name (e.g. \"twitter\"), or workspace ID (e.g. \"ws_xxx\"). Platform names resolve to all accounts on that platform. Workspace IDs resolve to all accounts in the workspace."},"minItems":1,"description":"Account IDs, platform names, or workspace IDs to publish to"},"scheduled_at":{"type":"string","description":"Publish intent. Use \"now\" to publish immediately, \"draft\" to save as draft, \"auto\" to auto-schedule to the best available slot, or an ISO 8601 timestamp to schedule (max 30 days ahead).","example":"now"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]},"description":"Media attachments"},"target_options":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations keyed by target value (account ID or platform name). Supports platform-specific features such as Twitter polls (poll.options, poll.duration_minutes), threads, reply_to, and reply_settings."},"timezone":{"type":"string","default":"UTC","description":"IANA timezone for scheduling"},"workspace_id":{"type":"string","description":"Workspace ID to scope this post to"},"recycling":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Whether recycling is active"},"gap":{"type":"integer","minimum":1,"maximum":365,"description":"Interval value"},"gap_freq":{"type":"string","enum":["day","week","month"],"description":"Interval unit"},"start_date":{"type":"string","format":"date-time","description":"When to start recycling"},"expire_count":{"type":"integer","minimum":1,"maximum":100,"description":"Stop after this many recycles"},"expire_date":{"type":"string","format":"date-time","description":"Stop after this date"},"content_variations":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":20,"description":"Alternate content texts (round-robin)"}},"required":["gap","gap_freq","start_date"],"description":"Recycling configuration for evergreen content (Pro plan only)"},"shorten_urls":{"type":"boolean","description":"Shorten URLs in post content. Only relevant when short link mode is 'ask'. Ignored when mode is 'always' or 'never'. (Pro plan only)"},"cross_post_actions":{"type":"array","items":{"type":"object","properties":{"action_type":{"type":"string","enum":["repost","comment","quote"],"description":"Type of cross-post action"},"target_account_id":{"type":"string","description":"Account to perform the action from"},"content":{"type":"string","description":"Text content for comment/quote actions (required for comment and quote)"},"delay_minutes":{"type":"integer","minimum":0,"maximum":1440,"default":0,"description":"Delay in minutes after publishing"}},"required":["action_type","target_account_id"]},"description":"Cross-post actions to execute after publishing (e.g., repost from another account, comment from another account)"},"template_id":{"type":"string","description":"Content template ID. When provided, the template content is used as the base for the post. Explicit 'content' field takes precedence."},"idea_id":{"type":"string","description":"Create post from an idea. Pre-fills content from the idea. Explicit 'content' field takes precedence."},"template_variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Variables to interpolate in the template (e.g., { \"promo_code\": \"SUMMER25\" }). Built-in variables: {{date}}, {{account_name}}."},"skip_signature":{"type":"boolean","description":"When true, the default signature is not auto-appended even if one is configured."}},"required":["targets","scheduled_at"]}}}},"responses":{"201":{"description":"Post created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Quota exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/logs":{"get":{"operationId":"listAllPostLogs","tags":["Posts"],"summary":"List all publishing logs","description":"Query publishing logs across all posts with pagination.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"Publishing logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Log entry ID (post target ID)"},"post_id":{"type":"string","description":"Post ID"},"social_account_id":{"type":"string","description":"Social account ID"},"platform":{"type":"string","description":"Platform name"},"status":{"type":"string","description":"Target status"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform post ID"},"platform_url":{"type":"string","nullable":true,"description":"Published URL"},"error":{"type":"string","nullable":true,"description":"Error message if failed"},"published_at":{"type":"string","nullable":true,"format":"date-time","description":"Published timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last updated"}},"required":["id","post_id","social_account_id","platform","status","platform_post_id","platform_url","error","published_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}":{"get":{"operationId":"getPost","tags":["Posts"],"summary":"Get a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Post details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updatePost","tags":["Posts"],"summary":"Update a post","description":"Update a draft or scheduled post.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post text"},"notes":{"type":"string","nullable":true,"description":"Internal notes for this post"},"targets":{"type":"array","items":{"type":"string","description":"Account ID (e.g. \"acc_abc123\"), platform name (e.g. \"twitter\"), or workspace ID (e.g. \"ws_xxx\"). Platform names resolve to all accounts on that platform. Workspace IDs resolve to all accounts in the workspace."},"minItems":1,"description":"Updated targets"},"scheduled_at":{"type":"string","description":"Publish intent. Use \"now\" to publish immediately, \"draft\" to save as draft, \"auto\" to auto-schedule to the best available slot, or an ISO 8601 timestamp to schedule (max 30 days ahead).","example":"now"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]},"description":"Updated media"},"target_options":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}}},"timezone":{"type":"string"},"recycling":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Whether recycling is active"},"gap":{"type":"integer","minimum":1,"maximum":365,"description":"Interval value"},"gap_freq":{"type":"string","enum":["day","week","month"],"description":"Interval unit"},"start_date":{"type":"string","format":"date-time","description":"When to start recycling"},"expire_count":{"type":"integer","minimum":1,"maximum":100,"description":"Stop after this many recycles"},"expire_date":{"type":"string","format":"date-time","description":"Stop after this date"},"content_variations":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":20,"description":"Alternate content texts (round-robin)"}},"required":["gap","gap_freq","start_date"],"description":"Recycling configuration (Pro plan only)"}}}}}},"responses":{"200":{"description":"Post updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deletePost","tags":["Posts"],"summary":"Delete a post","description":"Delete a post.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Post deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/retry":{"post":{"operationId":"retryPost","tags":["Posts"],"summary":"Retry failed targets","description":"Retry publishing for failed targets on a post.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Post retried","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/bulk":{"post":{"operationId":"bulkCreatePosts","tags":["Posts"],"summary":"Bulk create posts","description":"Create multiple posts in a single request. Each item follows the same schema as single post creation.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","description":"Post text. Optional if target_options provide per-target content."},"targets":{"type":"array","items":{"type":"string","description":"Account ID (e.g. \"acc_abc123\"), platform name (e.g. \"twitter\"), or workspace ID (e.g. \"ws_xxx\"). Platform names resolve to all accounts on that platform. Workspace IDs resolve to all accounts in the workspace."},"minItems":1,"description":"Account IDs, platform names, or workspace IDs to publish to"},"scheduled_at":{"type":"string","description":"Publish intent. Use \"now\" to publish immediately, \"draft\" to save as draft, \"auto\" to auto-schedule to the best available slot, or an ISO 8601 timestamp to schedule (max 30 days ahead).","example":"now"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]},"description":"Media attachments"},"target_options":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations keyed by target value (account ID or platform name). Supports platform-specific features such as Twitter polls (poll.options, poll.duration_minutes), threads, reply_to, and reply_settings."},"timezone":{"type":"string","default":"UTC","description":"IANA timezone for scheduling"},"workspace_id":{"type":"string","description":"Workspace ID to scope this post to"},"recycling":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Whether recycling is active"},"gap":{"type":"integer","minimum":1,"maximum":365,"description":"Interval value"},"gap_freq":{"type":"string","enum":["day","week","month"],"description":"Interval unit"},"start_date":{"type":"string","format":"date-time","description":"When to start recycling"},"expire_count":{"type":"integer","minimum":1,"maximum":100,"description":"Stop after this many recycles"},"expire_date":{"type":"string","format":"date-time","description":"Stop after this date"},"content_variations":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":20,"description":"Alternate content texts (round-robin)"}},"required":["gap","gap_freq","start_date"],"description":"Recycling configuration for evergreen content (Pro plan only)"},"shorten_urls":{"type":"boolean","description":"Shorten URLs in post content. Only relevant when short link mode is 'ask'. Ignored when mode is 'always' or 'never'. (Pro plan only)"},"cross_post_actions":{"type":"array","items":{"type":"object","properties":{"action_type":{"type":"string","enum":["repost","comment","quote"],"description":"Type of cross-post action"},"target_account_id":{"type":"string","description":"Account to perform the action from"},"content":{"type":"string","description":"Text content for comment/quote actions (required for comment and quote)"},"delay_minutes":{"type":"integer","minimum":0,"maximum":1440,"default":0,"description":"Delay in minutes after publishing"}},"required":["action_type","target_account_id"]},"description":"Cross-post actions to execute after publishing (e.g., repost from another account, comment from another account)"},"template_id":{"type":"string","description":"Content template ID. When provided, the template content is used as the base for the post. Explicit 'content' field takes precedence."},"idea_id":{"type":"string","description":"Create post from an idea. Pre-fills content from the idea. Explicit 'content' field takes precedence."},"template_variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Variables to interpolate in the template (e.g., { \"promo_code\": \"SUMMER25\" }). Built-in variables: {{date}}, {{account_name}}."},"skip_signature":{"type":"boolean","description":"When true, the default signature is not auto-appended even if one is configured."}},"required":["targets","scheduled_at"]},"minItems":1,"maxItems":50,"description":"Array of posts to create (max 50)"}},"required":["posts"]}}}},"responses":{"201":{"description":"Posts created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}},"summary":{"type":"object","properties":{"total":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"}},"required":["total","succeeded","failed"]}},"required":["data","summary"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/unpublish":{"post":{"operationId":"unpublishPost","tags":["Posts"],"summary":"Unpublish a published post","description":"Attempt to delete the post from each platform and set the post status to cancelled.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"array","items":{"type":"string"},"description":"Platforms to unpublish from. If omitted, unpublishes from all."}}}}}},"responses":{"200":{"description":"Post unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/logs":{"get":{"operationId":"getPostLogs","tags":["Posts"],"summary":"Get publishing logs for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Publishing logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Log entry ID (post target ID)"},"post_id":{"type":"string","description":"Post ID"},"social_account_id":{"type":"string","description":"Social account ID"},"platform":{"type":"string","description":"Platform name"},"status":{"type":"string","description":"Target status"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform post ID"},"platform_url":{"type":"string","nullable":true,"description":"Published URL"},"error":{"type":"string","nullable":true,"description":"Error message if failed"},"published_at":{"type":"string","nullable":true,"format":"date-time","description":"Published timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last updated"}},"required":["id","post_id","social_account_id","platform","status","platform_post_id","platform_url","error","published_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/update-metadata":{"post":{"operationId":"updatePostMetadata","tags":["Posts"],"summary":"Update metadata on a published video","description":"Update title, description, tags, visibility, or other metadata on an already-published YouTube video without re-uploading. Use '_' as the post ID with video_id + account_id for videos not published through RelayAPI.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["youtube"],"description":"Platform to update metadata on (YouTube only for now)"},"account_id":{"type":"string","description":"Account ID (required when post ID is '_' for direct video ID mode)"},"video_id":{"type":"string","description":"YouTube video ID (required when post ID is '_' for direct mode)"},"title":{"type":"string","maxLength":100,"description":"Video title (max 100 chars)"},"description":{"type":"string","maxLength":5000,"description":"Video description"},"tags":{"type":"array","items":{"type":"string","maxLength":100},"description":"Video tags"},"visibility":{"type":"string","enum":["public","private","unlisted"],"description":"Video visibility"},"category_id":{"type":"string","description":"YouTube category ID"},"made_for_kids":{"type":"boolean","description":"COPPA compliance flag"},"playlist_id":{"type":"string","description":"YouTube playlist ID to add the video to"}},"required":["platform"]}}}},"responses":{"200":{"description":"Metadata updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"platform":{"type":"string"},"video_id":{"type":"string"},"updated_fields":{"type":"array","items":{"type":"string"},"description":"Fields that were updated"}},"required":["success","platform","video_id","updated_fields"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Post or video not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/bulk-csv":{"post":{"operationId":"bulkCsvUpload","tags":["Posts"],"summary":"Bulk create posts from CSV","description":"Upload a CSV file to create multiple posts. Use dry_run=true to validate without creating. CSV columns: content, targets (semicolon-separated), scheduled_at, media_urls (semicolon-separated), timezone, target_options (JSON string). Max 500 rows, max 1 MB file size.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Set to \"true\" to validate without creating posts"},"required":false,"description":"Set to \"true\" to validate without creating posts","name":"dry_run","in":"query"}],"responses":{"200":{"description":"CSV processed (dry_run)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","description":"1-based row number"},"status":{"type":"string","enum":["success","error","skipped"]},"post_id":{"type":"string","description":"Created post ID (only on success)"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["row","status"]}},"summary":{"type":"object","properties":{"total_rows":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number","description":"Rows skipped in dry_run mode"},"posts_created":{"type":"number"}},"required":["total_rows","succeeded","failed","skipped","posts_created"]}},"required":["data","summary"]}}}},"201":{"description":"Posts created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","description":"1-based row number"},"status":{"type":"string","enum":["success","error","skipped"]},"post_id":{"type":"string","description":"Created post ID (only on success)"},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["row","status"]}},"summary":{"type":"object","properties":{"total_rows":{"type":"number"},"succeeded":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number","description":"Rows skipped in dry_run mode"},"posts_created":{"type":"number"}},"required":["total_rows","succeeded","failed","skipped","posts_created"]}},"required":["data","summary"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/recycling":{"get":{"operationId":"getRecyclingConfig","tags":["Posts"],"summary":"Get recycling configuration","description":"Get the recycling configuration for a post.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Recycling configuration","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"putRecyclingConfig","tags":["Posts"],"summary":"Set recycling configuration","description":"Create or replace the recycling configuration for a post. Pro plan only.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Whether recycling is active"},"gap":{"type":"integer","minimum":1,"maximum":365,"description":"Interval value"},"gap_freq":{"type":"string","enum":["day","week","month"],"description":"Interval unit"},"start_date":{"type":"string","format":"date-time","description":"When to start recycling"},"expire_count":{"type":"integer","minimum":1,"maximum":100,"description":"Stop after this many recycles"},"expire_date":{"type":"string","format":"date-time","description":"Stop after this date"},"content_variations":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":20,"description":"Alternate content texts (round-robin)"}},"required":["gap","gap_freq","start_date"]}}}},"responses":{"200":{"description":"Recycling configuration set","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"]},"warnings":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Pro plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteRecyclingConfig","tags":["Posts"],"summary":"Remove recycling configuration","description":"Stop recycling and remove the configuration.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Recycling configuration removed"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/recycled-copies":{"get":{"operationId":"listRecycledCopies","tags":["Posts"],"summary":"List recycled copies of a post","description":"List all posts that were created by recycling this post.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"List of recycled copies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"content":{"type":"string","nullable":true},"scheduled_at":{"type":"string","nullable":true},"published_at":{"type":"string","nullable":true,"description":"When the post was published"},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed"]},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true,"description":"Account display name"},"avatar_url":{"type":"string","nullable":true,"description":"Account avatar URL"},"url":{"type":"string","nullable":true,"description":"Published post URL on the platform"},"platform_post_id":{"type":"string","nullable":true,"description":"Platform-native post ID"}},"required":["id","username","display_name","avatar_url","url","platform_post_id"]}},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["status","platform"]},"description":"Per-target results"},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]}},"target_options":{"type":"object","nullable":true,"additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations"},"timezone":{"type":"string","nullable":true,"description":"IANA timezone"},"metrics":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"},"engagement_rate":{"type":"number"}},"description":"Engagement metrics (reactions, comments, views, etc.)"},"recycling":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"gap":{"type":"number"},"gap_freq":{"type":"string","enum":["day","week","month"]},"start_date":{"type":"string","format":"date-time"},"expire_count":{"type":"number","nullable":true},"expire_date":{"type":"string","nullable":true,"format":"date-time"},"content_variations":{"type":"array","items":{"type":"string"}},"recycle_count":{"type":"number"},"content_variation_index":{"type":"number"},"next_recycle_at":{"type":"string","nullable":true,"format":"date-time"},"last_recycled_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","enabled","gap","gap_freq","start_date","expire_count","expire_date","content_variations","recycle_count","content_variation_index","next_recycle_at","last_recycled_at","created_at","updated_at"],"description":"Recycling configuration, if any"},"recycled_from_id":{"type":"string","nullable":true,"description":"Source post ID if this is a recycled copy"},"thread_group_id":{"type":"string","nullable":true,"description":"Thread group ID (non-null if part of a thread)"},"thread_position":{"type":"number","nullable":true,"description":"Position within thread (0 = root)"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","content","scheduled_at","published_at","targets","media","recycling","recycled_from_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{id}/notes":{"get":{"operationId":"getPostNotes","tags":["Posts"],"summary":"Get notes for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Notes for the post","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","nullable":true}},"required":["notes"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updatePostNotes","tags":["Posts"],"summary":"Update notes for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string"}},"required":["notes"]}}}},"responses":{"200":{"description":"Updated notes","content":{"application/json":{"schema":{"type":"object","properties":{"notes":{"type":"string","nullable":true}},"required":["notes"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/health":{"get":{"operationId":"accountHealth","tags":["Accounts"],"summary":"Check health of a single connected account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Account health status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"healthy":{"type":"boolean"},"token_expires_at":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"sync":{"type":"object","nullable":true,"properties":{"enabled":{"type":"boolean"},"last_sync_at":{"type":"string","nullable":true},"next_sync_at":{"type":"string","nullable":true},"total_posts_synced":{"type":"number"},"total_sync_runs":{"type":"number"},"last_error":{"type":"string","nullable":true},"last_error_at":{"type":"string","nullable":true},"consecutive_errors":{"type":"number"},"rate_limit_reset_at":{"type":"string","nullable":true}},"required":["enabled","last_sync_at","next_sync_at","total_posts_synced","total_sync_runs","last_error","last_error_at","consecutive_errors","rate_limit_reset_at"]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["id","platform","username","display_name","avatar_url","healthy","token_expires_at","scopes"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/health":{"get":{"operationId":"accountsHealth","tags":["Accounts"],"summary":"Check health of all connected accounts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Account health status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"healthy":{"type":"boolean"},"token_expires_at":{"type":"string","nullable":true,"format":"date-time"},"scopes":{"type":"array","items":{"type":"string"}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"sync":{"type":"object","nullable":true,"properties":{"enabled":{"type":"boolean"},"last_sync_at":{"type":"string","nullable":true,"format":"date-time"},"next_sync_at":{"type":"string","nullable":true,"format":"date-time"},"total_posts_synced":{"type":"number"},"total_sync_runs":{"type":"number"},"last_error":{"type":"string","nullable":true},"last_error_at":{"type":"string","nullable":true,"format":"date-time"},"consecutive_errors":{"type":"number"},"rate_limit_reset_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["enabled","last_sync_at","next_sync_at","total_posts_synced","total_sync_runs","last_error","last_error_at","consecutive_errors","rate_limit_reset_at"]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["id","platform","username","display_name","avatar_url","healthy","token_expires_at","scopes","workspace"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts":{"get":{"operationId":"listAccounts","tags":["Accounts"],"summary":"List connected accounts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"boolean","nullable":true,"description":"Only show ungrouped accounts"},"required":false,"description":"Only show ungrouped accounts","name":"ungrouped","in":"query"},{"schema":{"type":"string","description":"Search by name or username"},"required":false,"description":"Search by name or username","name":"search","in":"query"},{"schema":{"type":"string","description":"Comma-separated platform filter (e.g. instagram,facebook)"},"required":false,"description":"Comma-separated platform filter (e.g. instagram,facebook)","name":"platforms","in":"query"}],"responses":{"200":{"description":"List of accounts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}":{"get":{"operationId":"getAccount","tags":["Accounts"],"summary":"Get a connected account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Account details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"disconnectAccount","tags":["Accounts"],"summary":"Disconnect a social account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Account disconnected"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAccount","tags":["Accounts"],"summary":"Update account metadata","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"nullable":true}},"display_name":{"type":"string"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID (null to unassign)"}}}}}},"responses":{"200":{"description":"Account updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/facebook-pages":{"get":{"operationId":"getFacebookPages","tags":["Accounts"],"summary":"Fetch Facebook pages for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Facebook pages","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"access_token":{"type":"string"}},"required":["id","name"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setFacebookPage","tags":["Accounts"],"summary":"Set default Facebook page","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string","description":"Facebook page ID to set as default"}},"required":["page_id"]}}}},"responses":{"200":{"description":"Default page set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/linkedin-organizations":{"get":{"operationId":"getLinkedInOrganizations","tags":["Accounts"],"summary":"Fetch LinkedIn organizations for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"LinkedIn organizations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"vanity_name":{"type":"string","nullable":true}},"required":["id","name","vanity_name"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setLinkedInOrganization","tags":["Accounts"],"summary":"Switch LinkedIn account type","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","description":"LinkedIn organization ID"},"account_type":{"type":"string","enum":["personal","organization"],"description":"Account type to switch to"}},"required":["organization_id","account_type"]}}}},"responses":{"200":{"description":"Account type updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/pinterest-boards":{"get":{"operationId":"getPinterestBoards","tags":["Accounts"],"summary":"Fetch Pinterest boards for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Pinterest boards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","nullable":true}},"required":["id","name","url"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setPinterestBoard","tags":["Accounts"],"summary":"Set default Pinterest board","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"board_id":{"type":"string","description":"Pinterest board ID to set as default"}},"required":["board_id"]}}}},"responses":{"200":{"description":"Default board set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/reddit-subreddits":{"get":{"operationId":"getRedditSubreddits","tags":["Accounts"],"summary":"Fetch Reddit subreddits for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Reddit subreddits","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"display_name":{"type":"string"},"subscribers":{"type":"number","nullable":true}},"required":["name","display_name","subscribers"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setRedditSubreddit","tags":["Accounts"],"summary":"Set default Reddit subreddit","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"subreddit":{"type":"string","description":"Subreddit name to set as default"}},"required":["subreddit"]}}}},"responses":{"200":{"description":"Default subreddit set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/reddit-flairs":{"get":{"operationId":"getRedditFlairs","tags":["Accounts"],"summary":"Fetch Reddit flairs for a subreddit","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Subreddit name"},"required":true,"description":"Subreddit name","name":"subreddit","in":"query"}],"responses":{"200":{"description":"Reddit flairs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-locations":{"get":{"operationId":"getGmbLocations","tags":["Accounts"],"summary":"Fetch Google My Business locations","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"GMB locations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address":{"type":"string","nullable":true}},"required":["id","name","address"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setGmbLocation","tags":["Accounts"],"summary":"Set default GMB location","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"location_id":{"type":"string","description":"Google My Business location ID to set as default"}},"required":["location_id"]}}}},"responses":{"200":{"description":"Default location set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/youtube-playlists":{"get":{"operationId":"getYoutubePlaylists","tags":["Accounts"],"summary":"Fetch YouTube playlists for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"YouTube playlists","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"privacy":{"type":"string","enum":["public","private","unlisted"]},"item_count":{"type":"number"},"thumbnail_url":{"type":"string","nullable":true}},"required":["id","title","description","privacy","item_count","thumbnail_url"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"setYoutubePlaylist","tags":["Accounts"],"summary":"Set default YouTube playlist","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"playlist_id":{"type":"string","description":"YouTube playlist ID to set as default"},"playlist_name":{"type":"string","description":"Playlist name for display purposes"}},"required":["playlist_id"]}}}},"responses":{"200":{"description":"Default playlist set","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/tiktok-creator-info":{"get":{"operationId":"getTikTokCreatorInfo","tags":["Accounts"],"summary":"Fetch TikTok creator info (available privacy levels, posting limits)","description":"Returns TikTok creator details, available privacy levels, and default interaction settings. Use this before creating TikTok posts to ensure the privacy_level is valid for the account.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"TikTok creator info","content":{"application/json":{"schema":{"type":"object","properties":{"creator_avatar_url":{"type":"string","description":"Creator avatar URL"},"creator_username":{"type":"string","description":"Creator username"},"creator_nickname":{"type":"string","description":"Creator display name"},"privacy_level_options":{"type":"array","items":{"type":"string"},"description":"Available privacy levels for this account"},"comment_disabled":{"type":"boolean","description":"Whether comments are disabled by default"},"duet_disabled":{"type":"boolean","description":"Whether duets are disabled by default"},"stitch_disabled":{"type":"boolean","description":"Whether stitches are disabled by default"},"max_video_post_duration_sec":{"type":"number","description":"Maximum video duration in seconds"}},"required":["creator_avatar_url","creator_username","creator_nickname","privacy_level_options","comment_disabled","duet_disabled","stitch_disabled","max_video_post_duration_sec"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/sync":{"post":{"operationId":"syncAccount","tags":["Accounts"],"summary":"Trigger post sync for a single account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"404":{"description":"Account not found or not syncable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/sync":{"post":{"operationId":"forceSync","tags":["Accounts"],"summary":"Force sync all connected accounts to pull in external posts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Optional workspace filter"},"required":false,"description":"Optional workspace filter","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"enqueued_count":{"type":"number"}},"required":["enqueued_count"]}}}}}}},"/v1/accounts/{id}/lists":{"get":{"operationId":"getNewsletterLists","tags":["Accounts"],"summary":"Get newsletter lists/audiences for a newsletter account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Lists","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subscriber_count":{"type":"number","nullable":true}},"required":["id","name","subscriber_count"]}}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/templates":{"get":{"operationId":"getNewsletterTemplates","tags":["Accounts"],"summary":"Get newsletter templates for a newsletter account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"preview_url":{"type":"string","nullable":true}},"required":["id","name","preview_url"]}}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-food-menus":{"get":{"operationId":"getGmbFoodMenus","tags":["Google Business"],"summary":"Get food menus","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Food menus","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business food menu data"}}}}}},"400":{"description":"Google account name unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateGmbFoodMenus","tags":["Google Business"],"summary":"Update food menus","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sections":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Section name (e.g. \"Appetizers\")"},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Menu item name"},"price":{"type":"object","properties":{"units":{"type":"string","description":"Price amount (e.g. \"12\")"},"currency":{"type":"string","description":"ISO 4217 currency code (e.g. \"USD\")"}},"required":["units","currency"],"description":"Item price"},"description":{"type":"string","description":"Item description"},"dietary":{"type":"array","items":{"type":"string"},"description":"Dietary info (e.g. VEGETARIAN, VEGAN)"},"allergens":{"type":"array","items":{"type":"string"},"description":"Allergen info"}},"required":["name"]},"description":"Menu items in this section"}},"required":["name","items"]},"description":"Menu sections"},"update_mask":{"type":"string","description":"Comma-separated fields to update"}},"required":["sections"]}}}},"responses":{"200":{"description":"Updated food menus","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business food menu data"}}}}}},"400":{"description":"Google account name unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-location-details":{"get":{"operationId":"getGmbLocationDetails","tags":["Google Business"],"summary":"Get location details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Comma-separated fields to read (e.g. \"regularHours,profile.description\")"},"required":false,"description":"Comma-separated fields to read (e.g. \"regularHours,profile.description\")","name":"read_mask","in":"query"}],"responses":{"200":{"description":"Location details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business location details"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateGmbLocationDetails","tags":["Google Business"],"summary":"Update location details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"update_mask":{"type":"string","description":"Comma-separated fields to update"},"regularHours":{"nullable":true,"description":"Regular business hours"},"specialHours":{"nullable":true,"description":"Special hours (holidays, etc.)"},"profile":{"type":"object","properties":{"description":{"type":"string","description":"Business description"}},"description":"Business profile"},"websiteUri":{"type":"string","format":"uri","description":"Business website URL"},"phoneNumbers":{"type":"object","properties":{"primaryPhone":{"type":"string","description":"Primary phone number"},"additionalPhones":{"type":"array","items":{"type":"string"},"description":"Additional phone numbers"}},"description":"Phone numbers"},"categories":{"nullable":true,"description":"Business categories"},"serviceItems":{"nullable":true,"description":"Service items"}},"required":["update_mask"]}}}},"responses":{"200":{"description":"Updated location details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business location details"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-media":{"get":{"operationId":"getGmbMedia","tags":["Google Business"],"summary":"List media/photos","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Media list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business media data"}}}}}},"400":{"description":"Google account name unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"uploadGmbMedia","tags":["Google Business"],"summary":"Upload media/photo","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_url":{"type":"string","format":"uri","description":"Public URL of the image for Google to download"},"category":{"type":"string","enum":["COVER","PROFILE","LOGO","EXTERIOR","INTERIOR","FOOD_AND_DRINK","MENU","PRODUCT","AT_WORK","COMMON_AREA","ROOMS","TEAMS","ADDITIONAL"],"description":"Google Business media category"},"description":{"type":"string","description":"Photo description"}},"required":["source_url","category"]}}}},"responses":{"200":{"description":"Uploaded media","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business media data"}}}}}},"400":{"description":"Google account name unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteGmbMedia","tags":["Google Business"],"summary":"Delete a media item","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Google media item ID to delete"},"required":true,"description":"Google media item ID to delete","name":"media_id","in":"query"}],"responses":{"200":{"description":"Media deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business media data"}}}}}},"400":{"description":"Google account name unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-attributes":{"get":{"operationId":"getGmbAttributes","tags":["Google Business"],"summary":"Get business attributes","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Attributes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business attributes data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateGmbAttributes","tags":["Google Business"],"summary":"Update business attributes","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"attribute_mask":{"type":"string","description":"Comma-separated attribute names to update"},"attributes":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Attribute name"},"values":{"type":"array","items":{"nullable":true},"description":"Attribute values"}},"required":["name","values"]},"description":"Attributes to set"}},"required":["attribute_mask","attributes"]}}}},"responses":{"200":{"description":"Updated attributes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business attributes data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/accounts/{id}/gmb-place-actions":{"get":{"operationId":"getGmbPlaceActions","tags":["Google Business"],"summary":"List place action links","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Place action links","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business place action links data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createGmbPlaceAction","tags":["Google Business"],"summary":"Create a place action link","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["APPOINTMENT","ONLINE_APPOINTMENT","DINING_RESERVATION","FOOD_ORDERING","FOOD_DELIVERY","FOOD_TAKEOUT","SHOP_ONLINE"],"description":"Google Business place action type"},"url":{"type":"string","format":"uri","description":"Action link URL"},"name":{"type":"string","description":"Display name for the action"}},"required":["type","url"]}}}},"responses":{"200":{"description":"Created place action","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business place action links data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteGmbPlaceAction","tags":["Google Business"],"summary":"Delete a place action link","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Place action link ID to delete"},"required":true,"description":"Place action link ID to delete","name":"action_id","in":"query"}],"responses":{"200":{"description":"Place action deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true,"description":"Google Business place action links data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/media":{"get":{"operationId":"listMedia","tags":["Media"],"summary":"List media files","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Filter by specific account ID"},"required":false,"description":"Filter by specific account ID","name":"account_id","in":"query"},{"schema":{"type":"string","enum":["draft","scheduled","publishing","published","failed"],"description":"Filter by post status"},"required":false,"description":"Filter by post status","name":"status","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of fields to include in the response (e.g. 'targets,media')"},"required":false,"description":"Comma-separated list of fields to include in the response (e.g. 'targets,media')","name":"include","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"false","description":"When true, also return external posts merged by published_at (works with status=published or no status filter)"},"required":false,"description":"When true, also return external posts merged by published_at (works with status=published or no status filter)","name":"include_external","in":"query"}],"responses":{"200":{"description":"List of media files","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","nullable":true,"format":"uri","description":"Public URL"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type"},"size":{"type":"integer","description":"File size in bytes"},"width":{"type":"integer","nullable":true,"description":"Width in pixels"},"height":{"type":"integer","nullable":true,"description":"Height in pixels"},"duration":{"type":"integer","nullable":true,"description":"Duration in seconds (video/audio)"},"created_at":{"type":"string","format":"date-time","description":"Upload timestamp"}},"required":["id","url","filename","mime_type","size","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/media/upload":{"post":{"operationId":"uploadMedia","tags":["Media"],"summary":"Upload a file","description":"Upload a raw file body. Pass the filename as a query parameter and set the Content-Type header.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Original filename"},"required":true,"description":"Original filename","name":"filename","in":"query"}],"requestBody":{"required":true,"description":"Raw file bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"File uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the uploaded file"},"type":{"type":"string","description":"MIME type of the uploaded file"},"size":{"type":"integer","description":"File size in bytes"},"filename":{"type":"string","description":"Original filename"}},"required":["url","type","size","filename"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/media/presign":{"post":{"operationId":"presignMedia","tags":["Media"],"summary":"Get a pre-signed upload URL","description":"Generate a pre-signed URL for direct upload to R2. The client can PUT the file to the returned URL.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filename":{"type":"string","description":"Desired filename"},"content_type":{"type":"string","description":"MIME type of the file to upload"}},"required":["filename","content_type"]}}}},"responses":{"200":{"description":"Pre-signed URL generated","content":{"application/json":{"schema":{"type":"object","properties":{"upload_url":{"type":"string","format":"uri","description":"Pre-signed PUT URL for uploading"},"url":{"type":"string","format":"uri","description":"Public URL after upload completes"},"expires_in":{"type":"integer","description":"Seconds until the upload URL expires"}},"required":["upload_url","url","expires_in"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/media/{id}":{"get":{"operationId":"getMedia","tags":["Media"],"summary":"Get media details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Media details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","nullable":true,"format":"uri","description":"Public URL"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type"},"size":{"type":"integer","description":"File size in bytes"},"width":{"type":"integer","nullable":true,"description":"Width in pixels"},"height":{"type":"integer","nullable":true,"description":"Height in pixels"},"duration":{"type":"integer","nullable":true,"description":"Duration in seconds (video/audio)"},"created_at":{"type":"string","format":"date-time","description":"Upload timestamp"}},"required":["id","url","filename","mime_type","size","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteMedia","tags":["Media"],"summary":"Delete media","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Media deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/media/confirm":{"post":{"operationId":"confirmMedia","tags":["Media"],"summary":"Confirm a presigned upload completed","description":"After uploading a file to the presigned URL, call this endpoint to mark the media as ready.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"storage_key":{"type":"string","description":"The storage key from the presign response URL"}},"required":["storage_key"]}}}},"responses":{"200":{"description":"Upload confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","nullable":true,"format":"uri","description":"Public URL"},"filename":{"type":"string","description":"Original filename"},"mime_type":{"type":"string","description":"MIME type"},"size":{"type":"integer","description":"File size in bytes"},"width":{"type":"integer","nullable":true,"description":"Width in pixels"},"height":{"type":"integer","nullable":true,"description":"Height in pixels"},"duration":{"type":"integer","nullable":true,"description":"Duration in seconds (video/audio)"},"created_at":{"type":"string","format":"date-time","description":"Upload timestamp"}},"required":["id","url","filename","mime_type","size","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Media not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/webhooks":{"get":{"operationId":"listWebhooks","tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List of webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Webhook ID"},"url":{"type":"string","format":"uri","description":"Endpoint URL"},"enabled":{"type":"boolean","description":"Whether the webhook is active"},"events":{"type":"array","items":{"type":"string"},"description":"Subscribed events"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","url","enabled","events","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createWebhook","tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"Create a new webhook endpoint. The signing secret is returned only once in the response.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Webhook endpoint URL"},"events":{"type":"array","items":{"type":"string","enum":["post.published","post.partial","post.failed","post.scheduled","post.recycled","account.connected","account.disconnected","comment.received","message.received","auto_post.created","auto_post.error","engagement_rule.triggered","cross_post_action.executed","cross_post_action.failed"]},"minItems":1,"description":"Events to subscribe to"},"workspace_id":{"type":"string","description":"Workspace ID to scope this webhook to"}},"required":["url","events"]}}}},"responses":{"201":{"description":"Webhook created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Webhook ID"},"url":{"type":"string","format":"uri","description":"Endpoint URL"},"secret":{"type":"string","description":"Webhook signing secret (shown only once)"},"enabled":{"type":"boolean","description":"Whether the webhook is active"},"events":{"type":"array","items":{"type":"string"},"description":"Subscribed events"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","url","secret","enabled","events","created_at"]}}}},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/webhooks/{id}":{"patch":{"operationId":"updateWebhook","tags":["Webhooks"],"summary":"Update a webhook endpoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Updated endpoint URL"},"events":{"type":"array","items":{"type":"string","enum":["post.published","post.partial","post.failed","post.scheduled","post.recycled","account.connected","account.disconnected","comment.received","message.received","auto_post.created","auto_post.error","engagement_rule.triggered","cross_post_action.executed","cross_post_action.failed"]},"minItems":1,"description":"Updated events"},"enabled":{"type":"boolean","description":"Enable or disable the webhook"}}}}}},"responses":{"200":{"description":"Webhook updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Webhook ID"},"url":{"type":"string","format":"uri","description":"Endpoint URL"},"enabled":{"type":"boolean","description":"Whether the webhook is active"},"events":{"type":"array","items":{"type":"string"},"description":"Subscribed events"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","url","enabled","events","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteWebhook","tags":["Webhooks"],"summary":"Delete a webhook endpoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Webhook deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/webhooks/test":{"post":{"operationId":"testWebhook","tags":["Webhooks"],"summary":"Send a test webhook delivery","description":"Send a test POST request to the webhook URL to verify it is reachable.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"webhook_id":{"type":"string","description":"ID of the webhook to test"}},"required":["webhook_id"]}}}},"responses":{"200":{"description":"Test delivery result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the test delivery succeeded"},"status_code":{"type":"integer","nullable":true,"description":"HTTP status code from the test delivery"},"response_time_ms":{"type":"integer","nullable":true,"description":"Response time in milliseconds"}},"required":["success","status_code","response_time_ms"]}}}},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/webhooks/logs":{"get":{"operationId":"getWebhookLogs","tags":["Webhooks"],"summary":"List webhook delivery logs","description":"Returns delivery logs from the last 7 days.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"Delivery logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"webhook_id":{"type":"string"},"event":{"type":"string"},"status_code":{"type":"number","nullable":true},"response_time_ms":{"type":"number","nullable":true},"success":{"type":"boolean"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","webhook_id","event","status_code","response_time_ms","success","error","created_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/api-keys":{"get":{"operationId":"listApiKeys","tags":["API Keys"],"summary":"List API keys","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"List of API keys","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"API key ID"},"name":{"type":"string","nullable":true,"description":"API key name"},"start":{"type":"string","description":"First 8 characters of the key (preview)"},"prefix":{"type":"string","nullable":true,"description":"Key prefix (e.g. rlay_live_)"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"expires_at":{"type":"string","nullable":true,"format":"date-time","description":"Expiration timestamp"},"enabled":{"type":"boolean","description":"Whether the key is active"},"permission":{"type":"string","enum":["read_write","read_only"],"description":"Permission level"},"workspace_scope":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string"}}],"description":"Workspace access: 'all' or array of workspace IDs"}},"required":["id","name","start","prefix","created_at","expires_at","enabled","permission","workspace_scope"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createApiKey","tags":["API Keys"],"summary":"Create an API key","description":"Create a new API key. The full key is returned only once in the response — store it securely.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Name for the API key"},"expires_in_days":{"type":"integer","minimum":1,"maximum":365,"description":"Number of days until the key expires"},"permission":{"type":"string","enum":["read_write","read_only"],"default":"read_write","description":"Permission level: read_write (default) or read_only"},"workspace_scope":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}],"default":"all","description":"Workspace access: 'all' for unrestricted, or array of workspace IDs"}},"required":["name"]}}}},"responses":{"201":{"description":"API key created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"API key ID"},"key":{"type":"string","description":"Full API key (shown once, store securely)"},"name":{"type":"string","nullable":true,"description":"API key name"},"prefix":{"type":"string","description":"Key prefix"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"expires_at":{"type":"string","nullable":true,"format":"date-time","description":"Expiration timestamp"},"permission":{"type":"string","enum":["read_write","read_only"],"description":"Permission level"},"workspace_scope":{"anyOf":[{"type":"string","enum":["all"]},{"type":"array","items":{"type":"string"}}],"description":"Workspace access: 'all' or array of workspace IDs"}},"required":["id","key","name","prefix","created_at","expires_at","permission","workspace_scope"]}}}},"400":{"description":"Invalid request (e.g. invalid workspace IDs)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/api-keys/{id}":{"delete":{"operationId":"deleteApiKey","tags":["API Keys"],"summary":"Delete an API key","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"API key deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","tags":["Usage"],"summary":"Get subscription usage","description":"Returns current plan details and API call usage statistics for the organization.","security":[{"Bearer":[]}],"responses":{"200":{"description":"Usage details","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"object","properties":{"name":{"type":"string","enum":["free","pro"],"description":"Current plan"},"api_calls_limit":{"type":"number","description":"API calls included per billing cycle"},"api_calls_per_min":{"type":"number","description":"API calls allowed per minute"},"features":{"type":"object","properties":{"analytics":{"type":"boolean","description":"Access to /v1/analytics"},"inbox":{"type":"boolean","description":"Access to /v1/inbox"}},"required":["analytics","inbox"]}},"required":["name","api_calls_limit","api_calls_per_min","features"]},"subscription":{"type":"object","properties":{"status":{"type":"string","description":"Subscription status"},"monthly_price_cents":{"type":"number","description":"Base monthly price in cents"},"price_per_thousand_calls_cents":{"type":"number","description":"Overage price per 1K API calls in cents"}},"required":["status","monthly_price_cents","price_per_thousand_calls_cents"]},"usage":{"type":"object","properties":{"api_calls_used":{"type":"number","description":"API calls used this cycle"},"api_calls_remaining":{"type":"number","nullable":true,"description":"API calls remaining this cycle. Null for pro plan (unlimited, overage billed)."},"overage_calls":{"type":"number","description":"API calls exceeding included amount"},"overage_cost_cents":{"type":"number","description":"Overage cost in cents"},"cycle_start":{"type":"string","format":"date-time","description":"Current billing cycle start"},"cycle_end":{"type":"string","format":"date-time","description":"Current billing cycle end"}},"required":["api_calls_used","api_calls_remaining","overage_calls","overage_cost_cents","cycle_start","cycle_end"]},"rate_limit":{"type":"object","properties":{"limit_per_minute":{"type":"number","description":"Max API calls per rate-limit window"}},"required":["limit_per_minute"]}},"required":["plan","subscription","usage","rate_limit"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/usage/logs":{"get":{"operationId":"listRequestLogs","tags":["Usage"],"summary":"List API request logs","description":"Returns per-request API logs for the organization, ordered by most recent first.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"Request log entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"status_code":{"type":"number"},"response_time_ms":{"type":"number"},"billable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","method","path","status_code","response_time_ms","billable","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"},"total":{"type":"number"}},"required":["data","next_cursor","has_more","total"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/streak":{"get":{"operationId":"getStreak","tags":["Streak"],"summary":"Get posting streak","description":"Returns the current posting streak status for the organization, including streak length, best streak, and time remaining.","security":[{"Bearer":[]}],"responses":{"200":{"description":"Streak details","content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean","description":"Whether there is an active posting streak"},"current_streak_days":{"type":"integer","description":"Current streak length in days"},"streak_started_at":{"type":"string","nullable":true,"format":"date-time","description":"When the current streak started"},"last_post_at":{"type":"string","nullable":true,"format":"date-time","description":"When the last post was published"},"best_streak_days":{"type":"integer","description":"Longest streak ever achieved"},"total_streaks_broken":{"type":"integer","description":"Total number of streaks that have ended"},"hours_remaining":{"type":"number","nullable":true,"description":"Hours remaining before the current streak expires (null if no active streak)"}},"required":["active","current_streak_days","streak_started_at","last_post_at","best_streak_days","total_streaks_broken","hours_remaining"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/workspaces":{"get":{"operationId":"listWorkspaces","tags":["Workspaces"],"summary":"List workspaces","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Search workspaces by name"},"required":false,"description":"Search workspaces by name","name":"search","in":"query"},{"schema":{"type":"number","minimum":1,"maximum":100,"default":20,"description":"Page size"},"required":false,"description":"Page size","name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"}],"responses":{"200":{"description":"List of workspaces","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Workspace ID"},"name":{"type":"string","description":"Workspace name"},"description":{"type":"string","nullable":true,"description":"Workspace description"},"account_ids":{"type":"array","items":{"type":"string"},"description":"IDs of accounts in this workspace"},"account_count":{"type":"number","description":"Number of accounts in this workspace"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last updated timestamp"}},"required":["id","name","description","account_ids","account_count","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createWorkspace","tags":["Workspaces"],"summary":"Create a workspace","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Workspace name"},"description":{"type":"string","maxLength":1000,"description":"Workspace description"}},"required":["name"]}}}},"responses":{"201":{"description":"Workspace created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Workspace ID"},"name":{"type":"string","description":"Workspace name"},"description":{"type":"string","nullable":true,"description":"Workspace description"},"account_ids":{"type":"array","items":{"type":"string"},"description":"IDs of accounts in this workspace"},"account_count":{"type":"number","description":"Number of accounts in this workspace"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last updated timestamp"}},"required":["id","name","description","account_ids","account_count","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/workspaces/{id}":{"patch":{"operationId":"updateWorkspace","tags":["Workspaces"],"summary":"Update a workspace","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Workspace name"},"description":{"type":"string","nullable":true,"maxLength":1000,"description":"Workspace description"}}}}}},"responses":{"200":{"description":"Workspace updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Workspace ID"},"name":{"type":"string","description":"Workspace name"},"description":{"type":"string","nullable":true,"description":"Workspace description"},"account_ids":{"type":"array","items":{"type":"string"},"description":"IDs of accounts in this workspace"},"account_count":{"type":"number","description":"Number of accounts in this workspace"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last updated timestamp"}},"required":["id","name","description","account_ids","account_count","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteWorkspace","tags":["Workspaces"],"summary":"Delete a workspace","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Workspace deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/beehiiv":{"post":{"operationId":"connectBeehiiv","tags":["Connect"],"summary":"Connect Beehiiv newsletter","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","description":"Beehiiv API key"},"publication_id":{"type":"string","description":"Beehiiv publication ID"}},"required":["api_key","publication_id"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"400":{"description":"Auth failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/convertkit":{"post":{"operationId":"connectConvertKit","tags":["Connect"],"summary":"Connect ConvertKit (Kit) newsletter","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","description":"ConvertKit API key"},"api_secret":{"type":"string","description":"ConvertKit API secret"}},"required":["api_key","api_secret"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"400":{"description":"Auth failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/mailchimp":{"post":{"operationId":"connectMailchimp","tags":["Connect"],"summary":"Connect Mailchimp newsletter","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","description":"Mailchimp API key (includes datacenter suffix, e.g. xxx-us21)"}},"required":["api_key"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"400":{"description":"Auth failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/listmonk":{"post":{"operationId":"connectListMonk","tags":["Connect"],"summary":"Connect self-hosted ListMonk newsletter","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"instance_url":{"type":"string","format":"uri","description":"ListMonk instance URL (e.g. https://listmonk.example.com)"},"username":{"type":"string","description":"ListMonk admin username"},"password":{"type":"string","description":"ListMonk admin password"}},"required":["instance_url","username","password"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"400":{"description":"Auth failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/bluesky":{"post":{"operationId":"connectBluesky","tags":["Connect"],"summary":"Connect Bluesky via app password","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"handle":{"type":"string","description":"Bluesky handle (e.g. user.bsky.social)"},"app_password":{"type":"string","description":"Bluesky app password"}},"required":["handle","app_password"]}}}},"responses":{"201":{"description":"Account connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/telegram":{"post":{"operationId":"initTelegram","tags":["Connect"],"summary":"Initiate Telegram bot connection","description":"Generates a 6-character access code (valid 15 minutes).","security":[{"Bearer":[]}],"responses":{"200":{"description":"Access code generated","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"6-character access code"},"expires_at":{"type":"string","format":"date-time","description":"ISO 8601 expiry timestamp"},"expires_in":{"type":"integer","description":"Seconds until code expires"},"bot_username":{"type":"string","description":"Telegram bot username to message"},"instructions":{"type":"array","items":{"type":"string"},"description":"Step-by-step instructions for the user"}},"required":["code","expires_at","expires_in","bot_username","instructions"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"pollTelegram","tags":["Connect"],"summary":"Poll Telegram connection status","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"The 6-character access code to check"},"required":true,"description":"The 6-character access code to check","name":"code","in":"query"}],"responses":{"200":{"description":"Connection status","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","connected","expired"],"description":"Current connection status"},"chat_id":{"type":"string","description":"Telegram chat ID once connected"},"chat_title":{"type":"string","description":"Chat or channel title"},"chat_type":{"type":"string","description":"Chat type (private, group, supergroup, channel)"},"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"],"description":"Connected account details"},"expires_at":{"type":"string","format":"date-time","description":"Code expiry timestamp"}},"required":["status"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/telegram/direct":{"post":{"operationId":"connectTelegramDirect","tags":["Connect"],"summary":"Connect Telegram directly with chat ID","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"chat_id":{"type":"string","description":"Telegram chat or channel ID"}},"required":["chat_id"]}}}},"responses":{"201":{"description":"Account connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/pending-data":{"get":{"operationId":"getPendingData","tags":["Connect"],"summary":"Fetch pending OAuth data","description":"One-time use, expires after 10 minutes. For headless OAuth flows.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Temporary token from headless OAuth flow"},"required":true,"description":"Temporary token from headless OAuth flow","name":"token","in":"query"}],"responses":{"200":{"description":"Pending OAuth data","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"temp_token":{"type":"string","description":"Token to use for secondary selection"},"user_profile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","username","avatar_url"],"description":"Basic user profile from the platform"},"pages":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Facebook pages available"},"profiles":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Snapchat profiles available"},"boards":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Pinterest boards available"},"locations":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Google Business locations available"},"organizations":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"LinkedIn organizations available"}},"required":["platform","temp_token","user_profile"]}}}},"404":{"description":"Token not found or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connect/whatsapp/sdk-config":{"get":{"operationId":"getWhatsAppSDKConfig","tags":["Connect"],"summary":"Get WhatsApp Embedded Signup SDK config","security":[{"Bearer":[]}],"responses":{"200":{"description":"SDK configuration","content":{"application/json":{"schema":{"type":"object","properties":{"app_id":{"type":"string","description":"Facebook App ID for WhatsApp embedded signup"},"config_id":{"type":"string","description":"WhatsApp configuration ID"}},"required":["app_id","config_id"]}}}}}}},"/v1/connect/whatsapp/embedded-signup":{"post":{"operationId":"completeWhatsAppEmbeddedSignup","tags":["Connect"],"summary":"Complete WhatsApp Embedded Signup","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"Code from WhatsApp embedded signup flow"}},"required":["code"]}}}},"responses":{"201":{"description":"WhatsApp account connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/whatsapp/credentials":{"post":{"operationId":"connectWhatsAppCredentials","tags":["Connect"],"summary":"Connect WhatsApp via System User credentials","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string","description":"WhatsApp Business API access token"},"waba_id":{"type":"string","description":"WhatsApp Business Account ID"},"phone_number_id":{"type":"string","description":"WhatsApp phone number ID"}},"required":["access_token","waba_id","phone_number_id"]}}}},"responses":{"201":{"description":"WhatsApp account connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/facebook/pages":{"get":{"operationId":"listConnectFacebookPages","tags":["Connect"],"summary":"List Facebook Pages after OAuth","security":[{"Bearer":[]}],"responses":{"200":{"description":"Available pages","content":{"application/json":{"schema":{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Facebook page ID"},"name":{"type":"string","description":"Page name"},"picture_url":{"type":"string","nullable":true,"description":"Page profile picture URL"},"category":{"type":"string","nullable":true,"description":"Page category"}},"required":["id","name"]}}},"required":["pages"]}}}}}},"post":{"operationId":"selectFacebookPage","tags":["Connect"],"summary":"Select Facebook Page to connect","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"page_id":{"type":"string","description":"Selected Facebook page ID"},"connect_token":{"type":"string","description":"Token from pending data or OAuth flow"}},"required":["page_id","connect_token"]}}}},"responses":{"201":{"description":"Page connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/linkedin/organizations":{"get":{"operationId":"listConnectLinkedInOrgs","tags":["Connect"],"summary":"List LinkedIn organizations after OAuth","security":[{"Bearer":[]}],"responses":{"200":{"description":"Available organizations","content":{"application/json":{"schema":{"type":"object","properties":{"organizations":{"type":"array","items":{"type":"object","properties":{"urn":{"type":"string","description":"LinkedIn organization URN"},"name":{"type":"string","description":"Organization name"},"logo_url":{"type":"string","nullable":true,"description":"Organization logo URL"},"vanity_name":{"type":"string","nullable":true,"description":"Organization vanity name"}},"required":["urn","name"]}},"personal_profile":{"type":"object","properties":{"urn":{"type":"string"},"name":{"type":"string"}},"required":["urn","name"],"description":"User's personal LinkedIn profile"}},"required":["organizations"]}}}}}},"post":{"operationId":"selectLinkedInOrg","tags":["Connect"],"summary":"Select LinkedIn organization","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"organization_urn":{"type":"string","description":"LinkedIn organization URN (required if account_type is organization)"},"account_type":{"type":"string","enum":["personal","organization"],"description":"Whether to connect as a personal profile or organization"},"connect_token":{"type":"string","description":"Token from pending data or OAuth flow"}},"required":["account_type","connect_token"]}}}},"responses":{"201":{"description":"Organization connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/pinterest/boards":{"get":{"operationId":"listConnectPinterestBoards","tags":["Connect"],"summary":"List Pinterest boards after OAuth","security":[{"Bearer":[]}],"responses":{"200":{"description":"Available boards","content":{"application/json":{"schema":{"type":"object","properties":{"boards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Pinterest board ID"},"name":{"type":"string","description":"Board name"},"description":{"type":"string","nullable":true,"description":"Board description"},"pin_count":{"type":"integer","description":"Number of pins on the board"}},"required":["id","name"]}}},"required":["boards"]}}}}}},"post":{"operationId":"selectPinterestBoard","tags":["Connect"],"summary":"Select Pinterest board","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"board_id":{"type":"string","description":"Selected Pinterest board ID"},"connect_token":{"type":"string","description":"Token from pending data or OAuth flow"}},"required":["board_id","connect_token"]}}}},"responses":{"201":{"description":"Board connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/googlebusiness/locations":{"get":{"operationId":"listConnectGBPLocations","tags":["Connect"],"summary":"List Google Business locations after OAuth","security":[{"Bearer":[]}],"responses":{"200":{"description":"Available locations","content":{"application/json":{"schema":{"type":"object","properties":{"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Google Business location ID"},"name":{"type":"string","description":"Business name"},"address":{"type":"string","nullable":true,"description":"Business address"},"phone":{"type":"string","nullable":true,"description":"Business phone number"}},"required":["id","name"]}}},"required":["locations"]}}}}}},"post":{"operationId":"selectGBPLocation","tags":["Connect"],"summary":"Select Google Business location","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"location_id":{"type":"string","description":"Selected Google Business location ID"},"connect_token":{"type":"string","description":"Token from pending data or OAuth flow"}},"required":["location_id","connect_token"]}}}},"responses":{"201":{"description":"Location connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/snapchat/profiles":{"get":{"operationId":"listConnectSnapchatProfiles","tags":["Connect"],"summary":"List Snapchat Public Profiles after OAuth","security":[{"Bearer":[]}],"responses":{"200":{"description":"Available profiles","content":{"application/json":{"schema":{"type":"object","properties":{"profiles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Snapchat profile ID"},"display_name":{"type":"string","description":"Display name"},"username":{"type":"string","description":"Snapchat username"},"profile_image_url":{"type":"string","nullable":true,"description":"Profile image URL"},"subscriber_count":{"type":"integer","description":"Number of subscribers"}},"required":["id","display_name","username"]}}},"required":["profiles"]}}}}}},"post":{"operationId":"selectSnapchatProfile","tags":["Connect"],"summary":"Select Snapchat Public Profile","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"profile_id":{"type":"string","description":"Selected Snapchat profile ID"},"connect_token":{"type":"string","description":"Token from pending data or OAuth flow"}},"required":["profile_id","connect_token"]}}}},"responses":{"201":{"description":"Profile connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}}}}},"/v1/connect/{platform}":{"get":{"operationId":"startOAuth","tags":["Connect"],"summary":"Start OAuth flow","description":"Returns an auth_url to redirect the user for OAuth authorization.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","threads","snapchat","googlebusiness","mastodon"],"description":"OAuth platform to connect"},"required":true,"description":"OAuth platform to connect","name":"platform","in":"path"},{"schema":{"type":"string","format":"uri","description":"URL to redirect after OAuth completes"},"required":false,"description":"URL to redirect after OAuth completes","name":"redirect_url","in":"query"},{"schema":{"type":"string","description":"Auth method variant (e.g. \"direct\" for Instagram Login instead of Facebook Login)"},"required":false,"description":"Auth method variant (e.g. \"direct\" for Instagram Login instead of Facebook Login)","name":"method","in":"query"},{"schema":{"type":"string","description":"Set to \"true\" for headless mode (returns data instead of redirecting)"},"required":false,"description":"Set to \"true\" for headless mode (returns data instead of redirecting)","name":"headless","in":"query"}],"responses":{"200":{"description":"OAuth URL","content":{"application/json":{"schema":{"type":"object","properties":{"auth_url":{"type":"string","format":"uri","description":"URL to redirect the user for OAuth authorization"}},"required":["auth_url"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"completeOAuth","tags":["Connect"],"summary":"Complete OAuth callback","description":"Exchange OAuth code for tokens and save the account.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","threads","snapchat","googlebusiness","mastodon"],"description":"OAuth platform to complete"},"required":true,"description":"OAuth platform to complete","name":"platform","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","description":"OAuth authorization code"},"redirect_url":{"type":"string","format":"uri","description":"Redirect URL used during the OAuth flow (must match)"},"state":{"type":"string","description":"OAuth state token for direct KV lookup"}},"required":["code"]}}}},"responses":{"201":{"description":"Account connected","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string","description":"Account ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"platform_account_id":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"workspace":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"Account workspace"},"connected_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","platform","platform_account_id","username","display_name","avatar_url","metadata","workspace","connected_at","updated_at"]}},"required":["account"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/connections/logs":{"get":{"operationId":"listConnectionLogs","tags":["Connections"],"summary":"List connection logs","description":"Returns connection event history for the organization.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"Connection log entries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Log entry ID"},"account_id":{"type":"string","nullable":true,"description":"Social account ID"},"platform":{"type":"string","description":"Platform name"},"event":{"type":"string","enum":["connected","disconnected","token_refreshed","error"],"description":"Event type"},"message":{"type":"string","nullable":true,"description":"Event details"},"created_at":{"type":"string","format":"date-time","description":"Timestamp"}},"required":["id","account_id","platform","event","message","created_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics":{"get":{"operationId":"getAnalytics","tags":["Analytics"],"summary":"Get post analytics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Filter by post ID"},"required":false,"description":"Filter by post ID","name":"post_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601 date string)"},"required":false,"description":"Start date (ISO 8601 date string)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601 date string)"},"required":false,"description":"End date (ISO 8601 date string)","name":"to_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Offset"},"required":false,"description":"Offset","name":"offset","in":"query"}],"responses":{"200":{"description":"Post analytics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"post_id":{"type":"string","description":"Post ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"impressions":{"type":"number","nullable":true,"description":"Total impressions"},"reach":{"type":"number","nullable":true,"description":"Total reach"},"likes":{"type":"number","nullable":true,"description":"Total likes"},"comments":{"type":"number","nullable":true,"description":"Total comments"},"shares":{"type":"number","nullable":true,"description":"Total shares"},"saves":{"type":"number","nullable":true,"description":"Total saves"},"clicks":{"type":"number","nullable":true,"description":"Total clicks"},"views":{"type":"number","nullable":true,"description":"Total views"},"published_at":{"type":"string","format":"date-time","description":"Published timestamp"}},"required":["post_id","platform","published_at"]}},"overview":{"type":"object","properties":{"total_posts":{"type":"number","description":"Total number of posts"},"total_impressions":{"type":"number","description":"Total impressions across posts"},"total_likes":{"type":"number","description":"Total likes across posts"},"total_comments":{"type":"number","description":"Total comments across posts"},"total_shares":{"type":"number","description":"Total shares across posts"},"total_clicks":{"type":"number","description":"Total clicks across posts"},"total_views":{"type":"number","description":"Total views across posts"}},"required":["total_posts","total_impressions","total_likes","total_comments","total_shares","total_clicks","total_views"]},"truncated":{"type":"boolean","description":"True when the matching target set exceeds the per-response cap. Narrow by from_date/to_date/platform to see the full set."}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/daily-metrics":{"get":{"operationId":"getDailyMetrics","tags":["Analytics"],"summary":"Get daily aggregated metrics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"to_date","in":"query"}],"responses":{"200":{"description":"Daily metrics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date (YYYY-MM-DD)"},"post_count":{"type":"number","description":"Posts published on this date"},"platforms":{"type":"object","additionalProperties":{"type":"number"},"description":"Post count per platform"},"impressions":{"type":"number","description":"Total impressions"},"likes":{"type":"number","description":"Total likes"},"comments":{"type":"number","description":"Total comments"},"shares":{"type":"number","description":"Total shares"},"clicks":{"type":"number","description":"Total clicks"},"views":{"type":"number","description":"Total views"}},"required":["date","post_count","platforms","impressions","likes","comments","shares","clicks","views"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/best-time":{"get":{"operationId":"getBestTime","tags":["Analytics"],"summary":"Get best posting times based on engagement","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"to_date","in":"query"}],"responses":{"200":{"description":"Best posting times","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday)"},"hour_utc":{"type":"integer","minimum":0,"maximum":23,"description":"Hour in UTC"},"avg_engagement":{"type":"number","description":"Average engagement score"},"post_count":{"type":"number","description":"Number of posts analyzed"}},"required":["day_of_week","hour_utc","avg_engagement","post_count"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/content-decay":{"get":{"operationId":"getContentDecay","tags":["Analytics"],"summary":"Get engagement decay curve for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID to analyze decay for"},"required":true,"description":"Post ID to analyze decay for","name":"post_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30,"description":"Number of days to analyze"},"required":false,"description":"Number of days to analyze","name":"days","in":"query"}],"responses":{"200":{"description":"Content decay data","content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"data":{"type":"array","items":{"type":"object","properties":{"day":{"type":"number","description":"Days since publication"},"impressions":{"type":"number","description":"Impressions on this day"},"engagement":{"type":"number","description":"Engagement on this day"},"cumulative_impressions":{"type":"number","description":"Cumulative impressions"},"cumulative_engagement":{"type":"number","description":"Cumulative engagement"}},"required":["day","impressions","engagement","cumulative_impressions","cumulative_engagement"]}},"half_life_days":{"type":"number","nullable":true,"description":"Days until engagement halved"}},"required":["post_id","platform","data","half_life_days"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/post-timeline":{"get":{"operationId":"getPostTimeline","tags":["Analytics"],"summary":"Get per-post daily timeline of metrics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID"},"required":true,"description":"Post ID","name":"post_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"to_date","in":"query"}],"responses":{"200":{"description":"Post timeline data","content":{"application/json":{"schema":{"type":"object","properties":{"post_id":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date (YYYY-MM-DD)"},"impressions":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"clicks":{"type":"number"},"views":{"type":"number"}},"required":["date","impressions","likes","comments","shares","clicks","views"]}}},"required":["post_id","data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/posting-frequency":{"get":{"operationId":"getPostingFrequency","tags":["Analytics"],"summary":"Get posting frequency vs engagement analysis","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"to_date","in":"query"}],"responses":{"200":{"description":"Posting frequency data","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"posts_per_week":{"type":"number","description":"Average posts per week in bucket"},"avg_engagement":{"type":"number","description":"Average engagement"},"avg_impressions":{"type":"number","description":"Average impressions"},"sample_weeks":{"type":"number","description":"Number of weeks in sample"}},"required":["posts_per_week","avg_engagement","avg_impressions","sample_weeks"]}},"optimal_frequency":{"type":"number","nullable":true,"description":"Recommended posts per week"}},"required":["data","optimal_frequency"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/youtube/daily-views":{"get":{"operationId":"getYouTubeDailyViews","tags":["Analytics"],"summary":"Get YouTube daily views and watch time","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"YouTube account ID"},"required":true,"description":"YouTube account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"to_date","in":"query"}],"responses":{"200":{"description":"YouTube daily views","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date (YYYY-MM-DD)"},"views":{"type":"number","description":"Total views"},"watch_time_minutes":{"type":"number","description":"Watch time in minutes"},"subscribers_gained":{"type":"number","description":"Net subscribers gained"}},"required":["date","views","watch_time_minutes","subscribers_gained"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/channels":{"get":{"operationId":"getAnalyticsChannels","tags":["Platform Analytics"],"summary":"Get all connected channels with summary analytics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to today"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to today","name":"to_date","in":"query"}],"responses":{"200":{"description":"Channel summaries","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string"},"platform":{"type":"string"},"username":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"followers":{"type":"number","nullable":true},"impressions":{"type":"number","nullable":true},"engagement_rate":{"type":"number","nullable":true},"has_analytics":{"type":"boolean"},"needs_reconnect":{"type":"boolean"}},"required":["account_id","platform","username","display_name","avatar_url","followers","impressions","engagement_rate","has_analytics","needs_reconnect"]}},"totals":{"type":"object","properties":{"total_audience":{"type":"number"},"total_impressions":{"type":"number"},"total_engagement":{"type":"number"},"audience_change":{"type":"number","nullable":true},"impressions_change":{"type":"number","nullable":true},"engagement_change":{"type":"number","nullable":true}},"required":["total_audience","total_impressions","total_engagement","audience_change","impressions_change","engagement_change"]}},"required":["data","totals"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/platform/overview":{"get":{"operationId":"getPlatformOverview","tags":["Platform Analytics"],"summary":"Get platform-specific overview analytics for an account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Social account ID"},"required":true,"description":"Social account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to today"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to today","name":"to_date","in":"query"}],"responses":{"200":{"description":"Platform overview","content":{"application/json":{"schema":{"type":"object","properties":{"followers":{"type":"number","nullable":true},"follower_change":{"type":"number","nullable":true},"impressions":{"type":"number","nullable":true},"impression_change":{"type":"number","nullable":true},"engagement":{"type":"number","nullable":true},"engagement_change":{"type":"number","nullable":true},"engagement_rate":{"type":"number","nullable":true},"posts_count":{"type":"number","nullable":true},"reach":{"type":"number","nullable":true},"reach_change":{"type":"number","nullable":true},"platform_specific":{"type":"object","additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]}}},"required":["followers","follower_change","impressions","impression_change","engagement","engagement_change","engagement_rate","posts_count","reach","reach_change","platform_specific"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/platform/posts":{"get":{"operationId":"getPlatformPosts","tags":["Platform Analytics"],"summary":"Get post-level metrics from the platform API","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Social account ID"},"required":true,"description":"Social account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to today"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to today","name":"to_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of posts to return"},"required":false,"description":"Number of posts to return","name":"limit","in":"query"}],"responses":{"200":{"description":"Post metrics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"platform_post_id":{"type":"string"},"content":{"type":"string","nullable":true},"published_at":{"type":"string"},"media_url":{"type":"string","nullable":true},"media_type":{"type":"string","nullable":true},"impressions":{"type":"number"},"reach":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"saves":{"type":"number"},"clicks":{"type":"number"},"engagement_rate":{"type":"number"},"platform_url":{"type":"string","nullable":true}},"required":["platform_post_id","content","published_at","media_url","media_type","impressions","reach","likes","comments","shares","saves","clicks","engagement_rate","platform_url"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/platform/audience":{"get":{"operationId":"getPlatformAudience","tags":["Platform Analytics"],"summary":"Get audience demographics from the platform API","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Social account ID"},"required":true,"description":"Social account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to today"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to today","name":"to_date","in":"query"}],"responses":{"200":{"description":"Audience demographics","content":{"application/json":{"schema":{"type":"object","properties":{"top_cities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"number"}},"required":["name","count"]}},"top_countries":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"}},"required":["code","name","count"]}},"age_gender":{"type":"array","items":{"type":"object","properties":{"age_range":{"type":"string"},"male":{"type":"number"},"female":{"type":"number"},"other":{"type":"number"}},"required":["age_range","male","female","other"]}},"available":{"type":"boolean","description":"Whether audience data is available for this platform"}},"required":["top_cities","top_countries","age_gender","available"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/analytics/platform/daily":{"get":{"operationId":"getPlatformDaily","tags":["Platform Analytics"],"summary":"Get daily time series metrics from the platform API","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Social account ID"},"required":true,"description":"Social account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Start date (YYYY-MM-DD). Defaults to 30 days ago"},"required":false,"description":"Start date (YYYY-MM-DD). Defaults to 30 days ago","name":"from_date","in":"query"},{"schema":{"type":"string","description":"End date (YYYY-MM-DD). Defaults to today"},"required":false,"description":"End date (YYYY-MM-DD). Defaults to today","name":"to_date","in":"query"}],"responses":{"200":{"description":"Daily metrics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"impressions":{"type":"number"},"engagement":{"type":"number"},"reach":{"type":"number"},"followers":{"type":"number"}},"required":["date","impressions","engagement","reach","followers"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/validate/post":{"post":{"operationId":"validatePost","tags":["Tools"],"summary":"Validate a post (dry-run without publishing)","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post text. Optional if target_options provide per-target content."},"targets":{"type":"array","items":{"type":"string","description":"Account ID (e.g. \"acc_abc123\"), platform name (e.g. \"twitter\"), or workspace ID (e.g. \"ws_xxx\"). Platform names resolve to all accounts on that platform. Workspace IDs resolve to all accounts in the workspace."},"minItems":1,"description":"Account IDs, platform names, or workspace IDs to publish to"},"scheduled_at":{"type":"string","description":"Publish intent. Use \"now\" to publish immediately, \"draft\" to save as draft, \"auto\" to auto-schedule to the best available slot, or an ISO 8601 timestamp to schedule (max 30 days ahead).","example":"now"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from URL extension if omitted."}},"required":["url"]},"description":"Media attachments"},"target_options":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-target customizations keyed by target value (account ID or platform name). Supports platform-specific features such as Twitter polls (poll.options, poll.duration_minutes), threads, reply_to, and reply_settings."},"timezone":{"type":"string","default":"UTC","description":"IANA timezone for scheduling"},"workspace_id":{"type":"string","description":"Workspace ID to scope this post to"},"recycling":{"type":"object","properties":{"enabled":{"type":"boolean","default":true,"description":"Whether recycling is active"},"gap":{"type":"integer","minimum":1,"maximum":365,"description":"Interval value"},"gap_freq":{"type":"string","enum":["day","week","month"],"description":"Interval unit"},"start_date":{"type":"string","format":"date-time","description":"When to start recycling"},"expire_count":{"type":"integer","minimum":1,"maximum":100,"description":"Stop after this many recycles"},"expire_date":{"type":"string","format":"date-time","description":"Stop after this date"},"content_variations":{"type":"array","items":{"type":"string","maxLength":5000},"maxItems":20,"description":"Alternate content texts (round-robin)"}},"required":["gap","gap_freq","start_date"],"description":"Recycling configuration for evergreen content (Pro plan only)"},"shorten_urls":{"type":"boolean","description":"Shorten URLs in post content. Only relevant when short link mode is 'ask'. Ignored when mode is 'always' or 'never'. (Pro plan only)"},"cross_post_actions":{"type":"array","items":{"type":"object","properties":{"action_type":{"type":"string","enum":["repost","comment","quote"],"description":"Type of cross-post action"},"target_account_id":{"type":"string","description":"Account to perform the action from"},"content":{"type":"string","description":"Text content for comment/quote actions (required for comment and quote)"},"delay_minutes":{"type":"integer","minimum":0,"maximum":1440,"default":0,"description":"Delay in minutes after publishing"}},"required":["action_type","target_account_id"]},"description":"Cross-post actions to execute after publishing (e.g., repost from another account, comment from another account)"},"template_id":{"type":"string","description":"Content template ID. When provided, the template content is used as the base for the post. Explicit 'content' field takes precedence."},"idea_id":{"type":"string","description":"Create post from an idea. Pre-fills content from the idea. Explicit 'content' field takes precedence."},"template_variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Variables to interpolate in the template (e.g., { \"promo_code\": \"SUMMER25\" }). Built-in variables: {{date}}, {{account_name}}."},"skip_signature":{"type":"boolean","description":"When true, the default signature is not auto-appended even if one is configured."}},"required":["targets","scheduled_at"]}}}},"responses":{"200":{"description":"Validation result","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean","description":"Whether the post is valid for all targets"},"errors":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string","description":"Target identifier (account ID, platform, or field name)"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"}},"required":["target","code","message"]},"description":"Blocking errors"},"warnings":{"type":"array","items":{"type":"object","properties":{"target":{"type":"string","description":"Target identifier (account ID, platform, or field name)"},"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Human-readable error message"}},"required":["target","code","message"]},"description":"Non-blocking warnings"}},"required":["valid","errors","warnings"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/validate/media":{"post":{"operationId":"validateMedia","tags":["Tools"],"summary":"Validate a media URL for platform compatibility","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Media URL to validate"}},"required":["url"]}}}},"responses":{"200":{"description":"Media validation result","content":{"application/json":{"schema":{"type":"object","properties":{"accessible":{"type":"boolean","description":"Whether the URL is accessible"},"content_type":{"type":"string","nullable":true,"description":"MIME type"},"size":{"type":"number","nullable":true,"description":"File size in bytes"},"platform_limits":{"type":"object","properties":{"twitter":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"instagram":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"facebook":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"linkedin":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"tiktok":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"youtube":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"pinterest":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"reddit":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"bluesky":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"threads":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"telegram":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"snapchat":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"googlebusiness":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"whatsapp":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"mastodon":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"discord":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"sms":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"beehiiv":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"convertkit":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"mailchimp":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]},"listmonk":{"type":"object","properties":{"within_limit":{"type":"boolean","description":"Whether file size is within limit"},"max_size":{"type":"number","description":"Maximum file size in bytes"},"mime_type_supported":{"type":"boolean","description":"Whether the MIME type is supported by this platform"}},"required":["within_limit","max_size"]}},"description":"Per-platform size limits"}},"required":["accessible","platform_limits"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/validate/post-length":{"post":{"operationId":"validatePostLength","tags":["Tools"],"summary":"Check character counts against platform limits","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","description":"Post content to check"}},"required":["content"]}}}},"responses":{"200":{"description":"Character count results","content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"type":"object","properties":{"twitter":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"instagram":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"facebook":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"linkedin":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"tiktok":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"youtube":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"pinterest":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"reddit":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"bluesky":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"threads":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"telegram":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"snapchat":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"googlebusiness":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"whatsapp":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"mastodon":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"discord":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"sms":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"beehiiv":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"convertkit":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"mailchimp":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]},"listmonk":{"type":"object","properties":{"count":{"type":"number","description":"Character count for this platform"},"limit":{"type":"number","description":"Character limit for this platform"},"within_limit":{"type":"boolean","description":"Whether content is within limit"}},"required":["count","limit","within_limit"]}},"description":"Character count per platform"}},"required":["platforms"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/validate/subreddit":{"get":{"operationId":"checkSubreddit","tags":["Tools"],"summary":"Check if a subreddit exists and get its details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[a-zA-Z0-9_]+$","description":"Subreddit name (without r/ prefix)"},"required":true,"description":"Subreddit name (without r/ prefix)","name":"name","in":"query"}],"responses":{"200":{"description":"Subreddit check result","content":{"application/json":{"schema":{"type":"object","properties":{"exists":{"type":"boolean","description":"Whether the subreddit exists"},"name":{"type":"string","nullable":true,"description":"Canonical subreddit name"},"title":{"type":"string","nullable":true,"description":"Subreddit title"},"subscribers":{"type":"number","nullable":true,"description":"Subscriber count"},"nsfw":{"type":"boolean","nullable":true,"description":"Whether NSFW"},"post_types":{"type":"object","properties":{"self":{"type":"boolean","description":"Allows text posts"},"link":{"type":"boolean","description":"Allows link posts"},"image":{"type":"boolean","description":"Allows image posts"},"video":{"type":"boolean","description":"Allows video posts"}},"required":["self","link","image"],"description":"Allowed post types"}},"required":["exists"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/instagram/hashtag-checker":{"post":{"operationId":"checkHashtags","tags":["Tools"],"summary":"Check Instagram hashtag safety status","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"hashtags":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"Hashtags to check (without # prefix)"}},"required":["hashtags"]}}}},"responses":{"200":{"description":"Hashtag check results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"hashtag":{"type":"string","description":"Hashtag checked"},"status":{"type":"string","enum":["safe","restricted","banned"],"description":"Hashtag safety status"}},"required":["hashtag","status"]}}},"required":["results"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/linkedin/resolve-mention":{"post":{"operationId":"resolveLinkedInMention","tags":["Tools"],"summary":"Resolve a LinkedIn entity to mention syntax","description":"Looks up a LinkedIn organization by vanity name and returns the URN and ready-to-use mention syntax for post commentary.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"LinkedIn account ID (for API access)"},"type":{"type":"string","enum":["organization","person"],"description":"Entity type to resolve"},"vanity_name":{"type":"string","description":"Vanity name (e.g. 'microsoft' for linkedin.com/company/microsoft)"},"url":{"type":"string","format":"uri","description":"Full LinkedIn URL (alternative to vanity_name)"}},"required":["account_id","type"]}}}},"responses":{"200":{"description":"Resolution result","content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"boolean","description":"Whether the entity was resolved"},"urn":{"type":"string","description":"LinkedIn URN"},"name":{"type":"string","description":"Entity name from LinkedIn"},"mention_syntax":{"type":"string","description":"Ready-to-use mention syntax for post commentary"},"error":{"type":"string","description":"Error message if not resolved"}},"required":["resolved"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/youtube/download":{"post":{"operationId":"downloadYoutube","tags":["Tools"],"summary":"Download YouTube video","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/tiktok/download":{"post":{"operationId":"downloadTiktok","tags":["Tools"],"summary":"Download TikTok video","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/instagram/download":{"post":{"operationId":"downloadInstagram","tags":["Tools"],"summary":"Download Instagram media","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/twitter/download":{"post":{"operationId":"downloadTwitter","tags":["Tools"],"summary":"Download Twitter/X media","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/facebook/download":{"post":{"operationId":"downloadFacebook","tags":["Tools"],"summary":"Download Facebook video","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/linkedin/download":{"post":{"operationId":"downloadLinkedin","tags":["Tools"],"summary":"Download LinkedIn video","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/bluesky/download":{"post":{"operationId":"downloadBluesky","tags":["Tools"],"summary":"Download Bluesky media","description":"Returns available formats and direct download URL. Responds with 200 if the result is ready immediately, or 202 with a job_id to poll if processing takes longer. Rate limited by daily tool quota.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the content to download"},"format":{"type":"string","enum":["best","audio","720p","1080p","4k"],"default":"best","description":"Desired format"}},"required":["url"]}}}},"responses":{"200":{"description":"Download result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","description":"Platform name"},"title":{"type":"string","nullable":true,"description":"Content title"},"duration":{"type":"number","nullable":true,"description":"Duration in seconds"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"author":{"type":"string","nullable":true,"description":"Author/channel name"},"formats":{"type":"array","items":{"type":"object","properties":{"format_id":{"type":"string","description":"Format identifier"},"ext":{"type":"string","description":"File extension (mp4, webm, m4a, etc.)"},"resolution":{"type":"string","nullable":true,"description":"Resolution (e.g. 1280x720)"},"filesize":{"type":"number","nullable":true,"description":"File size in bytes"},"url":{"type":"string","description":"Direct download URL"}},"required":["format_id","ext","resolution","filesize","url"]},"description":"Available download formats"},"download_url":{"type":"string","nullable":true,"description":"Best match download URL"},"success":{"type":"boolean","enum":[true]}},"required":["platform","title","duration","thumbnail","author","formats","download_url","success"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL or wrong platform","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/youtube/transcript":{"post":{"operationId":"getYoutubeTranscript","tags":["Tools"],"summary":"Extract YouTube video transcript","description":"Extracts captions/subtitles from a YouTube video. Returns segments with timestamps and the full concatenated text. Responds with 200 if ready immediately, or 202 with a job_id to poll.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"YouTube video URL or video ID"},"lang":{"type":"string","description":"Preferred language code (e.g. 'en', 'es')"}},"required":["url"]}}}},"responses":{"200":{"description":"Transcript result (sync)","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"video_id":{"type":"string","description":"YouTube video ID"},"language":{"type":"string","nullable":true,"description":"Transcript language"},"is_auto_generated":{"type":"boolean","nullable":true,"description":"Whether auto-generated captions"},"segments":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Transcript text"},"start":{"type":"number","description":"Start time in seconds"},"duration":{"type":"number","description":"Duration in seconds"}},"required":["text","start","duration"]},"description":"Transcript segments with timestamps"},"full_text":{"type":"string","description":"Full concatenated transcript text"}},"required":["success","video_id","language","is_auto_generated","segments","full_text"]}}}},"202":{"description":"Job accepted (async — poll /tools/jobs/{job_id})","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID for polling"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string","description":"URL to poll for the result"}},"required":["job_id","status","poll_url"]}}}},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"429":{"description":"Daily tool limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tools/jobs/{job_id}":{"get":{"operationId":"getToolJobStatus","tags":["Tools"],"summary":"Poll for tool job result","description":"Check the status of an async tool job (download or transcript). Returns processing, completed with result, or failed with error.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Job ID returned from a download or transcript request"},"required":true,"description":"Job ID returned from a download or transcript request","name":"job_id","in":"path"}],"responses":{"200":{"description":"Job status","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string","description":"Job ID"},"status":{"type":"string","enum":["processing","completed","failed"],"description":"Current job status"},"type":{"type":"string","enum":["download","transcript"],"description":"Job type"},"created_at":{"type":"string","format":"date-time","description":"Job creation time"},"completed_at":{"type":"string","nullable":true,"format":"date-time","description":"Job completion time"},"result":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Job result when completed"},"error":{"type":"string","nullable":true,"description":"Error message when failed"},"error_code":{"type":"string","nullable":true,"description":"Error code when failed"}},"required":["job_id","status"]}}}},"404":{"description":"Job not found or expired","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/queue/slots":{"get":{"operationId":"listQueueSlots","tags":["Queue"],"summary":"List queue schedules","security":[{"Bearer":[]}],"responses":{"200":{"description":"Queue schedules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Queue schedule ID"},"name":{"type":"string","nullable":true,"description":"Schedule name"},"slots":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday, 6=Saturday)"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Time in HH:MM format"},"timezone":{"type":"string","description":"IANA timezone (e.g. America/New_York)"}},"required":["day_of_week","time","timezone"]},"description":"Time slots"},"is_default":{"type":"boolean","description":"Whether this is the default schedule"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Updated timestamp"}},"required":["id","slots","is_default","created_at","updated_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createQueueSlots","tags":["Queue"],"summary":"Create a queue schedule","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Schedule name"},"slots":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday, 6=Saturday)"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Time in HH:MM format"},"timezone":{"type":"string","description":"IANA timezone (e.g. America/New_York)"}},"required":["day_of_week","time","timezone"]},"minItems":1,"description":"Time slots"},"timezone":{"type":"string","description":"Default timezone for slots"}},"required":["slots","timezone"]}}}},"responses":{"201":{"description":"Queue schedule created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Queue schedule ID"},"name":{"type":"string","nullable":true,"description":"Schedule name"},"slots":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday, 6=Saturday)"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Time in HH:MM format"},"timezone":{"type":"string","description":"IANA timezone (e.g. America/New_York)"}},"required":["day_of_week","time","timezone"]},"description":"Time slots"},"is_default":{"type":"boolean","description":"Whether this is the default schedule"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Updated timestamp"}},"required":["id","slots","is_default","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateQueueSlots","tags":["Queue"],"summary":"Update queue schedule","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Schedule name"},"slots":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday, 6=Saturday)"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Time in HH:MM format"},"timezone":{"type":"string","description":"IANA timezone (e.g. America/New_York)"}},"required":["day_of_week","time","timezone"]},"description":"Updated time slots"},"set_as_default":{"type":"boolean","description":"Set this schedule as the default"}}}}}},"responses":{"200":{"description":"Queue schedule updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Queue schedule ID"},"name":{"type":"string","nullable":true,"description":"Schedule name"},"slots":{"type":"array","items":{"type":"object","properties":{"day_of_week":{"type":"integer","minimum":0,"maximum":6,"description":"Day of week (0=Sunday, 6=Saturday)"},"time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"Time in HH:MM format"},"timezone":{"type":"string","description":"IANA timezone (e.g. America/New_York)"}},"required":["day_of_week","time","timezone"]},"description":"Time slots"},"is_default":{"type":"boolean","description":"Whether this is the default schedule"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Updated timestamp"}},"required":["id","slots","is_default","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteQueueSlots","tags":["Queue"],"summary":"Delete queue schedule","security":[{"Bearer":[]}],"responses":{"204":{"description":"Queue schedule deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/queue/next-slot":{"get":{"operationId":"getNextQueueSlot","tags":["Queue"],"summary":"Get next available queue slot","security":[{"Bearer":[]}],"responses":{"200":{"description":"Next slot","content":{"application/json":{"schema":{"type":"object","properties":{"next_slot_at":{"type":"string","format":"date-time","description":"Next available slot (ISO 8601)"},"queue_id":{"type":"string","description":"Queue schedule ID"}},"required":["next_slot_at","queue_id"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/queue/preview":{"get":{"operationId":"previewQueueSlots","tags":["Queue"],"summary":"Preview upcoming queue slots","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50,"default":10,"description":"Number of upcoming slots to preview"},"required":false,"description":"Number of upcoming slots to preview","name":"count","in":"query"}],"responses":{"200":{"description":"Preview of upcoming slots","content":{"application/json":{"schema":{"type":"object","properties":{"slots":{"type":"array","items":{"type":"string","format":"date-time"},"description":"Upcoming slot timestamps (ISO 8601)"}},"required":["slots"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/queue/find-slot":{"get":{"operationId":"findQueueSlot","tags":["Queue"],"summary":"Find best available posting slot","description":"Returns suggested posting times using queue schedule, historical engagement data, and collision avoidance. Use strategy 'smart' (default) to combine all signals.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Account ID to optimize for"},"required":false,"description":"Account ID to optimize for","name":"account_id","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Earliest allowed time (ISO 8601). Defaults to now."},"required":false,"description":"Earliest allowed time (ISO 8601). Defaults to now.","name":"after","in":"query"},{"schema":{"type":"string","enum":["queue","best-time","smart"],"default":"smart","description":"Algorithm strategy: queue (slots only), best-time (engagement only), or smart (combined)"},"required":false,"description":"Algorithm strategy: queue (slots only), best-time (engagement only), or smart (combined)","name":"strategy","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10,"default":1,"description":"Number of slot suggestions to return"},"required":false,"description":"Number of slot suggestions to return","name":"count","in":"query"}],"responses":{"200":{"description":"Suggested posting slots","content":{"application/json":{"schema":{"type":"object","properties":{"slots":{"type":"array","items":{"type":"object","properties":{"slot_at":{"type":"string","format":"date-time","description":"Suggested posting time (ISO 8601)"},"score":{"type":"number","description":"Confidence score 0-100"},"reason":{"type":"string","enum":["queue_slot","best_time","hybrid"],"description":"Why this slot was suggested"},"conflicts":{"type":"number","description":"Number of existing posts at this time"}},"required":["slot_at","score","reason","conflicts"]}},"fallback":{"type":"boolean","description":"True if no ideal slot found, result is best-effort"}},"required":["slots","fallback"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/threads":{"post":{"operationId":"createThread","tags":["Threads"],"summary":"Create a thread","description":"Create a multi-item thread for publishing as a reply chain on supported platforms.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","minLength":1,"description":"Post content for this thread item"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the media file"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"}},"required":["url"]},"default":[],"description":"Media attachments for this item"},"delay_minutes":{"type":"integer","minimum":0,"maximum":1440,"default":0,"description":"Minutes to wait after the previous item is published before publishing this item (0-1440)"}},"required":["content"]},"minItems":2,"maxItems":25,"description":"Thread items in order. Minimum 2, maximum 25."},"targets":{"type":"array","items":{"type":"string"},"minItems":1,"description":"Account IDs, platform names, or workspace IDs"},"scheduled_at":{"type":"string","description":"Publish intent"},"target_options":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}},"description":"Per-platform options applied to all items"},"timezone":{"type":"string","default":"UTC","description":"IANA timezone"},"workspace_id":{"type":"string","description":"Workspace ID"}},"required":["items","targets","scheduled_at"]}}}},"responses":{"201":{"description":"Thread created","content":{"application/json":{"schema":{"type":"object","properties":{"thread_group_id":{"type":"string","description":"Thread group identifier"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"position":{"type":"number","description":"Position within thread (0 = root)"},"content":{"type":"string","nullable":true},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}},"required":["url"]}},"delay_minutes":{"type":"number","description":"Delay before this item in minutes"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","skipped"]},"platform_post_id":{"type":"string","nullable":true},"platform_url":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}},"required":["platform","status","platform_post_id","platform_url"]},"description":"Per-target results"}},"required":["id","position","content","media","delay_minutes","status","targets"]}},"scheduled_at":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["thread_group_id","status","items","scheduled_at","created_at","updated_at"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listThreads","tags":["Threads"],"summary":"List threads","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"},{"schema":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Threads list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"thread_group_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"item_count":{"type":"number"},"root_content":{"type":"string","nullable":true,"description":"Content of the first item"},"scheduled_at":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["thread_group_id","status","item_count","root_content","scheduled_at","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/threads/{thread_group_id}":{"get":{"operationId":"getThread","tags":["Threads"],"summary":"Get a thread","description":"Retrieve a full thread with all items and their per-target results.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Thread group ID"},"required":true,"description":"Thread group ID","name":"thread_group_id","in":"path"}],"responses":{"200":{"description":"Thread details","content":{"application/json":{"schema":{"type":"object","properties":{"thread_group_id":{"type":"string","description":"Thread group identifier"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Post ID"},"position":{"type":"number","description":"Position within thread (0 = root)"},"content":{"type":"string","nullable":true},"media":{"type":"array","nullable":true,"items":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string"}},"required":["url"]}},"delay_minutes":{"type":"number","description":"Delay before this item in minutes"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","partial"]},"targets":{"type":"object","additionalProperties":{"type":"object","properties":{"platform":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","publishing","published","failed","skipped"]},"platform_post_id":{"type":"string","nullable":true},"platform_url":{"type":"string","nullable":true},"error":{"type":"string","nullable":true}},"required":["platform","status","platform_post_id","platform_url"]},"description":"Per-target results"}},"required":["id","position","content","media","delay_minutes","status","targets"]}},"scheduled_at":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["thread_group_id","status","items","scheduled_at","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteThread","tags":["Threads"],"summary":"Delete a thread","description":"Delete an entire thread and all its items.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Thread group ID"},"required":true,"description":"Thread group ID","name":"thread_group_id","in":"path"}],"responses":{"204":{"description":"Thread deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/twitter/retweet":{"post":{"operationId":"retweet","tags":["Twitter"],"summary":"Retweet a tweet","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"tweet_id":{"type":"string","description":"Tweet ID to retweet"}},"required":["account_id","tweet_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}},"delete":{"operationId":"undoRetweet","tags":["Twitter"],"summary":"Undo a retweet","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"tweet_id":{"type":"string","description":"Tweet ID to retweet"}},"required":["account_id","tweet_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}}},"/v1/twitter/bookmark":{"post":{"operationId":"bookmarkTweet","tags":["Twitter"],"summary":"Bookmark a tweet","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"tweet_id":{"type":"string","description":"Tweet ID to bookmark"}},"required":["account_id","tweet_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}},"delete":{"operationId":"removeBookmark","tags":["Twitter"],"summary":"Remove a bookmark","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"tweet_id":{"type":"string","description":"Tweet ID to bookmark"}},"required":["account_id","tweet_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}}},"/v1/twitter/follow":{"post":{"operationId":"followUser","tags":["Twitter"],"summary":"Follow a user","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"target_user_id":{"type":"string","description":"User ID to follow"}},"required":["account_id","target_user_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}},"delete":{"operationId":"unfollowUser","tags":["Twitter"],"summary":"Unfollow a user","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Twitter account ID"},"target_user_id":{"type":"string","description":"User ID to follow"}},"required":["account_id","target_user_id"]}}}},"responses":{"200":{"description":"Action result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"401":{"description":"Unauthorized or missing token","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"429":{"description":"Rate limited by Twitter","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}},"502":{"description":"Twitter API error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code (e.g. ACCOUNT_NOT_FOUND, TOKEN_MISSING, TWITTER_API_ERROR)"},"message":{"type":"string","description":"Human-readable error message"},"twitter_error_code":{"type":"number","description":"Twitter API error code if available"}},"required":["code","message"],"description":"Error details when success is false"},"data":{"type":"object","properties":{"retweeted":{"type":"boolean"},"bookmarked":{"type":"boolean"},"following":{"type":"boolean"},"pending_follow":{"type":"boolean"}},"description":"Action result data from Twitter API"}},"required":["success"]}}}}}}},"/v1/inbox/comments":{"get":{"operationId":"listComments","tags":["Inbox"],"summary":"List comments across platforms","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"}],"responses":{"200":{"description":"Comments list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"author_name":{"type":"string","description":"Comment author name"},"author_avatar":{"type":"string","nullable":true,"description":"Author avatar URL"},"text":{"type":"string","description":"Comment text"},"created_at":{"type":"string","format":"date-time","description":"Comment timestamp"},"likes":{"type":"number","description":"Like count"},"replies_count":{"type":"number","description":"Reply count"},"hidden":{"type":"boolean","description":"Whether comment is hidden"},"parent_id":{"type":"string","nullable":true,"description":"Parent comment ID if this is a reply"},"post_id":{"type":"string","description":"Platform post/media/video ID"},"post_text":{"type":"string","nullable":true,"description":"Post caption snippet"},"post_thumbnail_url":{"type":"string","nullable":true,"description":"Post thumbnail URL"},"post_platform_url":{"type":"string","nullable":true,"description":"URL to the post on the platform"},"account_id":{"type":"string","description":"Social account ID"},"account_avatar_url":{"type":"string","nullable":true,"description":"Social account avatar URL"}},"required":["id","platform","author_name","text","created_at"]}},"post_id":{"type":"string","description":"Post ID if filtered by post"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/by-post":{"get":{"operationId":"listPostsByComments","tags":["Inbox"],"summary":"List posts with comment counts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"}],"responses":{"200":{"description":"Posts with comment counts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Platform post/media/video ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"account_id":{"type":"string","description":"Social account ID"},"account_avatar_url":{"type":"string","nullable":true,"description":"Social account avatar URL"},"text":{"type":"string","nullable":true,"description":"Post caption/message (truncated)"},"thumbnail_url":{"type":"string","nullable":true,"description":"Post thumbnail URL"},"platform_url":{"type":"string","nullable":true,"description":"URL to the post on the platform"},"created_at":{"type":"string","format":"date-time","description":"Post publish timestamp"},"comments_count":{"type":"number","description":"Total comment count"}},"required":["id","platform","account_id","text","thumbnail_url","platform_url","created_at","comments_count"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{post_id}":{"get":{"operationId":"getPostComments","tags":["Inbox"],"summary":"Get comments for a specific post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID"},"required":true,"description":"Post ID","name":"post_id","in":"path"},{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"}],"responses":{"200":{"description":"Post comments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"author_name":{"type":"string","description":"Comment author name"},"author_avatar":{"type":"string","nullable":true,"description":"Author avatar URL"},"text":{"type":"string","description":"Comment text"},"created_at":{"type":"string","format":"date-time","description":"Comment timestamp"},"likes":{"type":"number","description":"Like count"},"replies_count":{"type":"number","description":"Reply count"},"hidden":{"type":"boolean","description":"Whether comment is hidden"},"parent_id":{"type":"string","nullable":true,"description":"Parent comment ID if this is a reply"},"post_id":{"type":"string","description":"Platform post/media/video ID"},"post_text":{"type":"string","nullable":true,"description":"Post caption snippet"},"post_thumbnail_url":{"type":"string","nullable":true,"description":"Post thumbnail URL"},"post_platform_url":{"type":"string","nullable":true,"description":"URL to the post on the platform"},"account_id":{"type":"string","description":"Social account ID"},"account_avatar_url":{"type":"string","nullable":true,"description":"Social account avatar URL"}},"required":["id","platform","author_name","text","created_at"]}},"post_id":{"type":"string","description":"Post ID if filtered by post"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{post_id}/reply":{"post":{"operationId":"replyToComment","tags":["Inbox"],"summary":"Reply to a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID"},"required":true,"description":"Post ID","name":"post_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"description":"Reply text"},"account_id":{"type":"string","description":"Account ID to reply from"},"comment_id":{"type":"string","description":"Parent comment ID for threaded replies"}},"required":["text","account_id"]}}}},"responses":{"200":{"description":"Reply result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{comment_id}":{"delete":{"operationId":"deleteComment","tags":["Inbox"],"summary":"Delete a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{comment_id}/hide":{"post":{"operationId":"hideComment","tags":["Inbox"],"summary":"Hide a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"responses":{"200":{"description":"Hide result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"unhideComment","tags":["Inbox"],"summary":"Unhide a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"responses":{"200":{"description":"Unhide result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{comment_id}/like":{"post":{"operationId":"likeComment","tags":["Inbox"],"summary":"Like a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"responses":{"200":{"description":"Like result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"unlikeComment","tags":["Inbox"],"summary":"Unlike a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"responses":{"200":{"description":"Unlike result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/comments/{comment_id}/private-reply":{"post":{"operationId":"privateReplyToComment","tags":["Inbox"],"summary":"Send a private reply to a commenter","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Comment ID"},"required":true,"description":"Comment ID","name":"comment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"description":"Private reply text"},"account_id":{"type":"string","description":"Account ID to reply from"}},"required":["text","account_id"]}}}},"responses":{"200":{"description":"Private reply result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"comment_id":{"type":"string","description":"Comment ID"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/reviews":{"get":{"operationId":"listReviews","tags":["Inbox"],"summary":"List reviews across platforms","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5},"required":false,"name":"min_rating","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":5},"required":false,"name":"max_rating","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"}],"responses":{"200":{"description":"Reviews list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Review ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"author_name":{"type":"string","description":"Review author name"},"rating":{"type":"number","minimum":1,"maximum":5,"description":"Rating (1-5)"},"text":{"type":"string","nullable":true,"description":"Review text"},"reply":{"type":"string","nullable":true,"description":"Business reply text"},"created_at":{"type":"string","format":"date-time","description":"Review timestamp"}},"required":["id","platform","author_name","rating","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/reviews/{review_id}/reply":{"post":{"operationId":"replyToReview","tags":["Inbox"],"summary":"Reply to a review","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Review ID"},"required":true,"description":"Review ID","name":"review_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"description":"Reply text"},"account_id":{"type":"string","description":"Account ID"}},"required":["text","account_id"]}}}},"responses":{"200":{"description":"Reply result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteReviewReply","tags":["Inbox"],"summary":"Delete a review reply","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Review ID"},"required":true,"description":"Review ID","name":"review_id","in":"path"}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/classify":{"post":{"operationId":"classifyInboxMessages","tags":["Inbox AI"],"summary":"Classify messages with AI (batch, up to 50)","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Optional message ID for correlation"},"text":{"type":"string","description":"Message text to classify"}},"required":["text"]},"minItems":1,"maxItems":50,"description":"Messages to classify (1-50)"}},"required":["messages"]}}}},"responses":{"200":{"description":"Classification results","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Correlated message ID"},"sentiment":{"type":"object","properties":{"score":{"type":"number","minimum":-1,"maximum":1,"description":"Sentiment score (-1.0 to 1.0)"},"label":{"type":"string","enum":["positive","neutral","negative"],"description":"Sentiment label"}},"required":["score","label"]},"intent":{"type":"string","enum":["question","complaint","compliment","spam","feedback","general"],"description":"Detected intent"},"urgency":{"type":"string","enum":["high","medium","low"],"description":"Urgency level"},"requires_response":{"type":"boolean","description":"Whether a response is needed"}},"required":["sentiment","intent","urgency","requires_response"]}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"AI service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/suggest-reply":{"post":{"operationId":"suggestInboxReply","tags":["Inbox AI"],"summary":"Generate AI reply suggestions for a conversation","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string","description":"Conversation ID"},"tone":{"type":"string","description":"Desired tone (e.g. professional, friendly)"},"max_suggestions":{"type":"integer","minimum":1,"maximum":10,"description":"Max suggestions to generate"},"context":{"type":"string","description":"Additional context for reply generation"}},"required":["conversation_id"]}}}},"responses":{"200":{"description":"Reply suggestions","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Suggested reply text"},"tone":{"type":"string","description":"Tone of the suggestion"},"confidence":{"type":"number","minimum":0,"maximum":1,"description":"Confidence score"}},"required":["text","tone","confidence"]}}},"required":["suggestions"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"AI service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/summarize":{"post":{"operationId":"summarizeInboxConversation","tags":["Inbox AI"],"summary":"Generate AI summary of a conversation","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string","description":"Conversation ID"}},"required":["conversation_id"]}}}},"responses":{"200":{"description":"Conversation summary","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","description":"Conversation summary"},"key_topics":{"type":"array","items":{"type":"string"},"description":"Key topics discussed"},"action_needed":{"type":"string","description":"Next action needed"},"message_count":{"type":"number","description":"Total messages in conversation"},"timespan":{"type":"string","description":"Time range of the conversation"}},"required":["summary","key_topics","action_needed","message_count","timespan"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"503":{"description":"AI service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/priorities":{"get":{"operationId":"getInboxPriorities","tags":["Inbox AI"],"summary":"Prioritized inbox feed sorted by calculated priority score","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["comment_thread","dm","review"],"description":"Filter by conversation type"},"required":false,"description":"Filter by conversation type","name":"type","in":"query"},{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","enum":["open","archived","snoozed"],"description":"Filter by status"},"required":false,"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of labels"},"required":false,"description":"Comma-separated list of labels","name":"labels","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Prioritized conversation list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Conversation ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"type":{"type":"string","enum":["comment_thread","dm","review"],"description":"Conversation type"},"account_id":{"type":"string","description":"Social account ID"},"participant_name":{"type":"string","nullable":true,"description":"Participant display name"},"participant_avatar":{"type":"string","nullable":true,"description":"Participant avatar URL"},"participant_metadata":{"nullable":true,"description":"Platform-specific participant data (e.g. Instagram profile)"},"status":{"type":"string","enum":["open","archived","snoozed"],"description":"Conversation status"},"assigned_user_id":{"type":"string","nullable":true,"description":"Assigned organization user ID"},"priority":{"type":"string","nullable":true,"description":"Priority level"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels"},"unread_count":{"type":"number","description":"Unread message count"},"message_count":{"type":"number","description":"Total message count"},"last_message_text":{"type":"string","nullable":true,"description":"Last message text"},"last_message_at":{"type":"string","nullable":true,"description":"Last message timestamp"},"last_message_direction":{"type":"string","nullable":true,"description":"Last message direction"},"created_at":{"type":"string","description":"Created timestamp"},"updated_at":{"type":"string","description":"Updated timestamp"},"priority_score":{"type":"number","description":"Calculated priority score"}},"required":["id","platform","type","account_id","participant_name","participant_avatar","status","assigned_user_id","priority","labels","unread_count","message_count","last_message_text","last_message_at","last_message_direction","created_at","updated_at","priority_score"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations":{"get":{"operationId":"listInboxConversations","tags":["Inbox"],"summary":"List inbox conversations","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["comment_thread","dm","review"],"description":"Filter by conversation type"},"required":false,"description":"Filter by conversation type","name":"type","in":"query"},{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","enum":["open","archived","snoozed"],"default":"open","description":"Filter by status (defaults to open)"},"required":false,"description":"Filter by status (defaults to open)","name":"status","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of labels"},"required":false,"description":"Comma-separated list of labels","name":"labels","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated list of conversations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Conversation ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"type":{"type":"string","enum":["comment_thread","dm","review"],"description":"Conversation type"},"account_id":{"type":"string","description":"Social account ID"},"participant_name":{"type":"string","nullable":true,"description":"Participant display name"},"participant_avatar":{"type":"string","nullable":true,"description":"Participant avatar URL"},"participant_metadata":{"nullable":true,"description":"Platform-specific participant data (e.g. Instagram profile)"},"status":{"type":"string","enum":["open","archived","snoozed"],"description":"Conversation status"},"assigned_user_id":{"type":"string","nullable":true,"description":"Assigned organization user ID"},"priority":{"type":"string","nullable":true,"description":"Priority level"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels"},"unread_count":{"type":"number","description":"Unread message count"},"message_count":{"type":"number","description":"Total message count"},"last_message_text":{"type":"string","nullable":true,"description":"Last message text"},"last_message_at":{"type":"string","nullable":true,"description":"Last message timestamp"},"last_message_direction":{"type":"string","nullable":true,"description":"Last message direction"},"created_at":{"type":"string","description":"Created timestamp"},"updated_at":{"type":"string","description":"Updated timestamp"}},"required":["id","platform","type","account_id","participant_name","participant_avatar","status","assigned_user_id","priority","labels","unread_count","message_count","last_message_text","last_message_at","last_message_direction","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/bulk":{"post":{"operationId":"bulkInboxAction","tags":["Inbox"],"summary":"Perform bulk actions on conversations","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["label","unlabel","archive","unarchive","mark_read","set_priority"],"description":"Action to perform"},"targets":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"description":"Conversation IDs (max 100)"},"params":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"string"},"description":"Labels for label/unlabel actions"},"priority":{"type":"string","description":"Priority for set_priority action"}},"description":"Action-specific parameters"}},"required":["action","targets"]}}}},"responses":{"200":{"description":"Bulk action result","content":{"application/json":{"schema":{"type":"object","properties":{"processed":{"type":"number","description":"Number of successfully processed items"},"failed":{"type":"number","description":"Number of failed items"},"errors":{"type":"array","items":{"type":"string"},"description":"Error messages for failures"}},"required":["processed","failed","errors"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/search":{"get":{"operationId":"searchInboxMessages","tags":["Inbox"],"summary":"Full-text search across inbox messages","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query"},"required":true,"description":"Search query","name":"q","in":"query"},{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Start date (ISO 8601)"},"required":false,"description":"Start date (ISO 8601)","name":"since","in":"query"},{"schema":{"type":"string","description":"End date (ISO 8601)"},"required":false,"description":"End date (ISO 8601)","name":"until","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Message ID"},"conversation_id":{"type":"string","description":"Conversation ID"},"author_name":{"type":"string","nullable":true,"description":"Author name"},"author_avatar_url":{"type":"string","nullable":true,"description":"Author avatar URL"},"text":{"type":"string","nullable":true,"description":"Message text"},"direction":{"type":"string","description":"Message direction (inbound/outbound)"},"attachments":{"nullable":true,"description":"Message attachments"},"created_at":{"type":"string","description":"Message timestamp"}},"required":["id","conversation_id","author_name","author_avatar_url","text","direction","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/stats":{"get":{"operationId":"getInboxStats","tags":["Inbox"],"summary":"Aggregated inbox metrics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"],"description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Inbox statistics","content":{"application/json":{"schema":{"type":"object","properties":{"total_conversations":{"type":"number","description":"Total conversations"},"open_conversations":{"type":"number","description":"Open conversations"},"unread_messages":{"type":"number","description":"Unread messages"},"by_platform":{"type":"object","additionalProperties":{"type":"object","properties":{"conversations":{"type":"number","description":"Total conversations"},"unread":{"type":"number","description":"Unread message count"}},"required":["conversations","unread"]},"description":"Stats per platform"}},"required":["total_conversations","open_conversations","unread_messages","by_platform"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}":{"get":{"operationId":"getInboxConversation","tags":["Inbox"],"summary":"Get full conversation thread with messages","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"responses":{"200":{"description":"Conversation with messages","content":{"application/json":{"schema":{"type":"object","properties":{"conversation":{"type":"object","properties":{"id":{"type":"string","description":"Conversation ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"type":{"type":"string","enum":["comment_thread","dm","review"],"description":"Conversation type"},"account_id":{"type":"string","description":"Social account ID"},"participant_name":{"type":"string","nullable":true,"description":"Participant display name"},"participant_avatar":{"type":"string","nullable":true,"description":"Participant avatar URL"},"participant_metadata":{"nullable":true,"description":"Platform-specific participant data (e.g. Instagram profile)"},"status":{"type":"string","enum":["open","archived","snoozed"],"description":"Conversation status"},"assigned_user_id":{"type":"string","nullable":true,"description":"Assigned organization user ID"},"priority":{"type":"string","nullable":true,"description":"Priority level"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels"},"unread_count":{"type":"number","description":"Unread message count"},"message_count":{"type":"number","description":"Total message count"},"last_message_text":{"type":"string","nullable":true,"description":"Last message text"},"last_message_at":{"type":"string","nullable":true,"description":"Last message timestamp"},"last_message_direction":{"type":"string","nullable":true,"description":"Last message direction"},"created_at":{"type":"string","description":"Created timestamp"},"updated_at":{"type":"string","description":"Updated timestamp"}},"required":["id","platform","type","account_id","participant_name","participant_avatar","status","assigned_user_id","priority","labels","unread_count","message_count","last_message_text","last_message_at","last_message_direction","created_at","updated_at"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Message ID"},"conversation_id":{"type":"string","description":"Conversation ID"},"platform_message_id":{"type":"string","description":"Platform message ID"},"author_name":{"type":"string","nullable":true,"description":"Author name"},"author_platform_id":{"type":"string","nullable":true,"description":"Author platform ID"},"author_avatar_url":{"type":"string","nullable":true,"description":"Author avatar URL"},"text":{"type":"string","nullable":true,"description":"Message text"},"direction":{"type":"string","description":"Message direction"},"attachments":{"nullable":true,"description":"Attachments"},"sentiment_score":{"type":"number","nullable":true,"description":"Sentiment score"},"classification":{"type":"string","nullable":true,"description":"Message classification"},"platform_data":{"nullable":true,"description":"Platform-specific data"},"is_hidden":{"type":"boolean","description":"Whether message is hidden"},"is_liked":{"type":"boolean","description":"Whether message is liked"},"created_at":{"type":"string","description":"Message timestamp"}},"required":["id","conversation_id","platform_message_id","author_name","author_platform_id","author_avatar_url","text","direction","sentiment_score","classification","is_hidden","is_liked","created_at"]}}},"required":["conversation","messages"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateInboxConversation","tags":["Inbox"],"summary":"Update conversation status, labels, or priority","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","archived","snoozed"],"description":"New status"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels to set"},"priority":{"type":"string","description":"Priority level"},"assigned_user_id":{"type":"string","nullable":true,"minLength":1,"description":"Assigned organization user ID. Use null to clear the assignee."}}}}}},"responses":{"200":{"description":"Updated conversation","content":{"application/json":{"schema":{"type":"object","properties":{"conversation":{"type":"object","properties":{"id":{"type":"string","description":"Conversation ID"},"platform":{"type":"string","enum":["twitter","instagram","facebook","linkedin","tiktok","youtube","pinterest","reddit","bluesky","threads","telegram","snapchat","googlebusiness","whatsapp","mastodon","discord","sms","beehiiv","convertkit","mailchimp","listmonk"]},"type":{"type":"string","enum":["comment_thread","dm","review"],"description":"Conversation type"},"account_id":{"type":"string","description":"Social account ID"},"participant_name":{"type":"string","nullable":true,"description":"Participant display name"},"participant_avatar":{"type":"string","nullable":true,"description":"Participant avatar URL"},"participant_metadata":{"nullable":true,"description":"Platform-specific participant data (e.g. Instagram profile)"},"status":{"type":"string","enum":["open","archived","snoozed"],"description":"Conversation status"},"assigned_user_id":{"type":"string","nullable":true,"description":"Assigned organization user ID"},"priority":{"type":"string","nullable":true,"description":"Priority level"},"labels":{"type":"array","items":{"type":"string"},"description":"Labels"},"unread_count":{"type":"number","description":"Unread message count"},"message_count":{"type":"number","description":"Total message count"},"last_message_text":{"type":"string","nullable":true,"description":"Last message text"},"last_message_at":{"type":"string","nullable":true,"description":"Last message timestamp"},"last_message_direction":{"type":"string","nullable":true,"description":"Last message direction"},"created_at":{"type":"string","description":"Created timestamp"},"updated_at":{"type":"string","description":"Updated timestamp"}},"required":["id","platform","type","account_id","participant_name","participant_avatar","status","assigned_user_id","priority","labels","unread_count","message_count","last_message_text","last_message_at","last_message_direction","created_at","updated_at"]}},"required":["conversation"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}/messages":{"post":{"operationId":"sendConversationMessage","tags":["Inbox"],"summary":"Send a message in a conversation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"description":"Message text"},"account_id":{"type":"string","description":"Account ID to send from"},"attachments":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Attachment URL"},"type":{"type":"string","description":"Attachment MIME type"}},"required":["url","type"]},"description":"Attachments"},"message_tag":{"type":"string","enum":["HUMAN_AGENT","CUSTOMER_FEEDBACK"],"description":"Message tag for sending outside the 24h window (Facebook only)"},"reply_to":{"type":"string","description":"Message ID to reply to"},"quick_replies":{"type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","enum":["text","user_phone_number","user_email"],"default":"text","description":"Quick reply type"},"title":{"type":"string","maxLength":20,"description":"Button label (required for text type)"},"payload":{"type":"string","maxLength":1000,"description":"Postback payload"},"image_url":{"type":"string","format":"uri","description":"Icon URL for the button"}}},"maxItems":13,"description":"Quick reply buttons (Facebook/Instagram, max 13)"},"template":{"type":"object","properties":{"type":{"type":"string","enum":["generic","button"],"description":"Template type"},"elements":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","maxLength":80,"description":"Element title"},"subtitle":{"type":"string","maxLength":80,"description":"Element subtitle"},"image_url":{"type":"string","format":"uri","description":"Element image URL"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["web_url","postback"],"description":"Button type"},"title":{"type":"string","maxLength":20,"description":"Button label"},"url":{"type":"string","format":"uri","description":"URL for web_url buttons"},"payload":{"type":"string","maxLength":1000,"description":"Payload for postback buttons"}},"required":["type","title"]},"maxItems":3,"description":"Element buttons (max 3)"}},"required":["title"]},"maxItems":10,"description":"Template elements (max 10 for carousel)"}},"required":["type","elements"],"description":"Structured template message (Facebook/Instagram)"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Send result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"message_id":{"type":"string","description":"Message ID"},"error":{"type":"string","description":"Error message if failed"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}/typing":{"post":{"operationId":"sendConversationTyping","tags":["Inbox"],"summary":"Send a typing indicator","description":"Shows a typing indicator to the recipient. Best-effort — always returns success.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Account ID to send from"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Typing indicator sent","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"message_id":{"type":"string","description":"Message ID"},"error":{"type":"string","description":"Error message if failed"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}/messages/{message_id}/reactions":{"post":{"operationId":"addConversationReaction","tags":["Inbox"],"summary":"Add a reaction to a message","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Message ID"},"required":true,"description":"Message ID","name":"message_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Account ID to react from"},"emoji":{"type":"string","description":"Unicode emoji character"}},"required":["account_id","emoji"]}}}},"responses":{"200":{"description":"Reaction result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"message_id":{"type":"string","description":"Message ID"},"error":{"type":"string","description":"Error message if failed"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"removeConversationReaction","tags":["Inbox"],"summary":"Remove a reaction from a message","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Message ID"},"required":true,"description":"Message ID","name":"message_id","in":"path"},{"schema":{"type":"string","description":"Account ID that reacted"},"required":true,"description":"Account ID that reacted","name":"account_id","in":"query"}],"responses":{"200":{"description":"Reaction removed","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"message_id":{"type":"string","description":"Message ID"},"error":{"type":"string","description":"Error message if failed"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}/messages/{message_id}":{"delete":{"operationId":"deleteConversationMessage","tags":["Inbox"],"summary":"Delete a message","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Message ID"},"required":true,"description":"Message ID","name":"message_id","in":"path"},{"schema":{"type":"string","description":"Account ID that sent the message"},"required":true,"description":"Account ID that sent the message","name":"account_id","in":"query"}],"responses":{"200":{"description":"Delete result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the action succeeded"},"message_id":{"type":"string","description":"Message ID"},"error":{"type":"string","description":"Error message if failed"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/conversations/{id}/notes":{"get":{"operationId":"listConversationNotes","tags":["Inbox"],"summary":"List internal notes on a conversation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"responses":{"200":{"description":"List of notes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListInboxNotesResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Workspace access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createConversationNote","tags":["Inbox"],"summary":"Add an internal note to a conversation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Conversation ID"},"required":true,"description":"Conversation ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInboxNoteBody"}}}},"responses":{"201":{"description":"Created note","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxNoteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Workspace access denied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/inbox/notes/{noteId}":{"patch":{"operationId":"updateInboxNote","tags":["Inbox"],"summary":"Update an internal note","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"noteId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInboxNoteBody"}}}},"responses":{"200":{"description":"Updated note","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxNoteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Workspace access denied or forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteInboxNote","tags":["Inbox"],"summary":"Delete an internal note","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"noteId","in":"path"},{"schema":{"type":"string","description":"Acting user id (must match the note's author)"},"required":true,"description":"Acting user id (must match the note's author)","name":"user_id","in":"query"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteInboxNoteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Workspace access denied or forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Note not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/reddit/search":{"get":{"operationId":"searchReddit","tags":["Reddit"],"summary":"Search Reddit posts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Search query"},"required":true,"description":"Search query","name":"query","in":"query"},{"schema":{"type":"string","description":"Limit to subreddit"},"required":false,"description":"Limit to subreddit","name":"subreddit","in":"query"},{"schema":{"type":"string","enum":["relevance","hot","top","new","comments"],"default":"relevance","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"default":"all","description":"Time filter"},"required":false,"description":"Time filter","name":"time","in":"query"},{"schema":{"type":"string","description":"Reddit account ID"},"required":true,"description":"Reddit account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Reddit post ID"},"subreddit":{"type":"string","description":"Subreddit name"},"title":{"type":"string","description":"Post title"},"author":{"type":"string","description":"Post author"},"url":{"type":"string","description":"Post URL"},"selftext":{"type":"string","nullable":true,"description":"Self text"},"score":{"type":"number","description":"Post score"},"num_comments":{"type":"number","description":"Comment count"},"created_utc":{"type":"number","description":"Created timestamp (Unix)"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"is_self":{"type":"boolean","description":"Whether it's a self post"},"nsfw":{"type":"boolean","description":"Whether NSFW"}},"required":["id","subreddit","title","author","url","score","num_comments","created_utc","is_self","nsfw"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/reddit/feed":{"get":{"operationId":"getSubredditFeed","tags":["Reddit"],"summary":"Get subreddit feed","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Subreddit name"},"required":true,"description":"Subreddit name","name":"subreddit","in":"query"},{"schema":{"type":"string","enum":["hot","new","top","rising"],"default":"hot","description":"Sort order"},"required":false,"description":"Sort order","name":"sort","in":"query"},{"schema":{"type":"string","enum":["hour","day","week","month","year","all"],"description":"Time filter (for top sort)"},"required":false,"description":"Time filter (for top sort)","name":"time","in":"query"},{"schema":{"type":"string","description":"Reddit account ID"},"required":true,"description":"Reddit account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Subreddit feed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Reddit post ID"},"subreddit":{"type":"string","description":"Subreddit name"},"title":{"type":"string","description":"Post title"},"author":{"type":"string","description":"Post author"},"url":{"type":"string","description":"Post URL"},"selftext":{"type":"string","nullable":true,"description":"Self text"},"score":{"type":"number","description":"Post score"},"num_comments":{"type":"number","description":"Comment count"},"created_utc":{"type":"number","description":"Created timestamp (Unix)"},"thumbnail":{"type":"string","nullable":true,"description":"Thumbnail URL"},"is_self":{"type":"boolean","description":"Whether it's a self post"},"nsfw":{"type":"boolean","description":"Whether NSFW"}},"required":["id","subreddit","title","author","url","score","num_comments","created_utc","is_self","nsfw"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/bulk-send":{"post":{"operationId":"whatsappBulkSend","tags":["WhatsApp"],"summary":"Send bulk WhatsApp messages via template","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"recipients":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","description":"Phone number in E.164 format"},"variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Template variable substitutions"}},"required":["phone"]},"minItems":1,"maxItems":1000,"description":"Recipients"},"template":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body","button"],"description":"Component type"},"parameters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Component parameters"}},"required":["type"]},"description":"Template components"}},"required":["name","language"]}},"required":["account_id","recipients","template"]}}}},"responses":{"200":{"description":"Bulk send result","content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"object","properties":{"sent":{"type":"number","description":"Successfully sent count"},"failed":{"type":"number","description":"Failed count"}},"required":["sent","failed"]},"results":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","description":"Recipient phone number"},"status":{"type":"string","enum":["sent","failed"],"description":"Send status"},"error":{"type":"string","nullable":true,"description":"Error message if failed"}},"required":["phone","status"]}}},"required":["summary","results"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/broadcasts":{"get":{"operationId":"whatsappListBroadcasts","tags":["WhatsApp"],"summary":"List broadcasts","deprecated":true,"description":"Deprecated. Use GET /v1/broadcasts instead.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Broadcasts list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Broadcast ID"},"name":{"type":"string","description":"Broadcast name"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed"],"description":"Broadcast status"},"template":{"type":"string","description":"Template name"},"recipient_count":{"type":"number","description":"Total recipients"},"sent":{"type":"number","description":"Successfully sent"},"failed":{"type":"number","description":"Failed sends"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time","description":"Scheduled time"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","status","template","recipient_count","created_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"whatsappCreateBroadcast","tags":["WhatsApp"],"summary":"Create a broadcast","deprecated":true,"description":"Deprecated. Use POST /v1/broadcasts instead.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"name":{"type":"string","description":"Broadcast name"},"template":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["header","body","button"],"description":"Component type"},"parameters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Component parameters"}},"required":["type"]}}},"required":["name","language"]},"recipients":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string","description":"Phone number in E.164 format"},"variables":{"type":"object","additionalProperties":{"type":"string"},"description":"Template variable substitutions"}},"required":["phone"]},"minItems":1,"description":"Recipient list"},"scheduled_at":{"type":"string","description":"ISO 8601 timestamp to schedule send"}},"required":["account_id","name","template","recipients"]}}}},"responses":{"201":{"description":"Broadcast created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Broadcast ID"},"name":{"type":"string","description":"Broadcast name"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed"],"description":"Broadcast status"},"template":{"type":"string","description":"Template name"},"recipient_count":{"type":"number","description":"Total recipients"},"sent":{"type":"number","description":"Successfully sent"},"failed":{"type":"number","description":"Failed sends"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time","description":"Scheduled time"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","status","template","recipient_count","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/broadcasts/{broadcast_id}":{"get":{"operationId":"whatsappGetBroadcast","tags":["WhatsApp"],"summary":"Get broadcast details","deprecated":true,"description":"Deprecated. Use GET /v1/broadcasts/{id} instead.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"broadcast_id","in":"path"}],"responses":{"200":{"description":"Broadcast details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Broadcast ID"},"name":{"type":"string","description":"Broadcast name"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed"],"description":"Broadcast status"},"template":{"type":"string","description":"Template name"},"recipient_count":{"type":"number","description":"Total recipients"},"sent":{"type":"number","description":"Successfully sent"},"failed":{"type":"number","description":"Failed sends"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time","description":"Scheduled time"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","status","template","recipient_count","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"whatsappDeleteBroadcast","tags":["WhatsApp"],"summary":"Delete a broadcast","deprecated":true,"description":"Deprecated. Use DELETE /v1/broadcasts/{id} instead.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"broadcast_id","in":"path"}],"responses":{"204":{"description":"Broadcast deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/broadcasts/{broadcast_id}/send":{"post":{"operationId":"whatsappSendBroadcast","tags":["WhatsApp"],"summary":"Send a broadcast immediately","deprecated":true,"description":"Deprecated. Use POST /v1/broadcasts/{id}/send instead.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"broadcast_id","in":"path"}],"responses":{"200":{"description":"Broadcast sent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Broadcast ID"},"name":{"type":"string","description":"Broadcast name"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed"],"description":"Broadcast status"},"template":{"type":"string","description":"Template name"},"recipient_count":{"type":"number","description":"Total recipients"},"sent":{"type":"number","description":"Successfully sent"},"failed":{"type":"number","description":"Failed sends"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time","description":"Scheduled time"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","status","template","recipient_count","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/broadcasts/{broadcast_id}/schedule":{"post":{"operationId":"whatsappScheduleBroadcast","tags":["WhatsApp"],"summary":"Schedule a broadcast","deprecated":true,"description":"Deprecated. Use POST /v1/broadcasts/{id}/schedule instead.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"broadcast_id","in":"path"}],"responses":{"200":{"description":"Broadcast scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Broadcast ID"},"name":{"type":"string","description":"Broadcast name"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed"],"description":"Broadcast status"},"template":{"type":"string","description":"Template name"},"recipient_count":{"type":"number","description":"Total recipients"},"sent":{"type":"number","description":"Successfully sent"},"failed":{"type":"number","description":"Failed sends"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time","description":"Scheduled time"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","status","template","recipient_count","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/templates":{"get":{"operationId":"listWhatsAppTemplates","tags":["WhatsApp"],"summary":"List message templates","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Templates list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"status":{"type":"string","enum":["APPROVED","PENDING","REJECTED"],"description":"Approval status"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"description":"Template category"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"],"description":"Component type"},"text":{"type":"string","description":"Component text"},"format":{"type":"string","description":"Header format (TEXT, IMAGE, etc.)"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Button type"},"text":{"type":"string","description":"Button text"},"url":{"type":"string"},"phone_number":{"type":"string"}},"required":["type","text"]}}},"required":["type"]}}},"required":["name","language","status","category","components"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createWhatsAppTemplate","tags":["WhatsApp"],"summary":"Create a message template","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"description":"Template category"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"],"description":"Component type"},"text":{"type":"string","description":"Component text"},"format":{"type":"string","description":"Header format (TEXT, IMAGE, etc.)"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Button type"},"text":{"type":"string","description":"Button text"},"url":{"type":"string"},"phone_number":{"type":"string"}},"required":["type","text"]}}},"required":["type"]},"description":"Template components"}},"required":["account_id","name","language","category","components"]}}}},"responses":{"201":{"description":"Template created","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"status":{"type":"string","enum":["APPROVED","PENDING","REJECTED"],"description":"Approval status"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"description":"Template category"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"],"description":"Component type"},"text":{"type":"string","description":"Component text"},"format":{"type":"string","description":"Header format (TEXT, IMAGE, etc.)"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Button type"},"text":{"type":"string","description":"Button text"},"url":{"type":"string"},"phone_number":{"type":"string"}},"required":["type","text"]}}},"required":["type"]}}},"required":["name","language","status","category","components"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/templates/{template_name}":{"get":{"operationId":"getWhatsAppTemplate","tags":["WhatsApp"],"summary":"Get template details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Template name"},"required":true,"description":"Template name","name":"template_name","in":"path"},{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Template details","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Template name"},"language":{"type":"string","description":"Template language code"},"status":{"type":"string","enum":["APPROVED","PENDING","REJECTED"],"description":"Approval status"},"category":{"type":"string","enum":["MARKETING","UTILITY","AUTHENTICATION"],"description":"Template category"},"components":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["HEADER","BODY","FOOTER","BUTTONS"],"description":"Component type"},"text":{"type":"string","description":"Component text"},"format":{"type":"string","description":"Header format (TEXT, IMAGE, etc.)"},"buttons":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"Button type"},"text":{"type":"string","description":"Button text"},"url":{"type":"string"},"phone_number":{"type":"string"}},"required":["type","text"]}}},"required":["type"]}}},"required":["name","language","status","category","components"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteWhatsAppTemplate","tags":["WhatsApp"],"summary":"Delete a message template","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Template name"},"required":true,"description":"Template name","name":"template_name","in":"path"},{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"204":{"description":"Template deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/business-profile":{"get":{"operationId":"getWhatsAppBusinessProfile","tags":["WhatsApp"],"summary":"Get WhatsApp Business profile","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Business profile","content":{"application/json":{"schema":{"type":"object","properties":{"about":{"type":"string","nullable":true,"description":"About text"},"description":{"type":"string","nullable":true,"description":"Description"},"email":{"type":"string","nullable":true,"description":"Business email"},"websites":{"type":"array","items":{"type":"string"},"description":"Website URLs"},"address":{"type":"string","nullable":true,"description":"Business address"},"profile_picture_url":{"type":"string","nullable":true,"description":"Profile picture URL"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateWhatsAppBusinessProfile","tags":["WhatsApp"],"summary":"Update WhatsApp Business profile","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"about":{"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"websites":{"type":"array","items":{"type":"string"}},"address":{"type":"string"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Updated business profile","content":{"application/json":{"schema":{"type":"object","properties":{"about":{"type":"string","nullable":true,"description":"About text"},"description":{"type":"string","nullable":true,"description":"Description"},"email":{"type":"string","nullable":true,"description":"Business email"},"websites":{"type":"array","items":{"type":"string"},"description":"Website URLs"},"address":{"type":"string","nullable":true,"description":"Business address"},"profile_picture_url":{"type":"string","nullable":true,"description":"Profile picture URL"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/phone-numbers":{"get":{"operationId":"whatsappListProvisionedPhoneNumbers","tags":["WhatsApp Phone Provisioning"],"summary":"List purchased phone numbers","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["purchasing","pending_verification","verified","active","releasing","released"],"description":"Filter by provisioning status"},"required":false,"description":"Filter by provisioning status","name":"status","in":"query"}],"responses":{"200":{"description":"Phone numbers list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Phone number resource ID"},"phone_number":{"type":"string","description":"E.164 phone number"},"status":{"type":"string","enum":["purchasing","pending_verification","verified","active","releasing","released"],"description":"Provisioning status"},"provider":{"type":"string","description":"Carrier provider"},"country":{"type":"string","description":"ISO country code"},"wa_phone_number_id":{"type":"string","nullable":true,"description":"Meta WhatsApp phone number ID"},"social_account_id":{"type":"string","nullable":true,"description":"Linked RelayAPI social account ID"},"monthly_cost_cents":{"type":"number","description":"Monthly cost in cents"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","phone_number","status","provider","country","monthly_cost_cents","created_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/business-profile/display-name":{"get":{"operationId":"getWhatsAppDisplayName","tags":["WhatsApp"],"summary":"Get display name and review status","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Display name info","content":{"application/json":{"schema":{"type":"object","properties":{"display_name":{"type":"string","nullable":true,"description":"Current verified display name"},"review_status":{"type":"string","nullable":true,"description":"Meta review status for pending name change"}},"required":["display_name"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"updateWhatsAppDisplayName","tags":["WhatsApp"],"summary":"Request display name change (requires Meta review)","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"display_name":{"type":"string","minLength":3,"maxLength":512,"description":"New display name (3-512 chars, must represent your business)"}},"required":["account_id","display_name"]}}}},"responses":{"200":{"description":"Name change request submitted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success","message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/business-profile/photo":{"post":{"operationId":"uploadWhatsAppProfilePhoto","tags":["WhatsApp"],"summary":"Upload WhatsApp Business profile photo","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"photo_url":{"type":"string","format":"uri","description":"Public URL of the photo to upload"}},"required":["account_id","photo_url"]}}}},"responses":{"200":{"description":"Profile photo updated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"profile_picture_url":{"type":"string","nullable":true,"description":"Updated profile picture URL"}},"required":["success","profile_picture_url"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows":{"get":{"operationId":"listWhatsAppFlows","tags":["WhatsApp"],"summary":"List WhatsApp Flows","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"List of flows","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Flow ID"},"name":{"type":"string","description":"Flow name"},"status":{"type":"string","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"description":"Flow status"},"categories":{"type":"array","items":{"type":"string"},"description":"Flow categories"},"validation_errors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"error_type":{"type":"string"},"message":{"type":"string"},"line_start":{"type":"number"},"line_end":{"type":"number"},"column_start":{"type":"number"},"column_end":{"type":"number"}},"required":["error","error_type","message"]},"description":"Validation errors (DRAFT flows)"},"preview":{"type":"object","nullable":true,"properties":{"preview_url":{"type":"string"},"expires_at":{"type":"string"}},"required":["preview_url","expires_at"],"description":"Preview URL and expiry"},"json_version":{"type":"string","description":"Flow JSON version"},"data_api_version":{"type":"string","description":"Data API version"}},"required":["id","name","status","categories"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createWhatsAppFlow","tags":["WhatsApp"],"summary":"Create a WhatsApp Flow (DRAFT)","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"name":{"type":"string","description":"Flow name"},"categories":{"type":"array","items":{"type":"string","enum":["SIGN_UP","SIGN_IN","APPOINTMENT_BOOKING","LEAD_GENERATION","CONTACT_US","CUSTOMER_SUPPORT","SURVEY","OTHER"]},"minItems":1,"description":"Flow categories"},"clone_flow_id":{"type":"string","description":"Existing flow ID to clone"}},"required":["account_id","name","categories"]}}}},"responses":{"201":{"description":"Flow created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Flow ID"},"name":{"type":"string","description":"Flow name"},"status":{"type":"string","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"description":"Flow status"},"categories":{"type":"array","items":{"type":"string"},"description":"Flow categories"},"validation_errors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"error_type":{"type":"string"},"message":{"type":"string"},"line_start":{"type":"number"},"line_end":{"type":"number"},"column_start":{"type":"number"},"column_end":{"type":"number"}},"required":["error","error_type","message"]},"description":"Validation errors (DRAFT flows)"},"preview":{"type":"object","nullable":true,"properties":{"preview_url":{"type":"string"},"expires_at":{"type":"string"}},"required":["preview_url","expires_at"],"description":"Preview URL and expiry"},"json_version":{"type":"string","description":"Flow JSON version"},"data_api_version":{"type":"string","description":"Data API version"}},"required":["id","name","status","categories"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows/{flow_id}":{"get":{"operationId":"getWhatsAppFlow","tags":["WhatsApp"],"summary":"Get flow details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"},{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Flow details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Flow ID"},"name":{"type":"string","description":"Flow name"},"status":{"type":"string","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"description":"Flow status"},"categories":{"type":"array","items":{"type":"string"},"description":"Flow categories"},"validation_errors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"error_type":{"type":"string"},"message":{"type":"string"},"line_start":{"type":"number"},"line_end":{"type":"number"},"column_start":{"type":"number"},"column_end":{"type":"number"}},"required":["error","error_type","message"]},"description":"Validation errors (DRAFT flows)"},"preview":{"type":"object","nullable":true,"properties":{"preview_url":{"type":"string"},"expires_at":{"type":"string"}},"required":["preview_url","expires_at"],"description":"Preview URL and expiry"},"json_version":{"type":"string","description":"Flow JSON version"},"data_api_version":{"type":"string","description":"Data API version"}},"required":["id","name","status","categories"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateWhatsAppFlow","tags":["WhatsApp"],"summary":"Update flow metadata (DRAFT only)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"name":{"type":"string","description":"New flow name"},"categories":{"type":"array","items":{"type":"string","enum":["SIGN_UP","SIGN_IN","APPOINTMENT_BOOKING","LEAD_GENERATION","CONTACT_US","CUSTOMER_SUPPORT","SURVEY","OTHER"]},"description":"New categories"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Flow updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Flow ID"},"name":{"type":"string","description":"Flow name"},"status":{"type":"string","enum":["DRAFT","PUBLISHED","DEPRECATED","BLOCKED","THROTTLED"],"description":"Flow status"},"categories":{"type":"array","items":{"type":"string"},"description":"Flow categories"},"validation_errors":{"type":"array","items":{"type":"object","properties":{"error":{"type":"string"},"error_type":{"type":"string"},"message":{"type":"string"},"line_start":{"type":"number"},"line_end":{"type":"number"},"column_start":{"type":"number"},"column_end":{"type":"number"}},"required":["error","error_type","message"]},"description":"Validation errors (DRAFT flows)"},"preview":{"type":"object","nullable":true,"properties":{"preview_url":{"type":"string"},"expires_at":{"type":"string"}},"required":["preview_url","expires_at"],"description":"Preview URL and expiry"},"json_version":{"type":"string","description":"Flow JSON version"},"data_api_version":{"type":"string","description":"Data API version"}},"required":["id","name","status","categories"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteWhatsAppFlow","tags":["WhatsApp"],"summary":"Delete a DRAFT flow","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"},{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Flow deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows/{flow_id}/publish":{"post":{"operationId":"publishWhatsAppFlow","tags":["WhatsApp"],"summary":"Publish a flow (irreversible)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Flow published","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows/{flow_id}/deprecate":{"post":{"operationId":"deprecateWhatsAppFlow","tags":["WhatsApp"],"summary":"Deprecate a published flow (irreversible)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"}},"required":["account_id"]}}}},"responses":{"200":{"description":"Flow deprecated","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows/{flow_id}/json":{"get":{"operationId":"getWhatsAppFlowJson","tags":["WhatsApp"],"summary":"Get flow JSON asset","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"},{"schema":{"type":"string","description":"WhatsApp account ID"},"required":true,"description":"WhatsApp account ID","name":"account_id","in":"query"}],"responses":{"200":{"description":"Flow JSON asset","content":{"application/json":{"schema":{"type":"object","properties":{"download_url":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true}},"required":["download_url","expires_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"uploadWhatsAppFlowJson","tags":["WhatsApp"],"summary":"Upload flow JSON definition (DRAFT only)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"WhatsApp Flow ID"},"required":true,"description":"WhatsApp Flow ID","name":"flow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"flow_json":{"type":"object","additionalProperties":{"nullable":true},"description":"Flow JSON definition (WhatsApp Flows schema)"}},"required":["account_id","flow_json"]}}}},"responses":{"200":{"description":"Flow JSON uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"validation_errors":{"type":"array","items":{"nullable":true}}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/flows/send":{"post":{"operationId":"sendWhatsAppFlowMessage","tags":["WhatsApp"],"summary":"Send a published flow as an interactive message","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp account ID"},"recipient_phone":{"type":"string","description":"Recipient phone number in E.164 format"},"flow_id":{"type":"string","description":"Published flow ID"},"flow_token":{"type":"string","description":"Unique token for this flow session"},"header_text":{"type":"string","description":"Message header text"},"body_text":{"type":"string","description":"Message body text"},"footer_text":{"type":"string","description":"Message footer text"},"cta_text":{"type":"string","description":"CTA button text"},"screen_id":{"type":"string","description":"Initial screen ID to display"},"flow_data":{"type":"object","additionalProperties":{"nullable":true},"description":"Initial data to pass to the flow"}},"required":["account_id","recipient_phone","flow_id","flow_token","body_text","cta_text","screen_id"]}}}},"responses":{"200":{"description":"Flow message sent","content":{"application/json":{"schema":{"type":"object","properties":{"message_id":{"type":"string"}},"required":["message_id"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/phone-numbers/purchase":{"post":{"operationId":"whatsappPurchasePhoneNumber","tags":["WhatsApp Phone Provisioning"],"summary":"Purchase a US phone number","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"WhatsApp social account ID (for WABA credentials)"},"country":{"type":"string","enum":["US"],"default":"US","description":"Country code (only US supported)"},"area_code":{"type":"string","pattern":"^\\d{3}$","description":"3-digit US area code preference"}},"required":["account_id"]}}}},"responses":{"201":{"description":"Phone number purchase initiated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Phone number resource ID"},"phone_number":{"type":"string","description":"Purchased phone number"},"status":{"type":"string","description":"Current status"},"checkout_url":{"type":"string","nullable":true,"description":"Stripe checkout URL (first number only)"}},"required":["id","phone_number","status"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden — Pro plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Conflict — another number is in progress or limit reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/phone-numbers/{phone_number_id}":{"get":{"operationId":"whatsappGetProvisionedPhoneNumber","tags":["WhatsApp Phone Provisioning"],"summary":"Get phone number status","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Phone number resource ID"},"required":true,"description":"Phone number resource ID","name":"phone_number_id","in":"path"}],"responses":{"200":{"description":"Phone number details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Phone number resource ID"},"phone_number":{"type":"string","description":"E.164 phone number"},"status":{"type":"string","enum":["purchasing","pending_verification","verified","active","releasing","released"],"description":"Provisioning status"},"provider":{"type":"string","description":"Carrier provider"},"country":{"type":"string","description":"ISO country code"},"wa_phone_number_id":{"type":"string","nullable":true,"description":"Meta WhatsApp phone number ID"},"social_account_id":{"type":"string","nullable":true,"description":"Linked RelayAPI social account ID"},"monthly_cost_cents":{"type":"number","description":"Monthly cost in cents"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","phone_number","status","provider","country","monthly_cost_cents","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"whatsappReleasePhoneNumber","tags":["WhatsApp Phone Provisioning"],"summary":"Release a phone number","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Phone number resource ID"},"required":true,"description":"Phone number resource ID","name":"phone_number_id","in":"path"}],"responses":{"200":{"description":"Phone number released","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Phone number resource ID"},"phone_number":{"type":"string","description":"E.164 phone number"},"status":{"type":"string","enum":["purchasing","pending_verification","verified","active","releasing","released"],"description":"Provisioning status"},"provider":{"type":"string","description":"Carrier provider"},"country":{"type":"string","description":"ISO country code"},"wa_phone_number_id":{"type":"string","nullable":true,"description":"Meta WhatsApp phone number ID"},"social_account_id":{"type":"string","nullable":true,"description":"Linked RelayAPI social account ID"},"monthly_cost_cents":{"type":"number","description":"Monthly cost in cents"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","phone_number","status","provider","country","monthly_cost_cents","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Number cannot be released in current status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/phone-numbers/{phone_number_id}/request-code":{"post":{"operationId":"whatsappRequestVerificationCode","tags":["WhatsApp Phone Provisioning"],"summary":"Request verification code via SMS or voice","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Phone number resource ID"},"required":true,"description":"Phone number resource ID","name":"phone_number_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["sms","voice"],"description":"Verification code delivery method"}},"required":["method"]}}}},"responses":{"200":{"description":"Verification code requested","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Number not in pending_verification status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/whatsapp/phone-numbers/{phone_number_id}/verify":{"post":{"operationId":"whatsappVerifyPhoneNumber","tags":["WhatsApp Phone Provisioning"],"summary":"Submit verification code","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Phone number resource ID"},"required":true,"description":"Phone number resource ID","name":"phone_number_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":6,"maxLength":6,"pattern":"^\\d+$","description":"6-digit verification code"}},"required":["code"]}}}},"responses":{"200":{"description":"Phone number verified","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"status":{"type":"string"}},"required":["success","status"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Number not in pending_verification status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts":{"get":{"operationId":"listContacts","tags":["Contacts"],"summary":"List contacts with filtering and pagination","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Search by name, phone, or email"},"required":false,"description":"Search by name, phone, or email","name":"search","in":"query"},{"schema":{"type":"string","description":"Filter by tag"},"required":false,"description":"Filter by tag","name":"tag","in":"query"},{"schema":{"type":"string","description":"Filter by static segment membership"},"required":false,"description":"Filter by static segment membership","name":"segment_id","in":"query"},{"schema":{"type":"string","description":"Filter by platform"},"required":false,"description":"Filter by platform","name":"platform","in":"query"},{"schema":{"type":"string","description":"Filter by social account ID"},"required":false,"description":"Filter by social account ID","name":"account_id","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items"},"required":false,"description":"Number of items","name":"limit","in":"query"}],"responses":{"200":{"description":"Contacts list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Contact ID"},"name":{"type":"string","nullable":true,"description":"Contact name"},"email":{"type":"string","nullable":true,"description":"Email address"},"phone":{"type":"string","nullable":true,"description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"opted_in":{"type":"boolean","description":"Whether contact has opted in"},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]},"description":"Platform channels"},"segment_ids":{"type":"array","items":{"type":"string"},"description":"Static segment memberships"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Freeform metadata"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","opted_in","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}},"post":{"operationId":"createContact","tags":["Contacts"],"summary":"Create a contact","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","description":"Workspace ID"},"name":{"type":"string","description":"Contact name"},"email":{"type":"string","description":"Email address"},"phone":{"type":"string","description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"opted_in":{"type":"boolean","description":"Opt-in status"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Freeform metadata"},"account_id":{"type":"string","description":"Social account ID for initial channel"},"platform":{"type":"string","description":"Platform for initial channel"},"identifier":{"type":"string","description":"Platform identifier for initial channel"}},"required":["workspace_id"]}}}},"responses":{"201":{"description":"Contact created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Contact ID"},"name":{"type":"string","nullable":true,"description":"Contact name"},"email":{"type":"string","nullable":true,"description":"Email address"},"phone":{"type":"string","nullable":true,"description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"opted_in":{"type":"boolean","description":"Whether contact has opted in"},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]},"description":"Platform channels"},"segment_ids":{"type":"array","items":{"type":"string"},"description":"Static segment memberships"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Freeform metadata"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","opted_in","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}":{"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a single contact with all channels","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"responses":{"200":{"description":"Contact details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Contact ID"},"name":{"type":"string","nullable":true,"description":"Contact name"},"email":{"type":"string","nullable":true,"description":"Email address"},"phone":{"type":"string","nullable":true,"description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"opted_in":{"type":"boolean","description":"Whether contact has opted in"},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]},"description":"Platform channels"},"segment_ids":{"type":"array","items":{"type":"string"},"description":"Static segment memberships"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Freeform metadata"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","opted_in","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateContact","tags":["Contacts"],"summary":"Update a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Contact name"},"email":{"type":"string","description":"Email address"},"phone":{"type":"string","description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags (replaces existing)"},"opted_in":{"type":"boolean","description":"Opt-in status"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"description":"Freeform metadata"}}}}}},"responses":{"200":{"description":"Updated contact","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Contact ID"},"name":{"type":"string","nullable":true,"description":"Contact name"},"email":{"type":"string","nullable":true,"description":"Email address"},"phone":{"type":"string","nullable":true,"description":"Primary phone number"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"opted_in":{"type":"boolean","description":"Whether contact has opted in"},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]},"description":"Platform channels"},"segment_ids":{"type":"array","items":{"type":"string"},"description":"Static segment memberships"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Freeform metadata"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","opted_in","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteContact","tags":["Contacts"],"summary":"Delete a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"responses":{"204":{"description":"Contact deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/channels":{"get":{"operationId":"listContactChannels","tags":["Contacts"],"summary":"List channels for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"responses":{"200":{"description":"Channel list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"addContactChannel","tags":["Contacts"],"summary":"Add a channel to a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier"}},"required":["account_id","platform","identifier"]}}}},"responses":{"201":{"description":"Channel added","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Channel ID"},"social_account_id":{"type":"string","description":"Connected social account ID"},"platform":{"type":"string","description":"Platform name"},"identifier":{"type":"string","description":"Platform identifier (phone, username, ID)"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","social_account_id","platform","identifier","created_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Channel already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/channels/{channelId}":{"delete":{"operationId":"removeContactChannel","tags":["Contacts"],"summary":"Remove a channel from a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Channel ID"},"required":true,"description":"Channel ID","name":"channelId","in":"path"}],"responses":{"204":{"description":"Channel removed"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/segments":{"get":{"operationId":"listContactSegments","tags":["Contacts"],"summary":"List static segment memberships for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"responses":{"200":{"description":"Contact segment memberships","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"segment_id":{"type":"string","description":"Segment ID"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"name":{"type":"string","description":"Segment name"},"description":{"type":"string","nullable":true,"description":"Segment description"},"is_dynamic":{"type":"boolean","description":"Whether the segment is dynamically computed"},"source":{"type":"string","description":"Membership source"},"created_at":{"type":"string","format":"date-time","description":"Membership created timestamp"}},"required":["segment_id","workspace_id","name","description","is_dynamic","source","created_at"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/segments/{segmentId}":{"put":{"operationId":"addContactSegment","tags":["Contacts"],"summary":"Add a contact to a static segment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Segment ID"},"required":true,"description":"Segment ID","name":"segmentId","in":"path"}],"responses":{"200":{"description":"Membership added","content":{"application/json":{"schema":{"type":"object","properties":{"segment_id":{"type":"string","description":"Segment ID"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"name":{"type":"string","description":"Segment name"},"description":{"type":"string","nullable":true,"description":"Segment description"},"is_dynamic":{"type":"boolean","description":"Whether the segment is dynamically computed"},"source":{"type":"string","description":"Membership source"},"created_at":{"type":"string","format":"date-time","description":"Membership created timestamp"}},"required":["segment_id","workspace_id","name","description","is_dynamic","source","created_at"]}}}},"400":{"description":"Invalid segment","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"removeContactSegment","tags":["Contacts"],"summary":"Remove a contact from a static segment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Segment ID"},"required":true,"description":"Segment ID","name":"segmentId","in":"path"}],"responses":{"204":{"description":"Membership removed"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/bulk":{"post":{"operationId":"bulkCreateContacts","tags":["Contacts"],"summary":"Bulk create up to 1000 contacts","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"workspace_id":{"type":"string","description":"Workspace ID"},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"account_id":{"type":"string"},"platform":{"type":"string"},"identifier":{"type":"string"}}},"minItems":1,"maxItems":1000,"description":"Contacts to create"}},"required":["workspace_id","contacts"]}}}},"responses":{"200":{"description":"Bulk create result","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"number","description":"Successfully created count"},"skipped":{"type":"number","description":"Skipped (duplicate) count"}},"required":["created","skipped"]}}}}}}},"/v1/contacts/bulk-operations":{"post":{"operationId":"bulkContactOperations","tags":["Contacts"],"summary":"Bulk add tags, remove tags, or delete contacts","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contact_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":500,"description":"Contact IDs"},"action":{"type":"string","enum":["add_tags","remove_tags","delete"],"description":"Action"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags (for tag actions)"}},"required":["contact_ids","action"]}}}},"responses":{"200":{"description":"Bulk operation result","content":{"application/json":{"schema":{"type":"object","properties":{"affected":{"type":"number","description":"Number of contacts affected"}},"required":["affected"]}}}}}}},"/v1/contacts/{id}/merge":{"post":{"operationId":"mergeContact","tags":["Contacts"],"summary":"Merge another contact into this one","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"merge_contact_id":{"type":"string","description":"ID of the contact to merge into this one (will be deleted)"}},"required":["merge_contact_id"]}}}},"responses":{"200":{"description":"Merge result","content":{"application/json":{"schema":{"type":"object","properties":{"channels_moved":{"type":"number","description":"Number of channels moved"},"fields_moved":{"type":"number","description":"Number of custom field values moved"},"recipients_updated":{"type":"number","description":"Number of broadcast recipients updated"},"conversations_updated":{"type":"number","description":"Number of inbox conversations updated"}},"required":["channels_moved","fields_moved","recipients_updated","conversations_updated"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/fields/{slug}":{"put":{"operationId":"setContactFieldValue","tags":["Contacts"],"summary":"Set a custom field value for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Custom field slug"},"required":true,"description":"Custom field slug","name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","description":"Field value"}},"required":["value"]}}}},"responses":{"200":{"description":"Field value set","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"field":{"type":"string"},"value":{"type":"string"}},"required":["success","field","value"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"clearContactFieldValue","tags":["Contacts"],"summary":"Clear a custom field value for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Contact ID"},"required":true,"description":"Contact ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Custom field slug"},"required":true,"description":"Custom field slug","name":"slug","in":"path"}],"responses":{"204":{"description":"Field value cleared"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/custom-fields":{"post":{"operationId":"createCustomField","tags":["Custom Fields"],"summary":"Create a custom field definition","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Field name"},"type":{"type":"string","enum":["text","number","date","boolean","select"],"description":"Field type"},"slug":{"type":"string","maxLength":64,"pattern":"^[a-z0-9_]+$","description":"URL-safe identifier (auto-generated from name if omitted)"},"options":{"type":"array","items":{"type":"string"},"description":"Options for select type (required when type is select)"},"workspace_id":{"type":"string","description":"Workspace ID to scope this field to"}},"required":["name","type"]}}}},"responses":{"201":{"description":"Field created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Field definition ID"},"name":{"type":"string","description":"Field name"},"slug":{"type":"string","description":"URL-safe identifier"},"type":{"type":"string","enum":["text","number","date","boolean","select"],"description":"Field type"},"options":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Select options"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","slug","type","created_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Slug already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listCustomFields","tags":["Custom Fields"],"summary":"List custom field definitions","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"List of fields","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Field definition ID"},"name":{"type":"string","description":"Field name"},"slug":{"type":"string","description":"URL-safe identifier"},"type":{"type":"string","enum":["text","number","date","boolean","select"],"description":"Field type"},"options":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Select options"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","slug","type","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/custom-fields/{id}":{"patch":{"operationId":"updateCustomField","tags":["Custom Fields"],"summary":"Update a custom field definition","description":"Only name and options can be updated. Type and slug are immutable.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Field definition ID"},"required":true,"description":"Field definition ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255,"description":"Field name"},"options":{"type":"array","items":{"type":"string"},"description":"Options for select type"}}}}}},"responses":{"200":{"description":"Updated field","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Field definition ID"},"name":{"type":"string","description":"Field name"},"slug":{"type":"string","description":"URL-safe identifier"},"type":{"type":"string","enum":["text","number","date","boolean","select"],"description":"Field type"},"options":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Select options"},"created_at":{"type":"string","format":"date-time","description":"Created timestamp"}},"required":["id","name","slug","type","created_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteCustomField","tags":["Custom Fields"],"summary":"Delete a custom field definition","description":"Deletes the field definition and all associated values.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Field definition ID"},"required":true,"description":"Field definition ID","name":"id","in":"path"}],"responses":{"204":{"description":"Field deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/broadcasts":{"post":{"operationId":"createBroadcast","tags":["Broadcasts"],"summary":"Create a broadcast draft","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string","description":"Social account ID"},"name":{"type":"string","description":"Broadcast name"},"description":{"type":"string","description":"Broadcast description"},"message_text":{"type":"string","description":"Message text (required for non-WhatsApp platforms)"},"template":{"type":"object","properties":{"name":{"type":"string","description":"WhatsApp template name"},"language":{"type":"string","default":"en_US","description":"Template language code"},"components":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Template components"}},"required":["name"],"description":"WhatsApp template (required for WhatsApp broadcasts)"},"workspace_id":{"type":"string","description":"Workspace ID to scope this broadcast to"}},"required":["account_id"]}}}},"responses":{"201":{"description":"Broadcast created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listBroadcasts","tags":["Broadcasts"],"summary":"List broadcasts","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Filter by account ID"},"required":false,"description":"Filter by account ID","name":"account_id","in":"query"},{"schema":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"],"description":"Filter by status"},"required":false,"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Broadcasts list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/broadcasts/{id}":{"get":{"operationId":"getBroadcast","tags":["Broadcasts"],"summary":"Get broadcast details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"responses":{"200":{"description":"Broadcast details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateBroadcast","tags":["Broadcasts"],"summary":"Update a broadcast","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"message_text":{"type":"string"},"template":{"type":"object","properties":{"name":{"type":"string","description":"WhatsApp template name"},"language":{"type":"string","default":"en_US","description":"Template language code"},"components":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"Template components"}},"required":["name"]}}}}}},"responses":{"200":{"description":"Broadcast updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"400":{"description":"Invalid status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteBroadcast","tags":["Broadcasts"],"summary":"Delete a broadcast (draft or cancelled only)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"400":{"description":"Invalid status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/broadcasts/{id}/recipients":{"post":{"operationId":"addBroadcastRecipients","tags":["Broadcasts"],"summary":"Add recipients to a broadcast","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"phones":{"type":"array","items":{"type":"string"},"description":"Phone numbers in E.164 format (WhatsApp)"},"contact_ids":{"type":"array","items":{"type":"string"},"description":"Contact IDs to resolve platform identifiers from"},"identifiers":{"type":"array","items":{"type":"string"},"description":"Raw platform identifiers (IG user ID, chat ID, etc.)"}}}}}},"responses":{"200":{"description":"Recipients added","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number","description":"Number of recipients added"},"skipped":{"type":"number","description":"Number of duplicates skipped"}},"required":["added","skipped"]}}}},"400":{"description":"Invalid status or no recipients","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listBroadcastRecipients","tags":["Broadcasts"],"summary":"List broadcast recipients","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"},{"schema":{"type":"string","enum":["pending","sent","failed"],"description":"Filter by delivery status"},"required":false,"description":"Filter by delivery status","name":"status","in":"query"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"Recipients list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contact_id":{"type":"string","nullable":true},"contact_identifier":{"type":"string"},"status":{"type":"string","enum":["pending","sent","failed"]},"message_id":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"sent_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","contact_id","contact_identifier","status","message_id","error","sent_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/broadcasts/{id}/send":{"post":{"operationId":"sendBroadcast","tags":["Broadcasts"],"summary":"Trigger immediate send","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"responses":{"200":{"description":"Send result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"400":{"description":"Invalid status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/broadcasts/{id}/schedule":{"post":{"operationId":"scheduleBroadcast","tags":["Broadcasts"],"summary":"Schedule broadcast for later","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_at":{"type":"string","format":"date-time","description":"ISO 8601 datetime for when to send the broadcast"}},"required":["scheduled_at"]}}}},"responses":{"200":{"description":"Broadcast scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"400":{"description":"Invalid status or date","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/broadcasts/{id}/cancel":{"post":{"operationId":"cancelBroadcast","tags":["Broadcasts"],"summary":"Cancel a broadcast","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Broadcast ID"},"required":true,"description":"Broadcast ID","name":"id","in":"path"}],"responses":{"200":{"description":"Broadcast cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"platform":{"type":"string"},"account_id":{"type":"string"},"status":{"type":"string","enum":["draft","scheduled","sending","sent","partially_failed","failed","cancelled"]},"message_text":{"type":"string","nullable":true},"template_name":{"type":"string","nullable":true},"template_language":{"type":"string","nullable":true},"recipient_count":{"type":"integer"},"sent_count":{"type":"integer"},"failed_count":{"type":"integer"},"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","name","description","platform","account_id","status","message_text","template_name","template_language","recipient_count","sent_count","failed_count","scheduled_at","completed_at","created_at"]}}}},"400":{"description":"Invalid status","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/content-templates":{"get":{"operationId":"listContentTemplates","tags":["Content Templates"],"summary":"List content templates","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","description":"Filter by tag"},"required":false,"description":"Filter by tag","name":"tag","in":"query"}],"responses":{"200":{"description":"List of content templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Template ID"},"name":{"type":"string","description":"Template name"},"description":{"type":"string","nullable":true,"description":"Description"},"content":{"type":"string","description":"Post text content"},"platform_overrides":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Platform-specific overrides"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","description","content","platform_overrides","tags","workspace_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createContentTemplate","tags":["Content Templates"],"summary":"Create a content template","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Template name"},"description":{"type":"string","maxLength":1000,"description":"Description of when to use this template"},"content":{"type":"string","minLength":1,"maxLength":10000,"description":"Post text content (supports {{variables}})"},"platform_overrides":{"type":"object","properties":{"twitter":{"type":"string","maxLength":10000},"instagram":{"type":"string","maxLength":10000},"facebook":{"type":"string","maxLength":10000},"linkedin":{"type":"string","maxLength":10000},"tiktok":{"type":"string","maxLength":10000},"youtube":{"type":"string","maxLength":10000},"pinterest":{"type":"string","maxLength":10000},"reddit":{"type":"string","maxLength":10000},"bluesky":{"type":"string","maxLength":10000},"threads":{"type":"string","maxLength":10000},"telegram":{"type":"string","maxLength":10000},"snapchat":{"type":"string","maxLength":10000},"googlebusiness":{"type":"string","maxLength":10000},"whatsapp":{"type":"string","maxLength":10000},"mastodon":{"type":"string","maxLength":10000},"discord":{"type":"string","maxLength":10000},"sms":{"type":"string","maxLength":10000},"beehiiv":{"type":"string","maxLength":10000},"convertkit":{"type":"string","maxLength":10000},"mailchimp":{"type":"string","maxLength":10000},"listmonk":{"type":"string","maxLength":10000}},"description":"Platform-specific content overrides"},"tags":{"type":"array","items":{"type":"string","maxLength":50},"maxItems":20,"default":[],"description":"Tags for filtering"},"workspace_id":{"type":"string","description":"Workspace ID to scope this template to"}},"required":["name","content"]}}}},"responses":{"201":{"description":"Content template created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Template ID"},"name":{"type":"string","description":"Template name"},"description":{"type":"string","nullable":true,"description":"Description"},"content":{"type":"string","description":"Post text content"},"platform_overrides":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Platform-specific overrides"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","description","content","platform_overrides","tags","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/content-templates/{id}":{"get":{"operationId":"getContentTemplate","tags":["Content Templates"],"summary":"Get a content template","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Content template details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Template ID"},"name":{"type":"string","description":"Template name"},"description":{"type":"string","nullable":true,"description":"Description"},"content":{"type":"string","description":"Post text content"},"platform_overrides":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Platform-specific overrides"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","description","content","platform_overrides","tags","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateContentTemplate","tags":["Content Templates"],"summary":"Update a content template","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Template name"},"description":{"type":"string","nullable":true,"maxLength":1000,"description":"Description"},"content":{"type":"string","minLength":1,"maxLength":10000,"description":"Post text content"},"platform_overrides":{"type":"object","nullable":true,"properties":{"twitter":{"type":"string","maxLength":10000},"instagram":{"type":"string","maxLength":10000},"facebook":{"type":"string","maxLength":10000},"linkedin":{"type":"string","maxLength":10000},"tiktok":{"type":"string","maxLength":10000},"youtube":{"type":"string","maxLength":10000},"pinterest":{"type":"string","maxLength":10000},"reddit":{"type":"string","maxLength":10000},"bluesky":{"type":"string","maxLength":10000},"threads":{"type":"string","maxLength":10000},"telegram":{"type":"string","maxLength":10000},"snapchat":{"type":"string","maxLength":10000},"googlebusiness":{"type":"string","maxLength":10000},"whatsapp":{"type":"string","maxLength":10000},"mastodon":{"type":"string","maxLength":10000},"discord":{"type":"string","maxLength":10000},"sms":{"type":"string","maxLength":10000},"beehiiv":{"type":"string","maxLength":10000},"convertkit":{"type":"string","maxLength":10000},"mailchimp":{"type":"string","maxLength":10000},"listmonk":{"type":"string","maxLength":10000}},"description":"Platform-specific content overrides"},"tags":{"type":"array","items":{"type":"string","maxLength":50},"maxItems":20,"description":"Tags for filtering"}}}}}},"responses":{"200":{"description":"Content template updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Template ID"},"name":{"type":"string","description":"Template name"},"description":{"type":"string","nullable":true,"description":"Description"},"content":{"type":"string","description":"Post text content"},"platform_overrides":{"type":"object","nullable":true,"additionalProperties":{"type":"string"},"description":"Platform-specific overrides"},"tags":{"type":"array","items":{"type":"string"},"description":"Tags"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","description","content","platform_overrides","tags","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteContentTemplate","tags":["Content Templates"],"summary":"Delete a content template","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Content template deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tags":{"get":{"operationId":"listTags","tags":["Tags"],"summary":"List tags","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Items per page"},"required":false,"description":"Items per page","name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter by workspace"},"required":false,"description":"Filter by workspace","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List of tags","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createTag","tags":["Tags"],"summary":"Create a tag","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Tag name"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Hex color"},"workspace_id":{"type":"string","description":"Workspace ID to scope this tag to"}},"required":["name","color"],"description":"Create a tag"}}}},"responses":{"201":{"description":"Tag created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/tags/{id}":{"patch":{"operationId":"updateTag","tags":["Tags"],"summary":"Update a tag","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Tag name"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Hex color"}},"description":"Update a tag"}}}},"responses":{"200":{"description":"Tag updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]}}}},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteTag","tags":["Tags"],"summary":"Delete a tag","description":"Deletes a tag and removes it from all associated ideas and posts.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Tag deleted"},"404":{"description":"Tag not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/idea-groups":{"get":{"operationId":"listIdeaGroups","tags":["Idea Groups"],"summary":"List idea groups","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Filter by workspace"},"required":false,"description":"Filter by workspace","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List of idea groups","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Group ID"},"name":{"type":"string","description":"Group name"},"position":{"type":"number","description":"Position for ordering"},"color":{"type":"string","nullable":true,"description":"Hex color"},"is_default":{"type":"boolean","description":"Whether this is the default group"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","position","color","is_default","workspace_id","created_at","updated_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createIdeaGroup","tags":["Idea Groups"],"summary":"Create an idea group","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Group name"},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Hex color for column header"},"position":{"type":"number","description":"Position (float). Defaults to end."},"workspace_id":{"type":"string","description":"Workspace ID to scope this group to"}},"required":["name"],"description":"Create an idea group (kanban column)"}}}},"responses":{"201":{"description":"Idea group created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Group ID"},"name":{"type":"string","description":"Group name"},"position":{"type":"number","description":"Position for ordering"},"color":{"type":"string","nullable":true,"description":"Hex color"},"is_default":{"type":"boolean","description":"Whether this is the default group"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","position","color","is_default","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/idea-groups/{id}":{"patch":{"operationId":"updateIdeaGroup","tags":["Idea Groups"],"summary":"Update an idea group","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Group name"},"color":{"type":"string","nullable":true,"pattern":"^#[0-9a-fA-F]{6}$","description":"Hex color for column header"}},"description":"Update an idea group"}}}},"responses":{"200":{"description":"Idea group updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Group ID"},"name":{"type":"string","description":"Group name"},"position":{"type":"number","description":"Position for ordering"},"color":{"type":"string","nullable":true,"description":"Hex color"},"is_default":{"type":"boolean","description":"Whether this is the default group"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","position","color","is_default","workspace_id","created_at","updated_at"]}}}},"404":{"description":"Idea group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteIdeaGroup","tags":["Idea Groups"],"summary":"Delete an idea group","description":"Deletes an idea group and moves all ideas in that group to the default 'Unassigned' group. Cannot delete the default group.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Idea group deleted"},"400":{"description":"Cannot delete default group","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Idea group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/idea-groups/reorder":{"post":{"operationId":"reorderIdeaGroups","tags":["Idea Groups"],"summary":"Reorder idea groups","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Group ID"},"position":{"type":"number","description":"New position (float)"}},"required":["id","position"]},"minItems":1,"description":"Groups with new positions"}},"required":["groups"],"description":"Reorder idea groups"}}}},"responses":{"200":{"description":"Idea groups reordered","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Group ID"},"name":{"type":"string","description":"Group name"},"position":{"type":"number","description":"Position for ordering"},"color":{"type":"string","nullable":true,"description":"Hex color"},"is_default":{"type":"boolean","description":"Whether this is the default group"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","position","color","is_default","workspace_id","created_at","updated_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas":{"get":{"operationId":"listIdeas","tags":["Ideas"],"summary":"List ideas","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Items per page"},"required":false,"description":"Items per page","name":"limit","in":"query"},{"schema":{"type":"string","description":"Filter by idea group"},"required":false,"description":"Filter by idea group","name":"group_id","in":"query"},{"schema":{"type":"string","description":"Filter by tag"},"required":false,"description":"Filter by tag","name":"tag_id","in":"query"},{"schema":{"type":"string","description":"Filter by assigned user"},"required":false,"description":"Filter by assigned user","name":"assigned_to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace"},"required":false,"description":"Filter by workspace","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List of ideas","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createIdea","tags":["Ideas"],"summary":"Create an idea","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":500,"description":"Short title"},"content":{"type":"string","maxLength":10000,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group ID. If omitted, placed in default 'Unassigned' group."},"tag_ids":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Tag IDs to associate"},"assigned_to":{"type":"string","description":"User ID to assign this idea to"},"workspace_id":{"type":"string","description":"Workspace ID to scope this idea to"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Public URL of the uploaded media file (from POST /v1/media/upload)"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type. Inferred from the URL extension if omitted."},"alt":{"type":"string","maxLength":500,"description":"Alt text"}},"required":["url"]},"maxItems":20,"description":"Attach media by URL on create. Upload files to POST /v1/media/upload first, then pass the returned URLs here."}},"description":"Create an idea"}}}},"responses":{"201":{"description":"Idea created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}":{"get":{"operationId":"getIdea","tags":["Ideas"],"summary":"Get an idea","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Idea details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateIdea","tags":["Ideas"],"summary":"Update an idea","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","nullable":true,"maxLength":500,"description":"Short title"},"content":{"type":"string","nullable":true,"maxLength":10000,"description":"Content/copy"},"assigned_to":{"type":"string","nullable":true,"description":"User ID to assign"},"tag_ids":{"type":"array","items":{"type":"string"},"maxItems":20,"description":"Replace all tag associations"}},"description":"Update an idea"}}}},"responses":{"200":{"description":"Idea updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteIdea","tags":["Ideas"],"summary":"Delete an idea","description":"Deletes an idea. FK cascades handle media, tags, comments, and activity.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Idea deleted"},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/move":{"post":{"operationId":"moveIdea","tags":["Ideas"],"summary":"Move an idea","description":"Reposition an idea within its group or move it to a different group.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group_id":{"type":"string","description":"Target group ID. Omit to reorder within current group."},"position":{"type":"number","description":"Target position (float). Omit to place at end."},"after_idea_id":{"type":"string","description":"Place after this idea. Takes precedence over position."}},"description":"Move an idea to a different group or position"}}}},"responses":{"200":{"description":"Idea moved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/convert":{"post":{"operationId":"convertIdea","tags":["Ideas"],"summary":"Convert an idea to a post","description":"Creates a draft post pre-filled from idea content and media.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"targets":{"type":"array","items":{"type":"object","properties":{"account_id":{"type":"string","description":"Social account ID"}},"required":["account_id"]},"minItems":1,"description":"Target social accounts"},"scheduled_at":{"type":"string","description":"When to publish: ISO 8601 timestamp, \"now\", \"draft\", or \"auto\""},"timezone":{"type":"string","description":"IANA timezone for scheduling"},"content":{"type":"string","description":"Override the idea content for the post"}},"required":["targets"],"description":"Convert an idea to a post. Content and media are pre-filled from the idea."}}}},"responses":{"200":{"description":"Idea converted to post","content":{"application/json":{"schema":{"type":"object","properties":{"idea":{"type":"object","properties":{"id":{"type":"string","description":"Idea ID"},"title":{"type":"string","nullable":true,"description":"Short title"},"content":{"type":"string","nullable":true,"description":"Content/copy"},"group_id":{"type":"string","description":"Idea group (kanban column) ID"},"position":{"type":"number","description":"Position within group"},"assigned_to":{"type":"string","nullable":true,"description":"Assigned user ID"},"converted_to_post_id":{"type":"string","nullable":true,"description":"Post ID if converted (most recent)"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag ID"},"name":{"type":"string","description":"Tag name"},"color":{"type":"string","description":"Hex color"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","name","color","workspace_id","created_at"]},"description":"Associated tags"},"media":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]},"description":"Attached media"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","title","content","group_id","position","assigned_to","converted_to_post_id","tags","media","workspace_id","created_at","updated_at"]},"post_id":{"type":"string","description":"Newly created post ID"}},"required":["idea","post_id"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/media":{"post":{"operationId":"uploadIdeaMedia","tags":["Ideas"],"summary":"Upload media to an idea","description":"Multipart form upload. Max 2MB.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true,"description":"File to upload"},"alt":{"type":"string","description":"Alt text"}}}}}},"responses":{"201":{"description":"Media uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Media ID"},"url":{"type":"string","description":"Media URL"},"type":{"type":"string","enum":["image","video","gif","document"],"description":"Media type"},"alt":{"type":"string","nullable":true,"description":"Alt text"},"position":{"type":"integer","description":"Ordering position"}},"required":["id","url","type","alt","position"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/media/{media_id}":{"delete":{"operationId":"deleteIdeaMedia","tags":["Ideas"],"summary":"Delete idea media","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"media_id","in":"path"}],"responses":{"204":{"description":"Media deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/comments":{"get":{"operationId":"listIdeaComments","tags":["Ideas"],"summary":"List comments on an idea","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Items per page"},"required":false,"description":"Items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"List of comments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"author_id":{"type":"string","description":"Actor ID who authored the comment. May be an API key ID (prefix 'key_') or a user ID."},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"User ID"},"name":{"type":"string","nullable":true,"description":"Display name"},"image":{"type":"string","nullable":true,"description":"Avatar URL"}},"required":["id","name","image"],"description":"Resolved user info for the author. Null if the actor cannot be mapped to a user."},"content":{"type":"string","description":"Comment body"},"parent_id":{"type":"string","nullable":true,"description":"Parent comment ID (for replies)"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","author_id","author","content","parent_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createIdeaComment","tags":["Ideas"],"summary":"Add a comment to an idea","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":5000,"description":"Comment body"},"parent_id":{"type":"string","description":"Parent comment ID to reply to"}},"required":["content"],"description":"Add a comment to an idea"}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"author_id":{"type":"string","description":"Actor ID who authored the comment. May be an API key ID (prefix 'key_') or a user ID."},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"User ID"},"name":{"type":"string","nullable":true,"description":"Display name"},"image":{"type":"string","nullable":true,"description":"Avatar URL"}},"required":["id","name","image"],"description":"Resolved user info for the author. Null if the actor cannot be mapped to a user."},"content":{"type":"string","description":"Comment body"},"parent_id":{"type":"string","nullable":true,"description":"Parent comment ID (for replies)"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","author_id","author","content","parent_id","created_at","updated_at"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/comments/{comment_id}":{"patch":{"operationId":"updateIdeaComment","tags":["Ideas"],"summary":"Edit a comment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"comment_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","minLength":1,"maxLength":5000,"description":"Comment body"}},"required":["content"],"description":"Edit a comment"}}}},"responses":{"200":{"description":"Comment updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Comment ID"},"author_id":{"type":"string","description":"Actor ID who authored the comment. May be an API key ID (prefix 'key_') or a user ID."},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"User ID"},"name":{"type":"string","nullable":true,"description":"Display name"},"image":{"type":"string","nullable":true,"description":"Avatar URL"}},"required":["id","name","image"],"description":"Resolved user info for the author. Null if the actor cannot be mapped to a user."},"content":{"type":"string","description":"Comment body"},"parent_id":{"type":"string","nullable":true,"description":"Parent comment ID (for replies)"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","author_id","author","content","parent_id","created_at","updated_at"]}}}},"403":{"description":"Forbidden — not the comment author","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteIdeaComment","tags":["Ideas"],"summary":"Delete a comment","description":"Deletes own comment. FK cascade handles child replies.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"comment_id","in":"path"}],"responses":{"204":{"description":"Comment deleted"},"403":{"description":"Forbidden — not the comment author","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ideas/{id}/activity":{"get":{"operationId":"listIdeaActivity","tags":["Ideas"],"summary":"List activity for an idea","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Items per page"},"required":false,"description":"Items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"List of activity events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Activity ID"},"actor_id":{"type":"string","description":"User who performed the action"},"action":{"type":"string","enum":["created","moved","assigned","commented","converted","updated","media_added","media_removed","tagged","untagged"],"description":"Action type"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Action context"},"created_at":{"type":"string","format":"date-time","description":"When the action occurred"}},"required":["id","actor_id","action","metadata","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Idea not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations":{"get":{"operationId":"listAutomations","tags":["Automations"],"summary":"List automations","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"},{"schema":{"type":"string","enum":["draft","active","paused","archived"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"required":false,"name":"channel","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_from_template","in":"query"},{"schema":{"type":"string","description":"Name substring match"},"required":false,"description":"Name substring match","name":"q","in":"query"}],"responses":{"200":{"description":"Automation list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}}}},"post":{"operationId":"createAutomation","tags":["Automations"],"summary":"Create an automation (optionally expanding a template)","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"workspace_id":{"type":"string"},"template":{"type":"object","properties":{"kind":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["kind"]}},"required":["name","channel"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/catalog":{"get":{"operationId":"getAutomationCatalog","tags":["Automations"],"summary":"Return the static catalog of node kinds, entrypoints, bindings, actions, and channel capabilities","security":[{"Bearer":[]}],"responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationCatalog"}}}},"304":{"description":"Not modified"}}}},"/v1/automations/insights":{"get":{"operationId":"getAutomationInsightsAll","tags":["Automations"],"summary":"Aggregate run metrics across the org, optionally rolled up by created_from_template","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["24h","7d","30d","90d","custom"],"default":"7d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"to","in":"query"},{"schema":{"type":"string","description":"Roll up across all automations with this template kind"},"required":false,"description":"Roll up across all automations with this template kind","name":"created_from_template","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Insights","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"totals":{"type":"object","properties":{"enrolled":{"type":"number"},"completed":{"type":"number"},"exited":{"type":"number"},"failed":{"type":"number"},"active":{"type":"number"},"waiting":{"type":"number"},"avg_duration_ms":{"type":"number"}},"required":["enrolled","completed","exited","failed","active","waiting","avg_duration_ms"]},"exit_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"]}},"by_entrypoint":{"type":"array","items":{"type":"object","properties":{"entrypoint_id":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"runs":{"type":"number"},"completion_rate":{"type":"number"}},"required":["entrypoint_id","kind","runs","completion_rate"]}},"per_node":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"kind":{"type":"string"},"executions":{"type":"number"},"success_rate":{"type":"number"},"per_port":{"type":"object","additionalProperties":{"type":"number"}}},"required":["node_key","kind","executions","success_rate","per_port"]}}},"required":["period","totals","exit_reasons","by_entrypoint","per_node"]}}}}}}},"/v1/automations/{id}":{"get":{"operationId":"getAutomation","tags":["Automations"],"summary":"Get an automation with its full graph","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Automation","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAutomation","tags":["Automations"],"summary":"Update automation metadata (name, description)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAutomation","tags":["Automations"],"summary":"Delete an automation (hard delete — cascades to entrypoints and runs)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/activate":{"post":{"operationId":"activateAutomation","tags":["Automations"],"summary":"Activate an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Activated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/pause":{"post":{"operationId":"pauseAutomation","tags":["Automations"],"summary":"Pause an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Paused","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/resume":{"post":{"operationId":"resumeAutomation","tags":["Automations"],"summary":"Resume a paused automation (equivalent to activate)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resumed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/archive":{"post":{"operationId":"archiveAutomation","tags":["Automations"],"summary":"Archive an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Archived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/unarchive":{"post":{"operationId":"unarchiveAutomation","tags":["Automations"],"summary":"Unarchive an automation (returns it to paused state)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Unarchived","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"status":{"type":"string","enum":["draft","active","paused","archived"]},"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"created_from_template":{"type":"string","nullable":true},"template_config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"total_enrolled":{"type":"number"},"total_completed":{"type":"number"},"total_exited":{"type":"number"},"total_failed":{"type":"number"},"last_validated_at":{"type":"string","nullable":true},"validation_errors":{"type":"array","nullable":true,"items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"created_by":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","workspace_id","name","description","channel","status","graph","created_from_template","template_config","total_enrolled","total_completed","total_exited","total_failed","last_validated_at","validation_errors","created_by","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/graph":{"put":{"operationId":"replaceAutomationGraph","tags":["Automations"],"summary":"Replace the automation's graph","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]}},"required":["graph"]}}}},"responses":{"200":{"description":"Graph accepted (may still carry warnings)","content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"default":[]},"warnings":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"default":[]}},"required":["valid"]},"automation":{"type":"object","properties":{"status":{"type":"string","enum":["draft","active","paused","archived"]},"validation_errors":{"type":"array","nullable":true,"items":{"nullable":true},"description":"Fatal validation errors that forced the automation to pause."}},"required":["status","validation_errors"]}},"required":["graph","validation","automation"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Graph has fatal validation errors","content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"type":"object","properties":{"schema_version":{"type":"number","enum":[1]},"root_node_key":{"type":"string","nullable":true},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"kind":{"type":"string"},"title":{"type":"string"},"canvas_x":{"type":"number"},"canvas_y":{"type":"number"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"ports":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"direction":{"type":"string","enum":["input","output"]},"role":{"type":"string"},"label":{"type":"string"}},"required":["key","direction"]},"default":[]},"ui_state":{"type":"object","additionalProperties":{"nullable":true}}},"required":["key","kind"]}},"edges":{"type":"array","items":{"type":"object","properties":{"from_node":{"type":"string"},"from_port":{"type":"string"},"to_node":{"type":"string"},"to_port":{"type":"string"},"order_index":{"type":"number"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["from_node","from_port","to_node","to_port"]}}},"required":["schema_version","root_node_key","nodes","edges"]},"validation":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"default":[]},"warnings":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"port_key":{"type":"string"},"edge_index":{"type":"number"},"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"default":[]}},"required":["valid"]},"automation":{"type":"object","properties":{"status":{"type":"string","enum":["draft","active","paused","archived"]},"validation_errors":{"type":"array","nullable":true,"items":{"nullable":true},"description":"Fatal validation errors that forced the automation to pause."}},"required":["status","validation_errors"]}},"required":["graph","validation","automation"]}}}}}}},"/v1/automations/{id}/enroll":{"post":{"operationId":"enrollAutomationContact","tags":["Automations"],"summary":"Manually enroll a contact into an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string"},"entrypoint_id":{"type":"string"},"social_account_id":{"type":"string"},"context_overrides":{"type":"object","additionalProperties":{"nullable":true}}},"required":["contact_id"]}}}},"responses":{"201":{"description":"Enrolled","content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"}},"required":["run_id"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Could not enroll","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/simulate":{"post":{"operationId":"simulateAutomation","tags":["Automations"],"summary":"Dry-run the graph without any side effects","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"start_node_key":{"type":"string"},"test_context":{"type":"object","additionalProperties":{"nullable":true}},"branch_choices":{"type":"object","additionalProperties":{"type":"string"}},"execute_side_effects":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Simulation result","content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"node_kind":{"type":"string"},"entered_via_port_key":{"type":"string","nullable":true},"exited_via_port_key":{"type":"string","nullable":true},"outcome":{"type":"string","enum":["advance","wait_input","wait_delay","end","fail"]},"payload":{"nullable":true}},"required":["node_key","node_kind","entered_via_port_key","exited_via_port_key","outcome"]}},"ended_at_node":{"type":"string","nullable":true},"exit_reason":{"type":"string"}},"required":["steps","ended_at_node","exit_reason"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/insights":{"get":{"operationId":"getAutomationInsights","tags":["Automations"],"summary":"Aggregate run metrics scoped to a single automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["24h","7d","30d","90d","custom"],"default":"7d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"to","in":"query"}],"responses":{"200":{"description":"Insights","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"totals":{"type":"object","properties":{"enrolled":{"type":"number"},"completed":{"type":"number"},"exited":{"type":"number"},"failed":{"type":"number"},"active":{"type":"number"},"waiting":{"type":"number"},"avg_duration_ms":{"type":"number"}},"required":["enrolled","completed","exited","failed","active","waiting","avg_duration_ms"]},"exit_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"]}},"by_entrypoint":{"type":"array","items":{"type":"object","properties":{"entrypoint_id":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"runs":{"type":"number"},"completion_rate":{"type":"number"}},"required":["entrypoint_id","kind","runs","completion_rate"]}},"per_node":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"kind":{"type":"string"},"executions":{"type":"number"},"success_rate":{"type":"number"},"per_port":{"type":"object","additionalProperties":{"type":"number"}}},"required":["node_key","kind","executions","success_rate","per_port"]}}},"required":["period","totals","exit_reasons","by_entrypoint","per_node"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/entrypoints":{"get":{"operationId":"listAutomationEntrypoints","tags":["Automation Entrypoints"],"summary":"List entrypoints for an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Entrypoint list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string"},"status":{"type":"string"},"social_account_id":{"type":"string","nullable":true},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"filters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean"},"reentry_cooldown_min":{"type":"number"},"priority":{"type":"number"},"specificity":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","automation_id","channel","kind","status","social_account_id","config","filters","allow_reentry","reentry_cooldown_min","priority","specificity","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createAutomationEntrypoint","tags":["Automation Entrypoints"],"summary":"Create an entrypoint under an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string","enum":["dm_received","comment_created","story_reply","story_mention","live_comment","ad_click","ref_link_click","share_to_dm","follow","schedule","field_changed","tag_applied","tag_removed","conversion_event","webhook_inbound"]},"social_account_id":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"filters":{"type":"object","additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean","default":true},"reentry_cooldown_min":{"type":"number","minimum":0,"default":60},"priority":{"type":"number","default":100}},"required":["channel","kind"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string"},"status":{"type":"string"},"social_account_id":{"type":"string","nullable":true},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"filters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean"},"reentry_cooldown_min":{"type":"number"},"priority":{"type":"number"},"specificity":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"webhook_secret_plaintext":{"type":"string","description":"Plaintext HMAC secret — returned only on create/rotate for webhook_inbound entrypoints."},"scheduling":{"type":"object","properties":{"queued":{"type":"boolean"},"reason":{"type":"string"}},"required":["queued"],"description":"Result of the auto-arm attempt for schedule entrypoints: queued=true means an initial scheduled_trigger job was inserted; queued=false carries a reason code (e.g. automation_not_active, invalid_cron, no_cron)."}},"required":["id","automation_id","channel","kind","status","social_account_id","config","filters","allow_reentry","reentry_cooldown_min","priority","specificity","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automations/{id}/runs":{"get":{"operationId":"listAutomationRuns","tags":["Automation Runs"],"summary":"List runs for an automation","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"contact_id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"started_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"started_before","in":"query"}],"responses":{"200":{"description":"Runs list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"organization_id":{"type":"string"},"entrypoint_id":{"type":"string","nullable":true},"binding_id":{"type":"string","nullable":true},"contact_id":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"status":{"type":"string"},"current_node_key":{"type":"string","nullable":true},"current_port_key":{"type":"string","nullable":true},"context":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"waiting_until":{"type":"string","nullable":true},"waiting_for":{"type":"string","nullable":true},"exit_reason":{"type":"string","nullable":true},"started_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"updated_at":{"type":"string"}},"required":["id","automation_id","organization_id","entrypoint_id","binding_id","contact_id","conversation_id","status","current_node_key","current_port_key","context","waiting_until","waiting_for","exit_reason","started_at","completed_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-entrypoints/{id}":{"get":{"operationId":"getAutomationEntrypoint","tags":["Automation Entrypoints"],"summary":"Get an entrypoint by id","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Entrypoint","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string"},"status":{"type":"string"},"social_account_id":{"type":"string","nullable":true},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"filters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean"},"reentry_cooldown_min":{"type":"number"},"priority":{"type":"number"},"specificity":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","automation_id","channel","kind","status","social_account_id","config","filters","allow_reentry","reentry_cooldown_min","priority","specificity","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAutomationEntrypoint","tags":["Automation Entrypoints"],"summary":"Update an entrypoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string","enum":["dm_received","comment_created","story_reply","story_mention","live_comment","ad_click","ref_link_click","share_to_dm","follow","schedule","field_changed","tag_applied","tag_removed","conversion_event","webhook_inbound"]},"social_account_id":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"filters":{"type":"object","additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean","default":true},"reentry_cooldown_min":{"type":"number","minimum":0,"default":60},"priority":{"type":"number","default":100},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string"},"status":{"type":"string"},"social_account_id":{"type":"string","nullable":true},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"filters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean"},"reentry_cooldown_min":{"type":"number"},"priority":{"type":"number"},"specificity":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"webhook_secret_plaintext":{"type":"string","description":"Plaintext HMAC secret — returned only on create/rotate for webhook_inbound entrypoints."},"scheduling":{"type":"object","properties":{"queued":{"type":"boolean"},"reason":{"type":"string"}},"required":["queued"],"description":"Result of the auto-arm attempt for schedule entrypoints: queued=true means an initial scheduled_trigger job was inserted; queued=false carries a reason code (e.g. automation_not_active, invalid_cron, no_cron)."}},"required":["id","automation_id","channel","kind","status","social_account_id","config","filters","allow_reentry","reentry_cooldown_min","priority","specificity","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAutomationEntrypoint","tags":["Automation Entrypoints"],"summary":"Delete an entrypoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-entrypoints/{id}/rotate-secret":{"post":{"operationId":"rotateAutomationEntrypointSecret","tags":["Automation Entrypoints"],"summary":"Rotate the HMAC secret for a webhook_inbound entrypoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Rotated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"kind":{"type":"string"},"status":{"type":"string"},"social_account_id":{"type":"string","nullable":true},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"filters":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"allow_reentry":{"type":"boolean"},"reentry_cooldown_min":{"type":"number"},"priority":{"type":"number"},"specificity":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"webhook_secret_plaintext":{"type":"string","description":"Plaintext HMAC secret — returned only on create/rotate for webhook_inbound entrypoints."},"scheduling":{"type":"object","properties":{"queued":{"type":"boolean"},"reason":{"type":"string"}},"required":["queued"],"description":"Result of the auto-arm attempt for schedule entrypoints: queued=true means an initial scheduled_trigger job was inserted; queued=false carries a reason code (e.g. automation_not_active, invalid_cron, no_cron)."}},"required":["id","automation_id","channel","kind","status","social_account_id","config","filters","allow_reentry","reentry_cooldown_min","priority","specificity","created_at","updated_at"]}}}},"400":{"description":"Not a webhook entrypoint","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-entrypoints/{id}/insights":{"get":{"operationId":"getAutomationEntrypointInsights","tags":["Automation Entrypoints"],"summary":"Aggregate run metrics scoped to an entrypoint","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["24h","7d","30d","90d","custom"],"default":"7d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"to","in":"query"}],"responses":{"200":{"description":"Insights","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"totals":{"type":"object","properties":{"enrolled":{"type":"number"},"completed":{"type":"number"},"exited":{"type":"number"},"failed":{"type":"number"},"active":{"type":"number"},"waiting":{"type":"number"},"avg_duration_ms":{"type":"number"}},"required":["enrolled","completed","exited","failed","active","waiting","avg_duration_ms"]},"exit_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"]}},"by_entrypoint":{"type":"array","items":{"type":"object","properties":{"entrypoint_id":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"runs":{"type":"number"},"completion_rate":{"type":"number"}},"required":["entrypoint_id","kind","runs","completion_rate"]}},"per_node":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"kind":{"type":"string"},"executions":{"type":"number"},"success_rate":{"type":"number"},"per_port":{"type":"object","additionalProperties":{"type":"number"}}},"required":["node_key","kind","executions","success_rate","per_port"]}}},"required":["period","totals","exit_reasons","by_entrypoint","per_node"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-bindings":{"get":{"operationId":"listAutomationBindings","tags":["Automation Bindings"],"summary":"List bindings with filters","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"social_account_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"binding_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"automation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"Binding list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"sync_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["id","organization_id","workspace_id","social_account_id","channel","binding_type","automation_id","config","status","last_synced_at","sync_error","created_at","updated_at"]}}},"required":["data"]}}}}}},"post":{"operationId":"createAutomationBinding","tags":["Automation Bindings"],"summary":"Create a binding for a social account","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"workspace_id":{"type":"string"}},"required":["social_account_id","channel","binding_type","automation_id"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"sync_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["id","organization_id","workspace_id","social_account_id","channel","binding_type","automation_id","config","status","last_synced_at","sync_error","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Automation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"A binding already exists for this (social_account_id, binding_type)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-bindings/{id}":{"get":{"operationId":"getAutomationBinding","tags":["Automation Bindings"],"summary":"Get a binding","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Binding","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"sync_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["id","organization_id","workspace_id","social_account_id","channel","binding_type","automation_id","config","status","last_synced_at","sync_error","created_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAutomationBinding","tags":["Automation Bindings"],"summary":"Update a binding","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"workspace_id":{"type":"string"},"status":{"type":"string","enum":["active","paused","pending_sync","sync_failed"]}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"social_account_id":{"type":"string"},"channel":{"type":"string","enum":["instagram","facebook","whatsapp","telegram"]},"binding_type":{"type":"string","enum":["default_reply","welcome_message","conversation_starter","main_menu","ice_breaker"]},"automation_id":{"type":"string"},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"status":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"sync_error":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["id","organization_id","workspace_id","social_account_id","channel","binding_type","automation_id","config","status","last_synced_at","sync_error","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAutomationBinding","tags":["Automation Bindings"],"summary":"Delete a binding","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-bindings/{id}/insights":{"get":{"operationId":"getAutomationBindingInsights","tags":["Automation Bindings"],"summary":"Aggregate run metrics scoped to a binding","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["24h","7d","30d","90d","custom"],"default":"7d"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Required when period=custom; ISO 8601"},"required":false,"description":"Required when period=custom; ISO 8601","name":"to","in":"query"}],"responses":{"200":{"description":"Insights","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},"totals":{"type":"object","properties":{"enrolled":{"type":"number"},"completed":{"type":"number"},"exited":{"type":"number"},"failed":{"type":"number"},"active":{"type":"number"},"waiting":{"type":"number"},"avg_duration_ms":{"type":"number"}},"required":["enrolled","completed","exited","failed","active","waiting","avg_duration_ms"]},"exit_reasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"count":{"type":"number"}},"required":["reason","count"]}},"by_entrypoint":{"type":"array","items":{"type":"object","properties":{"entrypoint_id":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"runs":{"type":"number"},"completion_rate":{"type":"number"}},"required":["entrypoint_id","kind","runs","completion_rate"]}},"per_node":{"type":"array","items":{"type":"object","properties":{"node_key":{"type":"string"},"kind":{"type":"string"},"executions":{"type":"number"},"success_rate":{"type":"number"},"per_port":{"type":"object","additionalProperties":{"type":"number"}}},"required":["node_key","kind","executions","success_rate","per_port"]}}},"required":["period","totals","exit_reasons","by_entrypoint","per_node"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-runs/{id}":{"get":{"operationId":"getAutomationRun","tags":["Automation Runs"],"summary":"Get a run (includes context JSON)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Run","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"organization_id":{"type":"string"},"entrypoint_id":{"type":"string","nullable":true},"binding_id":{"type":"string","nullable":true},"contact_id":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"status":{"type":"string"},"current_node_key":{"type":"string","nullable":true},"current_port_key":{"type":"string","nullable":true},"context":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"waiting_until":{"type":"string","nullable":true},"waiting_for":{"type":"string","nullable":true},"exit_reason":{"type":"string","nullable":true},"started_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"updated_at":{"type":"string"}},"required":["id","automation_id","organization_id","entrypoint_id","binding_id","contact_id","conversation_id","status","current_node_key","current_port_key","context","waiting_until","waiting_for","exit_reason","started_at","completed_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-runs/{id}/steps":{"get":{"operationId":"listAutomationRunSteps","tags":["Automation Runs"],"summary":"List the step log for a run (oldest first)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Steps list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"run_id":{"type":"string"},"automation_id":{"type":"string"},"node_key":{"type":"string"},"node_kind":{"type":"string"},"entered_via_port_key":{"type":"string","nullable":true},"exited_via_port_key":{"type":"string","nullable":true},"outcome":{"type":"string"},"duration_ms":{"type":"number"},"payload":{"nullable":true},"error":{"nullable":true},"executed_at":{"type":"string"}},"required":["id","run_id","automation_id","node_key","node_kind","entered_via_port_key","exited_via_port_key","outcome","duration_ms","executed_at"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/automation-runs/{id}/stop":{"post":{"operationId":"stopAutomationRun","tags":["Automation Runs"],"summary":"Force-exit an active or waiting run","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stopped","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"automation_id":{"type":"string"},"organization_id":{"type":"string"},"entrypoint_id":{"type":"string","nullable":true},"binding_id":{"type":"string","nullable":true},"contact_id":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"status":{"type":"string"},"current_node_key":{"type":"string","nullable":true},"current_port_key":{"type":"string","nullable":true},"context":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"waiting_until":{"type":"string","nullable":true},"waiting_for":{"type":"string","nullable":true},"exit_reason":{"type":"string","nullable":true},"started_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"updated_at":{"type":"string"}},"required":["id","automation_id","organization_id","entrypoint_id","binding_id","contact_id","conversation_id","status","current_node_key","current_port_key","context","waiting_until","waiting_for","exit_reason","started_at","completed_at","updated_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Run is not active or waiting","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/automation-controls":{"get":{"operationId":"listContactAutomationControls","tags":["Contact Automation Controls"],"summary":"List automation pause controls for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Controls list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"contact_id":{"type":"string"},"automation_id":{"type":"string","nullable":true},"pause_reason":{"type":"string","nullable":true},"paused_until":{"type":"string","nullable":true},"paused_by_user_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","contact_id","automation_id","pause_reason","paused_until","paused_by_user_id","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Contact not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/automation-pause":{"post":{"operationId":"pauseContactAutomation","tags":["Contact Automation Controls"],"summary":"Pause automations for a contact (global or per-automation)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"automation_id":{"type":"string","description":"Omit for a global pause (blocks all automations for this contact)"},"pause_reason":{"type":"string"},"paused_until":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Paused","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"contact_id":{"type":"string"},"automation_id":{"type":"string","nullable":true},"pause_reason":{"type":"string","nullable":true},"paused_until":{"type":"string","nullable":true},"paused_by_user_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","contact_id","automation_id","pause_reason","paused_until","paused_by_user_id","created_at","updated_at"]}}}},"404":{"description":"Contact or automation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/contacts/{id}/automation-resume":{"post":{"operationId":"resumeContactAutomation","tags":["Contact Automation Controls"],"summary":"Remove a pause (global or per-automation) for a contact","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"automation_id":{"type":"string","description":"Omit to clear the global pause"}}}}}},"responses":{"204":{"description":"Resumed"},"404":{"description":"Contact not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/segments":{"post":{"operationId":"createSegment","tags":["Segments"],"summary":"Create a segment","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"workspace_id":{"type":"string"},"filter":{"type":"object","properties":{"all":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}},"any":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}},"none":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}}},"description":"e.g. { all: [{ field: 'tags', op: 'contains', value: 'vip' }] }"},"is_dynamic":{"type":"boolean","default":true}},"required":["name","filter"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filter":{"nullable":true},"is_dynamic":{"type":"boolean"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","is_dynamic","member_count","created_at","updated_at"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listSegments","tags":["Segments"],"summary":"List segments","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filter":{"nullable":true},"is_dynamic":{"type":"boolean"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","is_dynamic","member_count","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/segments/{id}":{"get":{"operationId":"getSegment","tags":["Segments"],"summary":"Get a segment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Segment","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filter":{"nullable":true},"is_dynamic":{"type":"boolean"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","is_dynamic","member_count","created_at","updated_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateSegment","tags":["Segments"],"summary":"Update a segment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"workspace_id":{"type":"string"},"filter":{"type":"object","properties":{"all":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}},"any":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}},"none":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"op":{"type":"string"},"value":{"nullable":true}},"required":["field","op"]}}},"description":"e.g. { all: [{ field: 'tags', op: 'contains', value: 'vip' }] }"},"is_dynamic":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"filter":{"nullable":true},"is_dynamic":{"type":"boolean"},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","is_dynamic","member_count","created_at","updated_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteSegment","tags":["Segments"],"summary":"Delete a segment","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ai-knowledge":{"post":{"operationId":"createKnowledgeBase","tags":["AI Knowledge"],"summary":"Create a knowledge base","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"workspace_id":{"type":"string"},"embedding_model":{"type":"string","default":"text-embedding-3-small"},"embedding_dimensions":{"type":"integer","default":1536}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"embedding_model":{"type":"string"},"embedding_dimensions":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","embedding_model","embedding_dimensions","created_at","updated_at"]}}}}}},"get":{"operationId":"listKnowledgeBases","tags":["AI Knowledge"],"summary":"List knowledge bases","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"embedding_model":{"type":"string"},"embedding_dimensions":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","embedding_model","embedding_dimensions","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/ai-knowledge/{id}":{"get":{"operationId":"getKnowledgeBase","tags":["AI Knowledge"],"summary":"Get a knowledge base","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"embedding_model":{"type":"string"},"embedding_dimensions":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","embedding_model","embedding_dimensions","created_at","updated_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateKnowledgeBase","tags":["AI Knowledge"],"summary":"Update a knowledge base","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string"},"workspace_id":{"type":"string"},"embedding_model":{"type":"string","default":"text-embedding-3-small"},"embedding_dimensions":{"type":"integer","default":1536}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"embedding_model":{"type":"string"},"embedding_dimensions":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","name","description","embedding_model","embedding_dimensions","created_at","updated_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteKnowledgeBase","tags":["AI Knowledge"],"summary":"Delete a knowledge base","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ai-knowledge/{id}/documents":{"post":{"operationId":"createKnowledgeDocument","tags":["AI Knowledge"],"summary":"Add a document to a knowledge base","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_type":{"type":"string","enum":["url","file","text"]},"source_ref":{"type":"string","description":"URL for source_type=url, media_id for file, or raw content for text"},"title":{"type":"string"}},"required":["source_type","source_ref"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"source_type":{"type":"string"},"source_ref":{"type":"string"},"title":{"type":"string","nullable":true},"status":{"type":"string"},"last_crawled_at":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","kb_id","source_type","source_ref","title","status","last_crawled_at","error","created_at","updated_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Knowledge base not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listKnowledgeDocuments","tags":["AI Knowledge"],"summary":"List documents in a knowledge base","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"List","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"source_type":{"type":"string"},"source_ref":{"type":"string"},"title":{"type":"string","nullable":true},"status":{"type":"string"},"last_crawled_at":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","kb_id","source_type","source_ref","title","status","last_crawled_at","error","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Knowledge base not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ai-knowledge/{id}/documents/{documentId}":{"delete":{"operationId":"deleteKnowledgeDocument","tags":["AI Knowledge"],"summary":"Remove a document","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ref-urls":{"post":{"operationId":"createRefUrl","tags":["Ref URLs"],"summary":"Create a reference URL","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$","description":"URL-safe slug; must be unique within the organization"},"workspace_id":{"type":"string"},"automation_id":{"type":"string","nullable":true,"description":"Automation to enroll the contact into on click"},"enabled":{"type":"boolean","default":true}},"required":["slug"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"slug":{"type":"string"},"automation_id":{"type":"string","nullable":true},"uses":{"type":"integer"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","slug","automation_id","uses","enabled","created_at"]}}}},"409":{"description":"Slug already taken","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listRefUrls","tags":["Ref URLs"],"summary":"List reference URLs","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"workspace_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"automation_id","in":"query"}],"responses":{"200":{"description":"List","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"slug":{"type":"string"},"automation_id":{"type":"string","nullable":true},"uses":{"type":"integer"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","slug","automation_id","uses","enabled","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/ref-urls/{id}":{"get":{"operationId":"getRefUrl","tags":["Ref URLs"],"summary":"Get a reference URL","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Ref URL","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"slug":{"type":"string"},"automation_id":{"type":"string","nullable":true},"uses":{"type":"integer"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","slug","automation_id","uses","enabled","created_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateRefUrl","tags":["Ref URLs"],"summary":"Update a reference URL","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"automation_id":{"type":"string","nullable":true},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"slug":{"type":"string"},"automation_id":{"type":"string","nullable":true},"uses":{"type":"integer"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","slug","automation_id","uses","enabled","created_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Slug conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteRefUrl","tags":["Ref URLs"],"summary":"Delete a reference URL","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ref-urls/{id}/click":{"post":{"operationId":"recordRefUrlClick","tags":["Ref URLs"],"summary":"Record a click on a ref URL","description":"Increments the click counter and, when a contact is supplied, fires a `ref_link_click` automation event so matching entrypoints enroll the contact.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"contact_id":{"type":"string"}},"required":["contact_id"]}}}},"responses":{"200":{"description":"Click recorded","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"string"},"workspace_id":{"type":"string","nullable":true},"slug":{"type":"string"},"automation_id":{"type":"string","nullable":true},"uses":{"type":"integer"},"enabled":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","workspace_id","slug","automation_id","uses","enabled","created_at"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links/config":{"get":{"operationId":"getShortLinkConfig","tags":["Short Links"],"summary":"Get short link configuration","security":[{"Bearer":[]}],"responses":{"200":{"description":"Short link configuration (defaults returned if not yet configured)","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Config ID (null if not configured)"},"mode":{"type":"string","enum":["always","ask","never"],"description":"URL shortening mode"},"provider":{"type":"string","nullable":true,"enum":["relayapi","dub","short_io","bitly",null],"description":"Configured provider"},"has_api_key":{"type":"boolean","description":"Whether an API key is configured"},"domain":{"type":"string","nullable":true,"description":"Custom short domain"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","mode","provider","has_api_key","domain","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"put":{"operationId":"updateShortLinkConfig","tags":["Short Links"],"summary":"Update short link configuration","description":"Create or update the organization's short link configuration. Set mode, provider, and credentials.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["always","ask","never"],"description":"When to shorten URLs in posts"},"provider":{"type":"string","enum":["relayapi","dub","short_io","bitly"],"description":"Short link provider"},"api_key":{"type":"string","description":"Provider API key (required when provider is set)"},"domain":{"type":"string","description":"Custom short domain (e.g. \"link.mybrand.com\")"}},"required":["mode"]}}}},"responses":{"200":{"description":"Configuration updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Config ID (null if not configured)"},"mode":{"type":"string","enum":["always","ask","never"],"description":"URL shortening mode"},"provider":{"type":"string","nullable":true,"enum":["relayapi","dub","short_io","bitly",null],"description":"Configured provider"},"has_api_key":{"type":"boolean","description":"Whether an API key is configured"},"domain":{"type":"string","nullable":true,"description":"Custom short domain"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","mode","provider","has_api_key","domain","created_at","updated_at"]}}}},"400":{"description":"Invalid configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links/test":{"post":{"operationId":"testShortLinkConfig","tags":["Short Links"],"summary":"Test short link configuration","description":"Test the configured provider by shortening a test URL. Returns the shortened URL on success.","security":[{"Bearer":[]}],"responses":{"200":{"description":"Test result","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the test succeeded"},"short_url":{"type":"string","nullable":true,"description":"The shortened test URL (if successful)"},"error":{"type":"string","nullable":true,"description":"Error message (if failed)"}},"required":["success","short_url","error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"No configuration found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links":{"get":{"operationId":"listShortLinks","tags":["Short Links"],"summary":"List short links","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"}],"responses":{"200":{"description":"List of short links","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Short link ID"},"original_url":{"type":"string","description":"Original URL"},"short_url":{"type":"string","description":"Shortened URL"},"post_id":{"type":"string","nullable":true,"description":"Associated post ID"},"click_count":{"type":"number","description":"Cached click count"},"created_at":{"type":"string","format":"date-time"}},"required":["id","original_url","short_url","post_id","click_count","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links/by-post/{postId}":{"get":{"operationId":"listShortLinksByPost","tags":["Short Links"],"summary":"List short links for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID"},"required":true,"description":"Post ID","name":"postId","in":"path"}],"responses":{"200":{"description":"Short links for the post","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Short link ID"},"original_url":{"type":"string","description":"Original URL"},"short_url":{"type":"string","description":"Shortened URL"},"post_id":{"type":"string","nullable":true,"description":"Associated post ID"},"click_count":{"type":"number","description":"Cached click count"},"created_at":{"type":"string","format":"date-time"}},"required":["id","original_url","short_url","post_id","click_count","created_at"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links/shorten":{"post":{"operationId":"shortenUrl","tags":["Short Links"],"summary":"Shorten a URL","description":"Manually shorten a single URL using the configured provider.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"URL to shorten"}},"required":["url"]}}}},"responses":{"200":{"description":"Shortened URL","content":{"application/json":{"schema":{"type":"object","properties":{"original_url":{"type":"string","description":"Original URL"},"short_url":{"type":"string","description":"Shortened URL"}},"required":["original_url","short_url"]}}}},"400":{"description":"Provider not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/short-links/{id}/stats":{"get":{"operationId":"getShortLinkStats","tags":["Short Links"],"summary":"Get short link click stats","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Click statistics","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Short link ID"},"short_url":{"type":"string","description":"Shortened URL"},"original_url":{"type":"string","description":"Original URL"},"click_count":{"type":"number","description":"Total click count"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time","description":"Last time click data was synced"}},"required":["id","short_url","original_url","click_count","last_synced_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Short link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/signatures/default":{"get":{"operationId":"getDefaultSignature","tags":["Signatures"],"summary":"Get the default signature","security":[{"Bearer":[]}],"responses":{"200":{"description":"Default signature","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"No default signature set","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/signatures":{"get":{"operationId":"listSignatures","tags":["Signatures"],"summary":"List signatures","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"}],"responses":{"200":{"description":"List of signatures","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createSignature","tags":["Signatures"],"summary":"Create a signature","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Signature name"},"content":{"type":"string","minLength":1,"maxLength":2000,"description":"Signature text"},"is_default":{"type":"boolean","default":false,"description":"Set as the default signature"},"position":{"type":"string","enum":["append","prepend"],"default":"append","description":"Where to inject the signature"},"workspace_id":{"type":"string","description":"Workspace ID to scope this signature to"}},"required":["name","content"]}}}},"responses":{"201":{"description":"Signature created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/signatures/{id}":{"get":{"operationId":"getSignature","tags":["Signatures"],"summary":"Get a signature","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Signature details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateSignature","tags":["Signatures"],"summary":"Update a signature","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Signature name"},"content":{"type":"string","minLength":1,"maxLength":2000,"description":"Signature text"},"is_default":{"type":"boolean","description":"Set as the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Where to inject the signature"}}}}}},"responses":{"200":{"description":"Signature updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteSignature","tags":["Signatures"],"summary":"Delete a signature","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Signature deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/signatures/{id}/set-default":{"post":{"operationId":"setDefaultSignature","tags":["Signatures"],"summary":"Set a signature as the default","description":"Sets this signature as the default. Clears isDefault on all other signatures in the organization.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Signature set as default","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Signature ID"},"name":{"type":"string","description":"Signature name"},"content":{"type":"string","description":"Signature text"},"is_default":{"type":"boolean","description":"Whether this is the default signature"},"position":{"type":"string","enum":["append","prepend"],"description":"Injection position"},"workspace_id":{"type":"string","nullable":true,"description":"Workspace ID"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","description":"Last update timestamp"}},"required":["id","name","content","is_default","position","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ads/accounts":{"get":{"operationId":"listAdAccounts","tags":["Ads"],"summary":"List ad accounts for a social account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Filter by social account ID"},"required":false,"description":"Filter by social account ID","name":"social_account_id","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","maxLength":200,"description":"Search by name or platform account ID"},"required":false,"description":"Search by name or platform account ID","name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Ad accounts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"social_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_account_id":{"type":"string"},"name":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"status":{"type":"string","nullable":true}},"required":["id","social_account_id","platform","platform_ad_account_id","name","currency","timezone","status"]}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"422":{"description":"Platform not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ads/campaigns":{"post":{"operationId":"createAdCampaign","tags":["Ads"],"summary":"Create a campaign","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ad_account_id":{"type":"string","description":"Ad account ID"},"name":{"type":"string","minLength":1,"maxLength":255},"objective":{"type":"string","enum":["awareness","traffic","engagement","leads","conversions","video_views"]},"daily_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"lifetime_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time"},"special_ad_categories":{"type":"array","items":{"type":"string"}}},"required":["ad_account_id","name","objective"]}}}},"responses":{"201":{"description":"Campaign created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_campaign_id":{"type":"string","nullable":true},"name":{"type":"string"},"objective":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"is_external":{"type":"boolean"},"ad_count":{"type":"number"},"metrics":{"type":"object","nullable":true,"properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"spend_cents":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc_cents":{"type":"number"},"cpm_cents":{"type":"number"}},"required":["impressions","reach","clicks","spend_cents","conversions","ctr","cpc_cents","cpm_cents"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_campaign_id","name","objective","status","daily_budget_cents","lifetime_budget_cents","currency","start_date","end_date","is_external","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listAdCampaigns","tags":["Ads"],"summary":"List campaigns with aggregate metrics","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"required":false,"name":"platform","in":"query"},{"schema":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"ad_account_id","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_campaign_id":{"type":"string","nullable":true},"name":{"type":"string"},"objective":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"is_external":{"type":"boolean"},"ad_count":{"type":"number"},"metrics":{"type":"object","nullable":true,"properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"spend_cents":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc_cents":{"type":"number"},"cpm_cents":{"type":"number"}},"required":["impressions","reach","clicks","spend_cents","conversions","ctr","cpc_cents","cpm_cents"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_campaign_id","name","objective","status","daily_budget_cents","lifetime_budget_cents","currency","start_date","end_date","is_external","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/ads/campaigns/{id}":{"get":{"operationId":"getAdCampaign","tags":["Ads"],"summary":"Get campaign details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_campaign_id":{"type":"string","nullable":true},"name":{"type":"string"},"objective":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"is_external":{"type":"boolean"},"ad_count":{"type":"number"},"metrics":{"type":"object","nullable":true,"properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"spend_cents":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc_cents":{"type":"number"},"cpm_cents":{"type":"number"}},"required":["impressions","reach","clicks","spend_cents","conversions","ctr","cpc_cents","cpm_cents"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_campaign_id","name","objective","status","daily_budget_cents","lifetime_budget_cents","currency","start_date","end_date","is_external","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAdCampaignStatus","tags":["Ads"],"summary":"Update campaign (pause/resume)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["active","paused"]},"daily_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"lifetime_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true}}}}}},"responses":{"200":{"description":"Campaign updated","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAdCampaign","tags":["Ads"],"summary":"Cancel/archive campaign","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/v1/ads":{"post":{"operationId":"createAd","tags":["Ads"],"summary":"Create standalone ad with custom creative","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ad_account_id":{"type":"string"},"campaign_id":{"type":"string","description":"Auto-creates campaign if omitted"},"name":{"type":"string","minLength":1,"maxLength":255},"objective":{"type":"string","enum":["awareness","traffic","engagement","leads","conversions","video_views"],"description":"Required if campaign_id is omitted"},"headline":{"type":"string","maxLength":255},"body":{"type":"string"},"call_to_action":{"type":"string"},"link_url":{"type":"string","format":"uri"},"image_url":{"type":"string","format":"uri"},"video_url":{"type":"string","format":"uri"},"targeting":{"type":"object","properties":{"age_min":{"type":"integer","minimum":13,"maximum":65},"age_max":{"type":"integer","minimum":13,"maximum":65},"genders":{"type":"array","items":{"type":"string","enum":["male","female","all"]}},"locations":{"type":"array","items":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"string"}},"radius_miles":{"type":"number"}}}},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"custom_audiences":{"type":"array","items":{"type":"string"}},"excluded_audiences":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"placements":{"type":"array","items":{"type":"string"}},"platform_specific":{"type":"object","additionalProperties":{"nullable":true}}}},"daily_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"lifetime_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"duration_days":{"type":"integer","minimum":1,"maximum":365},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time"}},"required":["ad_account_id","name"]}}}},"responses":{"201":{"description":"Ad created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_id":{"type":"string","nullable":true},"name":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"headline":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"call_to_action":{"type":"string","nullable":true},"link_url":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"boost_post_target_id":{"type":"string","nullable":true},"targeting":{"nullable":true},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"duration_days":{"type":"number","nullable":true},"is_external":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","campaign_id","ad_account_id","platform","platform_ad_id","name","status","headline","body","call_to_action","link_url","image_url","video_url","boost_post_target_id","daily_budget_cents","lifetime_budget_cents","start_date","end_date","duration_days","is_external","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listAds","tags":["Ads"],"summary":"List ads","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"campaign_id","in":"query"},{"schema":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"required":false,"name":"platform","in":"query"},{"schema":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","enum":["all","internal","external"],"default":"all"},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Ads","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_id":{"type":"string","nullable":true},"name":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"headline":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"call_to_action":{"type":"string","nullable":true},"link_url":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"boost_post_target_id":{"type":"string","nullable":true},"targeting":{"nullable":true},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"duration_days":{"type":"number","nullable":true},"is_external":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","campaign_id","ad_account_id","platform","platform_ad_id","name","status","headline","body","call_to_action","link_url","image_url","video_url","boost_post_target_id","daily_budget_cents","lifetime_budget_cents","start_date","end_date","duration_days","is_external","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/ads/boost":{"post":{"operationId":"boostPost","tags":["Ads"],"summary":"Boost an existing published post","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ad_account_id":{"type":"string"},"post_target_id":{"type":"string","description":"Published post target ID to boost"},"name":{"type":"string","maxLength":255},"objective":{"type":"string","enum":["awareness","traffic","engagement","leads","conversions","video_views"],"default":"engagement"},"targeting":{"type":"object","properties":{"age_min":{"type":"integer","minimum":13,"maximum":65},"age_max":{"type":"integer","minimum":13,"maximum":65},"genders":{"type":"array","items":{"type":"string","enum":["male","female","all"]}},"locations":{"type":"array","items":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"string"}},"radius_miles":{"type":"number"}}}},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"custom_audiences":{"type":"array","items":{"type":"string"}},"excluded_audiences":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"placements":{"type":"array","items":{"type":"string"}},"platform_specific":{"type":"object","additionalProperties":{"nullable":true}}}},"daily_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"lifetime_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"currency":{"type":"string","minLength":3,"maxLength":3,"default":"USD"},"duration_days":{"type":"integer","minimum":1,"maximum":365},"start_date":{"type":"string","format":"date-time"},"end_date":{"type":"string","format":"date-time"},"bid_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"tracking":{"type":"object","properties":{"pixel_id":{"type":"string"},"url_tags":{"type":"string"}}},"special_ad_categories":{"type":"array","items":{"type":"string"}}},"required":["ad_account_id","post_target_id","daily_budget_cents","duration_days"]}}}},"responses":{"201":{"description":"Ad created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_id":{"type":"string","nullable":true},"name":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"headline":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"call_to_action":{"type":"string","nullable":true},"link_url":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"boost_post_target_id":{"type":"string","nullable":true},"targeting":{"nullable":true},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"duration_days":{"type":"number","nullable":true},"is_external":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","campaign_id","ad_account_id","platform","platform_ad_id","name","status","headline","body","call_to_action","link_url","image_url","video_url","boost_post_target_id","daily_budget_cents","lifetime_budget_cents","start_date","end_date","duration_days","is_external","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ads/{id}":{"get":{"operationId":"getAd","tags":["Ads"],"summary":"Get ad details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Ad","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_id":{"type":"string","nullable":true},"name":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"headline":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"call_to_action":{"type":"string","nullable":true},"link_url":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"boost_post_target_id":{"type":"string","nullable":true},"targeting":{"nullable":true},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"duration_days":{"type":"number","nullable":true},"is_external":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","campaign_id","ad_account_id","platform","platform_ad_id","name","status","headline","body","call_to_action","link_url","image_url","video_url","boost_post_target_id","daily_budget_cents","lifetime_budget_cents","start_date","end_date","duration_days","is_external","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAd","tags":["Ads"],"summary":"Update ad (name, budget, targeting, pause/resume)","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"status":{"type":"string","enum":["active","paused"]},"daily_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"lifetime_budget_cents":{"type":"integer","minimum":0,"exclusiveMinimum":true},"targeting":{"type":"object","properties":{"age_min":{"type":"integer","minimum":13,"maximum":65},"age_max":{"type":"integer","minimum":13,"maximum":65},"genders":{"type":"array","items":{"type":"string","enum":["male","female","all"]}},"locations":{"type":"array","items":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"string"}},"radius_miles":{"type":"number"}}}},"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"custom_audiences":{"type":"array","items":{"type":"string"}},"excluded_audiences":{"type":"array","items":{"type":"string"}},"languages":{"type":"array","items":{"type":"string"}},"placements":{"type":"array","items":{"type":"string"}},"platform_specific":{"type":"object","additionalProperties":{"nullable":true}}}}}}}}},"responses":{"200":{"description":"Ad updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_ad_id":{"type":"string","nullable":true},"name":{"type":"string"},"status":{"type":"string","enum":["draft","pending_review","active","paused","completed","rejected","cancelled"]},"headline":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"call_to_action":{"type":"string","nullable":true},"link_url":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true},"video_url":{"type":"string","nullable":true},"boost_post_target_id":{"type":"string","nullable":true},"targeting":{"nullable":true},"daily_budget_cents":{"type":"number","nullable":true},"lifetime_budget_cents":{"type":"number","nullable":true},"start_date":{"type":"string","nullable":true,"format":"date-time"},"end_date":{"type":"string","nullable":true,"format":"date-time"},"duration_days":{"type":"number","nullable":true},"is_external":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","campaign_id","ad_account_id","platform","platform_ad_id","name","status","headline","body","call_to_action","link_url","image_url","video_url","boost_post_target_id","daily_budget_cents","lifetime_budget_cents","start_date","end_date","duration_days","is_external","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"cancelAd","tags":["Ads"],"summary":"Cancel an ad","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/v1/ads/{id}/analytics":{"get":{"operationId":"getAdAnalytics","tags":["Ads"],"summary":"Get ad analytics with daily breakdown","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"},{"schema":{"type":"string","description":"Start date YYYY-MM-DD"},"required":false,"description":"Start date YYYY-MM-DD","name":"from","in":"query"},{"schema":{"type":"string","description":"End date YYYY-MM-DD"},"required":false,"description":"End date YYYY-MM-DD","name":"to","in":"query"},{"schema":{"type":"string","description":"Comma-separated breakdown dimensions"},"required":false,"description":"Comma-separated breakdown dimensions","name":"breakdowns","in":"query"}],"responses":{"200":{"description":"Analytics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"summary":{"type":"object","properties":{"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"spend_cents":{"type":"number"},"conversions":{"type":"number"},"ctr":{"type":"number"},"cpc_cents":{"type":"number"},"cpm_cents":{"type":"number"}},"required":["impressions","reach","clicks","spend_cents","conversions","ctr","cpc_cents","cpm_cents"]},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"impressions":{"type":"number"},"reach":{"type":"number"},"clicks":{"type":"number"},"spend_cents":{"type":"number"},"conversions":{"type":"number"},"video_views":{"type":"number"},"engagement":{"type":"number"},"ctr":{"type":"number"},"cpc_cents":{"type":"number"},"cpm_cents":{"type":"number"}},"required":["date","impressions","reach","clicks","spend_cents","conversions","video_views","engagement"]}},"demographics":{"type":"object","properties":{"age_gender":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"locations":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}}}},"required":["summary","daily"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/ads/interests":{"get":{"operationId":"searchAdInterests","tags":["Ads"],"summary":"Search targeting interests","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Search query"},"required":true,"description":"Search query","name":"q","in":"query"},{"schema":{"type":"string","description":"Social account ID"},"required":true,"description":"Social account ID","name":"social_account_id","in":"query"}],"responses":{"200":{"description":"Interests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string"},"audience_size":{"type":"number"}},"required":["id","name"]}}},"required":["data"]}}}}}}},"/v1/ads/audiences":{"post":{"operationId":"createAdAudience","tags":["Ads"],"summary":"Create custom audience","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ad_account_id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":255},"type":{"type":"string","enum":["customer_list","website","lookalike"]},"description":{"type":"string"},"pixel_id":{"type":"string","description":"Required for website audiences"},"retention_days":{"type":"integer","minimum":1,"maximum":180},"rule":{"type":"object","additionalProperties":{"nullable":true}},"source_audience_id":{"type":"string","description":"Required for lookalike audiences"},"country":{"type":"string","minLength":2,"maxLength":2},"ratio":{"type":"number","minimum":0.01,"maximum":0.2},"customer_file_source":{"type":"string"}},"required":["ad_account_id","name","type"]}}}},"responses":{"201":{"description":"Audience created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_audience_id":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"string","enum":["customer_list","website","lookalike"]},"description":{"type":"string","nullable":true},"size":{"type":"number","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_audience_id","name","type","description","size","status","created_at","updated_at"]}},"required":["data"]}}}}}},"get":{"operationId":"listAdAudiences","tags":["Ads"],"summary":"List custom audiences","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ad_account_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Audiences","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_audience_id":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"string","enum":["customer_list","website","lookalike"]},"description":{"type":"string","nullable":true},"size":{"type":"number","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_audience_id","name","type","description","size","status","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}}}}},"/v1/ads/audiences/{id}":{"get":{"operationId":"getAdAudience","tags":["Ads"],"summary":"Get audience details","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Audience","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"ad_account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok","linkedin","pinterest","twitter"]},"platform_audience_id":{"type":"string","nullable":true},"name":{"type":"string"},"type":{"type":"string","enum":["customer_list","website","lookalike"]},"description":{"type":"string","nullable":true},"size":{"type":"number","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","ad_account_id","platform","platform_audience_id","name","type","description","size","status","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAdAudience","tags":["Ads"],"summary":"Delete audience","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}}}}},"/v1/ads/audiences/{id}/users":{"post":{"operationId":"addUsersToAdAudience","tags":["Ads"],"summary":"Upload hashed users to audience","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string","format":"email"},"phone":{"type":"string"}}},"minItems":1,"maxItems":10000}},"required":["users"]}}}},"responses":{"200":{"description":"Users added","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number"},"invalid":{"type":"number"},"stored":{"type":"number"}},"required":["added","invalid","stored"]}}}}}}},"/v1/ads/accounts/{id}/sync":{"post":{"operationId":"syncExternalAds","tags":["Ads"],"summary":"Trigger manual sync for an ad account","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Sync result","content":{"application/json":{"schema":{"type":"object","properties":{"ads_created":{"type":"number"},"ads_updated":{"type":"number"},"metrics_updated":{"type":"number"}},"required":["ads_created","ads_updated","metrics_updated"]}}}}}}},"/v1/auto-post-rules":{"post":{"operationId":"createAutoPostRule","tags":["Auto-Post"],"summary":"Create an auto-post rule","description":"Create a new auto-post rule to automatically post from an RSS/Atom feed.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Display name for the rule"},"feed_url":{"type":"string","format":"uri","description":"RSS/Atom feed URL"},"polling_interval_minutes":{"type":"integer","minimum":15,"maximum":1440,"default":60,"description":"How often to check the feed (minutes)"},"content_template":{"type":"string","maxLength":5000,"description":"Post template with {{title}}, {{url}}, {{description}}, {{published_date}} variables"},"append_feed_url":{"type":"boolean","default":true,"description":"Append the article URL to the post content"},"account_ids":{"type":"array","items":{"type":"string"},"default":[],"description":"Target account IDs (empty = all accounts)"},"workspace_id":{"type":"string","description":"Workspace ID to scope this rule to"}},"required":["name","feed_url"]}}}},"responses":{"201":{"description":"Rule created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}}}},"400":{"description":"Invalid feed URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"get":{"operationId":"listAutoPostRules","tags":["Auto-Post"],"summary":"List auto-post rules","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"},{"schema":{"type":"string","description":"Filter by workspace ID"},"required":false,"description":"Filter by workspace ID","name":"workspace_id","in":"query"},{"schema":{"type":"string","enum":["active","paused","error"],"description":"Filter by status"},"required":false,"description":"Filter by status","name":"status","in":"query"}],"responses":{"200":{"description":"List of rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/auto-post-rules/{id}":{"get":{"operationId":"getAutoPostRule","tags":["Auto-Post"],"summary":"Get an auto-post rule","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Rule details","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateAutoPostRule","tags":["Auto-Post"],"summary":"Update an auto-post rule","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"feed_url":{"type":"string","format":"uri"},"polling_interval_minutes":{"type":"integer","minimum":15,"maximum":1440},"content_template":{"type":"string","nullable":true,"maxLength":5000},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Rule updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}}}},"400":{"description":"Invalid feed URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAutoPostRule","tags":["Auto-Post"],"summary":"Delete an auto-post rule","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Rule deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/auto-post-rules/{id}/activate":{"post":{"operationId":"activateAutoPostRule","tags":["Auto-Post"],"summary":"Activate an auto-post rule","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Rule activated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/auto-post-rules/{id}/pause":{"post":{"operationId":"pauseAutoPostRule","tags":["Auto-Post"],"summary":"Pause an auto-post rule","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Rule paused","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"feed_url":{"type":"string"},"polling_interval_minutes":{"type":"number"},"content_template":{"type":"string","nullable":true},"append_feed_url":{"type":"boolean"},"account_ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","paused","error"]},"consecutive_errors":{"type":"number"},"last_processed_url":{"type":"string","nullable":true},"last_processed_at":{"type":"string","nullable":true},"last_error":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","feed_url","polling_interval_minutes","content_template","append_feed_url","account_ids","status","consecutive_errors","last_processed_url","last_processed_at","last_error","workspace_id","created_at","updated_at"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/auto-post-rules/test-feed":{"post":{"operationId":"testFeed","tags":["Auto-Post"],"summary":"Test-parse a feed URL","description":"Parse a feed URL and return the 5 most recent items.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"feed_url":{"type":"string","format":"uri","description":"RSS/Atom feed URL to test"},"workspace_id":{"type":"string","description":"Workspace ID (required when workspace enforcement is enabled)"}},"required":["feed_url"]}}}},"responses":{"200":{"description":"Feed items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"published_at":{"type":"string","nullable":true},"image_url":{"type":"string","nullable":true}},"required":["title","url","description","published_at","image_url"]}}},"required":["items"]}}}},"400":{"description":"Invalid feed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/posts/{post_id}/cross-post-actions":{"get":{"operationId":"listCrossPostActions","tags":["Cross-Post Actions"],"summary":"List cross-post actions for a post","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Post ID"},"required":true,"description":"Post ID","name":"post_id","in":"path"},{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"List of cross-post actions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Action ID"},"post_id":{"type":"string"},"action_type":{"type":"string","enum":["repost","comment","quote"]},"target_account_id":{"type":"string"},"content":{"type":"string","nullable":true},"delay_minutes":{"type":"number"},"status":{"type":"string","enum":["pending","executed","failed","cancelled"]},"execute_at":{"type":"string","format":"date-time"},"executed_at":{"type":"string","nullable":true,"format":"date-time"},"result_post_id":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","post_id","action_type","target_account_id","content","delay_minutes","status","execute_at","executed_at","result_post_id","error","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"404":{"description":"Post not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/cross-post-actions/{id}":{"delete":{"operationId":"cancelCrossPostAction","tags":["Cross-Post Actions"],"summary":"Cancel a pending cross-post action","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"200":{"description":"Cancelled action","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Action ID"},"post_id":{"type":"string"},"action_type":{"type":"string","enum":["repost","comment","quote"]},"target_account_id":{"type":"string"},"content":{"type":"string","nullable":true},"delay_minutes":{"type":"number"},"status":{"type":"string","enum":["pending","executed","failed","cancelled"]},"execute_at":{"type":"string","format":"date-time"},"executed_at":{"type":"string","nullable":true,"format":"date-time"},"result_post_id":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","post_id","action_type","target_account_id","content","delay_minutes","status","execute_at","executed_at","result_post_id","error","created_at"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"409":{"description":"Action is not pending","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/org-settings":{"get":{"operationId":"getOrgSettings","tags":["Organization Settings"],"summary":"Get organization settings","security":[{"Bearer":[]}],"responses":{"200":{"description":"Organization settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"require_workspace_id":{"type":"boolean","description":"When enabled, all create requests must include workspace_id. Default: false."}},"required":["require_workspace_id"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"patch":{"operationId":"updateOrgSettings","tags":["Organization Settings"],"summary":"Update organization settings","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"require_workspace_id":{"type":"boolean","description":"When enabled, all create requests must include workspace_id."}}}}}},"responses":{"200":{"description":"Settings updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"require_workspace_id":{"type":"boolean","description":"When enabled, all create requests must include workspace_id. Default: false."}},"required":["require_workspace_id"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/invite/tokens":{"get":{"operationId":"listInviteTokens","tags":["Invite Tokens"],"summary":"List invite tokens","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Pagination cursor"},"required":false,"description":"Pagination cursor","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Number of items per page"},"required":false,"description":"Number of items per page","name":"limit","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: start date (ISO 8601)"},"required":false,"description":"Filter: start date (ISO 8601)","name":"from","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Filter: end date (ISO 8601)"},"required":false,"description":"Filter: end date (ISO 8601)","name":"to","in":"query"}],"responses":{"200":{"description":"List of invite tokens","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Invite token ID"},"scope":{"type":"string","enum":["all","workspaces"],"description":"Access scope"},"workspace_ids":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scoped workspace IDs"},"role":{"type":"string","enum":["owner","admin","member"],"description":"Role assigned on acceptance"},"used":{"type":"boolean","description":"Whether the token has been used"},"expires_at":{"type":"string","format":"date-time","description":"Expiration timestamp"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","scope","workspace_ids","role","used","expires_at","created_at"]}},"next_cursor":{"type":"string","nullable":true,"description":"Cursor for next page"},"has_more":{"type":"boolean","description":"Whether more items exist"}},"required":["data","next_cursor","has_more"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}},"post":{"operationId":"createInviteToken","tags":["Invite Tokens"],"summary":"Create an invite token","description":"Create a single-use invite token with a 7-day expiry. The full token is returned only once — store it securely.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["all","workspaces"],"default":"all","description":"Access scope: 'all' for full org access, or 'workspaces' for specific workspaces"},"workspace_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50,"description":"Workspace IDs to scope access to (required when scope is 'workspaces')"},"role":{"type":"string","enum":["owner","admin","member"],"default":"member","description":"Role to assign on acceptance"}}}}}},"responses":{"201":{"description":"Invite token created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Invite token ID"},"token":{"type":"string","description":"Full invite token (shown once, store securely)"},"invite_url":{"type":"string","format":"uri","description":"Invite URL to share"},"scope":{"type":"string","enum":["all","workspaces"],"description":"Access scope"},"workspace_ids":{"type":"array","nullable":true,"items":{"type":"string"},"description":"Scoped workspace IDs"},"role":{"type":"string","enum":["owner","admin","member"],"description":"Role assigned on acceptance"},"expires_at":{"type":"string","format":"date-time","description":"Expiration timestamp"},"created_at":{"type":"string","format":"date-time","description":"Creation timestamp"}},"required":["id","token","invite_url","scope","workspace_ids","role","expires_at","created_at"]}}}},"400":{"description":"Invalid request (e.g. invalid workspace IDs)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"403":{"description":"Forbidden (role escalation)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}},"/v1/invite/tokens/{id}":{"delete":{"operationId":"deleteInviteToken","tags":["Invite Tokens"],"summary":"Revoke an invite token","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Resource ID"},"required":true,"description":"Resource ID","name":"id","in":"path"}],"responses":{"204":{"description":"Invite token revoked"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Error code"},"message":{"type":"string","description":"Error message"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]}}}}}}}}}