{"servers":[{"url":"https://viral.app/api/v1","description":"API Server"}],"info":{"title":"viral.app API","version":"1.0.0","description":"API for viral.app - Short-form video analytics platform for TikTok, Instagram, and YouTube.\n\nAuthenticate using your API key in the `x-api-key` header. Get your API key from [API Keys](/app/org/api/keys) in the viral.app dashboard.","contact":{"name":"viral.app","url":"https://viral.app","email":"support@viral.app"}},"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"API key authentication. Use your API key in the x-api-key header.\n\nTo obtain an API key:\n1. Log into viral.app\n2. Navigate to Settings > API Keys\n3. Create a new API key\n4. Use the key in the x-api-key header"}}},"security":[{"apiKeyAuth":[]}],"tags":[{"name":"Live Data","description":"Fetch live, real-time account, video, and search data across supported platforms.\n\n⚠️ Consumes extra credits per request."},{"name":"Tracked Accounts","description":"Manage and monitor tracked accounts"},{"name":"Tracked Individual Videos","description":"Manage and monitor individual tracked videos"},{"name":"Account Analytics","description":"Analytics for tracked accounts"},{"name":"Video Analytics","description":"Analytics for tracked videos"},{"name":"Viral Video Library","description":"Browse and inspect viral video library research endpoints"},{"name":"General Analytics","description":"General analytics and overview"},{"name":"Projects","description":"Project management"},{"name":"Integrations","description":"Third-party integrations"},{"name":"Creator Hub","description":"Campaign-, Creator-, and Payout-Management"}],"openapi":"3.1.1","paths":{"/live/{platform}/videos/{platformVideoId}":{"get":{"operationId":"live.getVideo","summary":"Get Video","description":"Fetches live metadata and metrics for a platform video ID.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}},{"name":"region","in":"query","schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_video_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"account_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"default":[]},"content_type":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"video_index":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"download_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_artist":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_album":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_play_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_cover_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_original_music":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"share_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookmark_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"engagement_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["platform","platform_video_id","platform_account_id","account_username","account_display_name","caption","content_type","video_index","music_id","music_title","music_artist","music_album","is_original_music","duration_seconds","view_count","like_count","comment_count","share_count","bookmark_count","engagement_rate","published_at"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/accounts/username/{username}":{"get":{"operationId":"live.getAccountByUsername","summary":"Get Account by Username","description":"Fetches live account metadata for a platform username.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"username","in":"path","required":true,"schema":{"type":"string","description":"Platform username without a leading @ prefix","examples":["acme","@acme"]}},{"name":"region","in":"query","schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"account_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_private":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"follower_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"following_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bio":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}],"default":null}},"required":["platform","platform_account_id","account_username","account_display_name"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/accounts/{platformAccountId}":{"get":{"operationId":"live.getAccount","summary":"Get Account by Account ID","description":"Fetches live account metadata for a platform account ID.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformAccountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]}},{"name":"region","in":"query","schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"account_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_private":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"follower_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"following_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bio":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}],"default":null}},"required":["platform","platform_account_id","account_username","account_display_name"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/accounts/{platformAccountId}/videos":{"get":{"operationId":"live.listAccountVideos","summary":"List Account Videos","description":"Fetches paginated live videos for a platform account.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformAccountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]}},{"name":"pageToken","in":"query","schema":{"anyOf":[{"type":"string","minLength":1,"description":"Opaque cursor token used to fetch the next page","examples":["v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9","CAEQAA"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"region","in":"query","schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_video_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"account_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"default":[]},"content_type":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"video_index":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"download_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_artist":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_album":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_play_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_cover_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_original_music":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"share_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookmark_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"engagement_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["platform","platform_video_id","platform_account_id","account_username","account_display_name","caption","content_type","video_index","music_id","music_title","music_artist","music_album","is_original_music","duration_seconds","view_count","like_count","comment_count","share_count","bookmark_count","engagement_rate","published_at"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["videos","nextPageToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/videos/{platformVideoId}/comments":{"get":{"operationId":"live.listVideoComments","summary":"List Video Comments","description":"Fetches paginated live comments for a platform video.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"const":"tiktok"}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}},{"name":"pageToken","in":"query","schema":{"anyOf":[{"type":"string","minLength":1,"description":"Opaque cursor token used to fetch the next page","examples":["v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9","CAEQAA"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"region","in":"query","schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"comments":{"type":"array","items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_comment_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform_video_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"commenter_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"commenter_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"commenter_avatar_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"commenter_country_code":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}],"default":null},"comment_text":{"anyOf":[{"type":"string"},{"type":"null"}]},"comment_language":{"anyOf":[{"type":"string"},{"type":"null"}]},"comment_length":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reply_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment_type":{"enum":["top_level","reply","reply_to_reply"],"type":"string"},"commented_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"share_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]}},"required":["platform","platform_comment_id","platform_video_id","commenter_username","commenter_display_name","comment_text","comment_language","comment_length","like_count","reply_count","comment_type","commented_at"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["comments","nextPageToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/search/users":{"get":{"operationId":"live.searchUsers","summary":"Search Users","description":"Searches live platform users.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","tiktok","instagram","youtube"],"type":"string"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Search query string","examples":["nike","ugc creator","#marketing"]},"allowEmptyValue":true,"allowReserved":true},{"name":"pageToken","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"description":"Opaque cursor token used to fetch the next page","examples":["v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9","CAEQAA"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":10,"description":"Language code for localized search results (BCP 47 style)","examples":["en","en-US","de"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"is_private":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"follower_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"video_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bio":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["platform","platform_account_id","username","display_name","is_verified","is_private","follower_count","video_count","bio"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["users","nextPageToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/search/videos":{"get":{"operationId":"live.searchVideos","summary":"Search Videos","description":"Searches live platform videos.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"anyOf":[{"const":"tiktok"},{"const":"instagram"},{"const":"youtube"}]}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Search query string","examples":["nike","ugc creator","#marketing"]},"allowEmptyValue":true,"allowReserved":true},{"name":"pageToken","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"description":"Opaque cursor token used to fetch the next page","examples":["v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9","CAEQAA"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":10,"description":"Language code for localized search results (BCP 47 style)","examples":["en","en-US","de"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortBy","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"enum":["relevance","date","likes"],"type":"string"},{"type":"null"}]},{"not":{}}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","required":false,"schema":{"anyOf":[{"anyOf":[{"enum":["yesterday","this-week","this-month","last-3-months","last-6-months","all-time"],"type":"string"},{"type":"null"}]},{"not":{}},{"anyOf":[{"enum":["hour","today","week","month","year"],"type":"string"},{"type":"null"}]}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_video_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"platform_account_id":{"anyOf":[{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},{"type":"null"}]},"account_username":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_display_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"account_profile_picture_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"default":[]},"content_type":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"video_index":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"thumbnail_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"download_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_title":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_artist":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_album":{"anyOf":[{"type":"string"},{"type":"null"}]},"music_play_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"music_cover_url":{"anyOf":[{"description":"URL","examples":["https://www.myproject.com"]},{"type":"null"}]},"is_original_music":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"view_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"like_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"comment_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"share_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookmark_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"engagement_rate":{"anyOf":[{"type":"number"},{"type":"null"}]},"published_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["platform","platform_video_id","platform_account_id","account_username","account_display_name","caption","content_type","video_index","music_id","music_title","music_artist","music_album","is_original_music","duration_seconds","view_count","like_count","comment_count","share_count","bookmark_count","engagement_rate","published_at"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["videos","nextPageToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/live/{platform}/search/hashtags":{"get":{"operationId":"live.searchHashtags","summary":"Search Hashtags","description":"Searches live platform hashtags.\n\nConsumes 1 extra credit.\n\nHeaders:\n- X-Viral-Credits-Consumed\n- X-Viral-Credits-Meter\n- X-Viral-Credits-Benefited-Remaining\n- X-Viral-Credits-Can-Purchase-Extra\n- Retry-After (on 429 responses)","tags":["Live Data"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"anyOf":[{"const":"tiktok","description":"Platform for hashtag search (TikTok only for this input variant; YouTube is not supported).","examples":["tiktok"]},{"const":"instagram","description":"Platform for hashtag search (Instagram only for this input variant; YouTube is not supported).","examples":["instagram"]}]}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Search query string","examples":["nike","ugc creator","#marketing"]},"allowEmptyValue":true,"allowReserved":true},{"name":"pageToken","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"description":"Opaque cursor token used to fetch the next page","examples":["v2:eyJvZmZzZXQiOjIwLCJsaW1pdCI6MjB9","CAEQAA"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"region","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":10,"description":"Language code for localized search results (BCP 47 style)","examples":["en","en-US","de"]},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hashtags":{"type":"array","items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_hashtag_id":{"anyOf":[{"type":"string"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"use_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["platform","platform_hashtag_id","name","use_count","description"]}},"nextPageToken":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hashtags","nextPageToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RESTRICTED"},"status":{"const":403},"message":{"type":"string","default":"Content is restricted"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{"type":"object","properties":{"retryAfterMs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"providerStatus":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0}}}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UPSTREAM_ERROR"},"status":{"const":502},"message":{"type":"string","default":"Upstream provider error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/tracking/status":{"get":{"operationId":"tracking.getTrackedRuns","summary":"List recent tracked runs","description":"Returns recent user-triggered sync runs including current status, timestamps, and grouping metadata. Useful for polling task execution progress.","tags":["Tracked Accounts","Tracked Individual Videos"],"parameters":[{"name":"days","in":"query","schema":{"type":"number","minimum":1,"maximum":30},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"number","minimum":1,"maximum":100},"allowEmptyValue":true,"allowReserved":true},{"name":"groupId","in":"query","schema":{"anyOf":[{"type":"string"},{"type":"null"}]},"allowEmptyValue":true,"allowReserved":true},{"name":"eventIds","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["Queued","Running","Completed","Failed","Cancelled","Skipped"],"type":"string"}},{"type":"null"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"anyOf":[{"type":"string"},{"type":"null"}]},"groupId":{"anyOf":[{"type":"string"},{"type":"null"}]},"runId":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["Queued","Running","Completed","Failed","Cancelled","Skipped"],"type":"string"},"platform":{"anyOf":[{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},{"type":"null"}]},"dataType":{"enum":["accounts","videos","unknown"],"type":"string"},"identifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"syncContext":{"anyOf":[{"enum":["scheduled","probe","onboarding","user_add","user_refresh"],"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"runStartedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"endedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["id","eventId","groupId","runId","status","platform","dataType","identifier","syncContext","createdAt","runStartedAt","endedAt","updatedAt"]}},"lastUpdatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["runs","lastUpdatedAt"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/excluded":{"get":{"operationId":"tracking.excludedVideos.list","summary":"List excluded videos","description":"Retrieves paginated excluded videos scoped to the active organization.","tags":["Video Analytics"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgAccountId":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"platformVideoId":{"type":"string"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}]},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","image","firstName","lastName","role"]},{"type":"null"}]}},"required":["id","orgAccountId","platform","platformAccountId","platformVideoId","createdAt","updatedAt","actorType","userId","orgId","username","accountDisplayName","caption","thumbnailUrl","contentType","user"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated excluded videos response"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"post":{"operationId":"tracking.excludedVideos.add","summary":"Add excluded videos","description":"Adds videos to the exclusion list so they are hidden from analytics tables.","tags":["Video Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"type":"array","minItems":1,"items":{"type":"object","properties":{"orgAccountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string"},"platformVideoId":{"type":"string"}},"required":["orgAccountId","platform","platformAccountId","platformVideoId"]}}},"required":["entries"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"inserted":{"type":"number"},"skipped":{"type":"number"}},"required":["inserted","skipped"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"delete":{"operationId":"tracking.excludedVideos.delete","summary":"Remove excluded videos","description":"Removes videos from the exclusion list and restores them to analytics.","tags":["Video Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^orgexcv_.*","description":"Excluded video ID with orgexcv_ prefix"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/top-videos":{"get":{"operationId":"analytics.topVideos","summary":"Get top performing videos by metrics","description":"Retrieves top performing videos ranked by specified metrics. Supports both lifetime totals (viewCount, likeCount) and period-specific gains (viewCountInPeriod, likeCountInPeriod). Filter by platforms, accounts, projects, and publication date. Set onlyPublished=true to include only videos published within the date range.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":5,"description":"Maximum number of results to return (1-100)","examples":[5,10,25,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"onlyPublished","in":"query","required":false,"schema":{"type":"boolean","default":false,"description":"Whether to only include content published within the date range","examples":[false,true]},"allowEmptyValue":true,"allowReserved":true},{"name":"metric","in":"query","required":false,"schema":{"enum":["viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","engagementRateInPeriod"],"type":"string","default":"viewCount","description":"Metric to sort videos by. Supports both lifetime totals and period-specific gains","examples":["viewCount","likeCount","viewCountInPeriod","engagementRateInPeriod"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platformVideoId":{"type":"string"},"platform":{"type":"string"},"accountUsername":{"type":"string"},"platformAccountId":{"type":"string"},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountProfilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"type":"array","items":{"type":"string"}},"contentType":{"type":"string"},"videoIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicArtist":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicAlbum":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicPlayUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicCoverUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isOriginalMusic":{"anyOf":[{"type":"integer","minimum":-32768,"maximum":32767},{"type":"null"}]},"durationSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"viewCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"likeCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"commentCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shareCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookmarkCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"engagementRate":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}]},"viralityFactor":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}]},"publishedDate":{"type":"string"},"publishedAt":{"type":"string"},"loadAt":{"type":"string"},"orgAccountId":{"anyOf":[{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},{"type":"null"}]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]},"tracking_status":{"anyOf":[{"const":0},{"const":1}],"description":"Tracking status indicator: 1 for actively tracked entries, 0 for retained historic data"},"viewCountInPeriod":{"type":"number","description":"Total views gained during the specified date range"},"likeCountInPeriod":{"type":"number","description":"Total likes gained during the specified date range"},"commentCountInPeriod":{"type":"number","description":"Total comments gained during the specified date range"},"shareCountInPeriod":{"type":"number","description":"Total shares gained during the specified date range"},"bookmarkCountInPeriod":{"type":"number","description":"Total bookmarks gained during the specified date range"},"engagementRateInPeriod":{"type":"number","description":"Engagement rate calculated from period gains (likes+comments+shares+bookmarks)/views"}},"required":["id","platformVideoId","platform","accountUsername","platformAccountId","accountDisplayName","accountProfilePictureUrl","caption","hashtags","contentType","videoIndex","thumbnailUrl","musicId","musicTitle","musicArtist","musicAlbum","musicPlayUrl","musicCoverUrl","isOriginalMusic","durationSeconds","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","viralityFactor","publishedDate","publishedAt","loadAt","orgAccountId","isCompetitor","tracking_status","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","engagementRateInPeriod"]},"description":"Array of top performing videos with both lifetime totals and period-specific metrics","examples":[[{"id":"orgvid_91rBGUI9L6Db","platformVideoId":"76891234567890012345678","platform":"tiktok","accountUsername":"influencer_account","platformAccountId":"tiktok_user_123456","accountDisplayName":"Influencer Account","accountProfilePictureUrl":"https://example.com/profile.jpg","caption":"Amazing content that went viral! #trending #viral","hashtags":["trending","viral","content"],"contentType":"video","videoIndex":1,"thumbnailUrl":"https://example.com/thumbnail.jpg","musicId":"music_123","musicTitle":"Trending Song","musicArtist":"Popular Artist","musicAlbum":"Latest Album","musicPlayUrl":"https://example.com/music.mp3","musicCoverUrl":"https://example.com/music-cover.jpg","isOriginalMusic":0,"durationSeconds":30,"viewCount":1250000,"likeCount":89500,"commentCount":2340,"shareCount":1890,"bookmarkCount":4567,"engagementRate":0.0789,"viralityFactor":2.34,"publishedDate":"2025-12-15","publishedAt":"2025-12-15T10:30:00Z","loadAt":"2025-12-20T08:00:00Z","orgAccountId":"orgacc_W97M6KLWV4Yq","tracking_status":1,"viewCountInPeriod":850000,"likeCountInPeriod":60000,"commentCountInPeriod":1500,"shareCountInPeriod":1200,"bookmarkCountInPeriod":3000,"engagementRateInPeriod":0.0762}]]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/top-accounts":{"get":{"operationId":"analytics.topAccounts","summary":"Get top performing accounts by metrics","description":"Retrieves top performing accounts ranked by specified metrics. Includes lifetime totals (viewCount, engagementRate) and period-specific gains (viewCountInPeriod, videoCountInPeriod). Returns account analytics including follower counts, posting frequency, and performance averages. Filter by platforms, accounts, projects, and content types.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":5,"description":"Maximum number of results to return (1-100)","examples":[5,10,25,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"onlyPublished","in":"query","required":false,"schema":{"type":"boolean","default":false,"description":"Whether to only include content published within the date range","examples":[false,true]},"allowEmptyValue":true,"allowReserved":true},{"name":"metric","in":"query","required":false,"schema":{"enum":["viewCount","likeCount","commentCount","shareCount","bookmarkCount","videoCount","engagementRate","averageViewsPerVideo","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","videoCountInPeriod","engagementRateInPeriod","averageViewsPerVideoInPeriod"],"type":"string","default":"viewCount","description":"Metric to sort accounts by. Supports both lifetime totals and period-specific gains","examples":["viewCount","engagementRate","viewCountInPeriod","videoCountInPeriod"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Account username/handle on the platform"},"loadAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp when account data was last loaded"},"followerCount":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Number of followers for this account"},"followingCount":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Number of accounts this account is following"},"profilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to the account's profile picture"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name of the account"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country code where the account is based"},"viewCount":{"type":"number","description":"Total lifetime views across all videos"},"likeCount":{"type":"number","description":"Total lifetime likes across all videos"},"commentCount":{"type":"number","description":"Total lifetime comments across all videos"},"shareCount":{"type":"number","description":"Total lifetime shares across all videos"},"bookmarkCount":{"type":"number","description":"Total lifetime bookmarks across all videos"},"videoCount":{"type":"number","description":"Total number of videos published by this account"},"averageViewsPerVideo":{"type":"number","description":"Average views per video across all content"},"engagementRate":{"type":"number","description":"Overall engagement rate (likes+comments+shares+bookmarks)/views"},"viralityRate":{"type":"number","description":"Rate of viral content based on performance thresholds"},"latestVideoPublishedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp of when the latest video was published"},"daysSinceLastPost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Number of days since the last video was published"},"user":{"type":"object","properties":{"id":{"type":"string","description":"Internal user record ID"},"platform":{"type":"string","description":"Platform identifier"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Username for tracking purposes"},"maxVideos":{"type":"number","description":"Maximum number of videos to track for this account"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"orgId":{"type":"string","pattern":"^org_.*","description":"Organization ID with org_ prefix"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was created"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was last updated"}},"required":["id","platform","username","maxVideos","userId","orgId","createdAt","updatedAt"],"description":"Internal tracking metadata for this account"},"viewCountInPeriod":{"type":"number","description":"Total views gained during the specified date range"},"likeCountInPeriod":{"type":"number","description":"Total likes gained during the specified date range"},"commentCountInPeriod":{"type":"number","description":"Total comments gained during the specified date range"},"shareCountInPeriod":{"type":"number","description":"Total shares gained during the specified date range"},"bookmarkCountInPeriod":{"type":"number","description":"Total bookmarks gained during the specified date range"},"videoCountInPeriod":{"type":"number","description":"Number of videos published during the specified date range"},"averageViewsPerVideoInPeriod":{"type":"number","description":"Average views per video for content published in the period"},"engagementRateInPeriod":{"type":"number","description":"Engagement rate calculated from period gains (likes+comments+shares+bookmarks)/views"}},"required":["id","platform","platformAccountId","isCompetitor","username","loadAt","followerCount","followingCount","profilePictureUrl","displayName","countryCode","viewCount","likeCount","commentCount","shareCount","bookmarkCount","videoCount","averageViewsPerVideo","engagementRate","viralityRate","latestVideoPublishedAt","daysSinceLastPost","user","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","videoCountInPeriod","averageViewsPerVideoInPeriod","engagementRateInPeriod"],"description":"Account performance data with both lifetime totals and period-specific metrics"},"description":"Array of top performing tracked accounts with comprehensive analytics","examples":[[{"id":"orgacc_W97M6KLWV4Yq","platform":"tiktok","username":"viral_creator","loadAt":"2025-12-20T08:00:00Z","followerCount":2500000,"followingCount":150,"profilePictureUrl":"https://example.com/profile.jpg","displayName":"Viral Creator","countryCode":"US","viewCount":45000000,"likeCount":3200000,"commentCount":180000,"shareCount":95000,"bookmarkCount":250000,"videoCount":120,"averageViewsPerVideo":375000,"engagementRate":0.0811,"viralityRate":0.25,"latestVideoPublishedAt":"2025-12-18T15:30:00Z","daysSinceLastPost":2,"user":{"id":"track_91rBGUI9L6Db","platform":"tiktok","username":"viral_creator","maxVideos":100,"userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z"},"viewCountInPeriod":12500000,"likeCountInPeriod":890000,"commentCountInPeriod":48000,"shareCountInPeriod":25000,"bookmarkCountInPeriod":67000,"videoCountInPeriod":15,"averageViewsPerVideoInPeriod":833333,"engagementRateInPeriod":0.0824}]]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/top-creators":{"get":{"operationId":"analytics.topCreators","summary":"Get top performing creators by aggregated metrics","description":"Retrieves top performing creators ranked by specified metrics aggregated across all their linked accounts. Includes lifetime totals (viewCount, engagementRate) and period-specific gains (viewCountInPeriod, videoCountInPeriod). Returns creator details, user information, and all linked accounts. Metrics are summed across all accounts for comprehensive creator performance analysis. Filter by platforms, accounts, projects, and content types.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":5,"description":"Maximum number of results to return (1-100)","examples":[5,10,25,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"onlyPublished","in":"query","required":false,"schema":{"type":"boolean","default":false,"description":"Whether to only include content published within the date range","examples":[false,true]},"allowEmptyValue":true,"allowReserved":true},{"name":"metric","in":"query","required":false,"schema":{"enum":["viewCount","likeCount","commentCount","shareCount","bookmarkCount","videoCount","engagementRate","averageViewsPerVideo","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","videoCountInPeriod","engagementRateInPeriod","averageViewsPerVideoInPeriod"],"type":"string","default":"viewCount","description":"Metric to sort creators by. Supports both lifetime totals and period-specific gains. Aggregates across all linked accounts.","examples":["viewCount","engagementRate","viewCountInPeriod","videoCountInPeriod"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID"},"creatorUserId":{"type":"string","pattern":"^user_.*","description":"The user ID of the creator"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Internal notes about this creator"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this creator was added to the organization"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this creator record was last updated"},"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_.*","description":"User ID"},"name":{"type":"string","description":"Creator's full name"},"email":{"type":"string","description":"Creator's email address"},"image":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Creator's profile picture URL"},"firstName":{"type":"string","description":"Creator's first name"},"lastName":{"type":"string","description":"Creator's last name"}},"required":["id","name","email","image","firstName","lastName"],"description":"Creator user details"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account identifier","examples":["7123456789012345678","z1234567890"]},"isCompetitor":{"type":"boolean","description":"Whether this account is marked as a competitor","examples":[true,false]},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Account username/handle on the platform"},"maxVideos":{"type":"number","description":"Maximum number of videos to track for this account"}},"required":["id","platform","platformAccountId","isCompetitor","username","maxVideos"]},"description":"All accounts linked to this creator"},"viewCount":{"type":"number","description":"Total lifetime views across all creator's accounts"},"likeCount":{"type":"number","description":"Total lifetime likes across all creator's accounts"},"commentCount":{"type":"number","description":"Total lifetime comments across all creator's accounts"},"shareCount":{"type":"number","description":"Total lifetime shares across all creator's accounts"},"bookmarkCount":{"type":"number","description":"Total lifetime bookmarks across all creator's accounts"},"videoCount":{"type":"number","description":"Total number of videos across all creator's accounts"},"averageViewsPerVideo":{"type":"number","description":"Average views per video across all creator's content"},"engagementRate":{"type":"number","description":"Overall engagement rate (likes+comments+shares+bookmarks)/views across all accounts"},"followerCount":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total followers aggregated across all creator's linked accounts"},"viralityRate":{"type":"number","description":"Rate of viral content based on performance thresholds (aggregated)"},"viewCountInPeriod":{"type":"number","description":"Total views gained during the specified date range across all accounts"},"likeCountInPeriod":{"type":"number","description":"Total likes gained during the specified date range across all accounts"},"commentCountInPeriod":{"type":"number","description":"Total comments gained during the specified date range across all accounts"},"shareCountInPeriod":{"type":"number","description":"Total shares gained during the specified date range across all accounts"},"bookmarkCountInPeriod":{"type":"number","description":"Total bookmarks gained during the specified date range across all accounts"},"videoCountInPeriod":{"type":"number","description":"Number of videos published during the specified date range across all accounts"},"averageViewsPerVideoInPeriod":{"type":"number","description":"Average views per video for content published in the period across all accounts"},"engagementRateInPeriod":{"type":"number","description":"Engagement rate calculated from period gains (likes+comments+shares+bookmarks)/views across all accounts"}},"required":["id","creatorUserId","notes","createdAt","updatedAt","user","accounts","viewCount","likeCount","commentCount","shareCount","bookmarkCount","videoCount","averageViewsPerVideo","engagementRate","followerCount","viralityRate","viewCountInPeriod","likeCountInPeriod","commentCountInPeriod","shareCountInPeriod","bookmarkCountInPeriod","videoCountInPeriod","averageViewsPerVideoInPeriod","engagementRateInPeriod"],"description":"Creator performance data aggregated across all their linked accounts, with both lifetime totals and period-specific metrics"},"description":"Array of top performing creators with comprehensive analytics aggregated from all their accounts","examples":[[{"id":"orgcre_ABC123XYZ456","creatorUserId":"user_PxyfnFj5JUx5","notes":"Top tier influencer, responds quickly","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","user":{"id":"user_PxyfnFj5JUx5","name":"Sarah Johnson","email":"sarah@example.com","image":"https://example.com/sarah-avatar.jpg","firstName":"Sarah","lastName":"Johnson"},"accounts":[{"id":"orgacc_W97M6KLWV4Yq","platform":"tiktok","platformAccountId":"7123456789012345678","username":"sarahjfitness","maxVideos":100},{"id":"orgacc_X98N7LMXW5Zr","platform":"instagram","platformAccountId":"8234567890123456789","username":"sarahjfitness","maxVideos":100}],"viewCount":78000000,"likeCount":5600000,"commentCount":320000,"shareCount":165000,"bookmarkCount":420000,"videoCount":215,"averageViewsPerVideo":362790,"engagementRate":0.0833,"followerCount":3200000,"viralityRate":0.22,"viewCountInPeriod":18500000,"likeCountInPeriod":1340000,"commentCountInPeriod":72000,"shareCountInPeriod":38000,"bookmarkCountInPeriod":95000,"videoCountInPeriod":22,"averageViewsPerVideoInPeriod":840909,"engagementRateInPeriod":0.0835}]]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/kpis":{"get":{"operationId":"analytics.getKpis","summary":"Get key performance indicators with period comparison","description":"Retrieves key performance indicators for the specified date range with automatic comparison to the previous period of equal length. Returns content metrics (video/account counts), engagement metrics (views, likes, comments, shares, bookmarks), app performance (revenue, installs), and absolute changes between periods. Filter by platforms, accounts, content types, or projects.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videoCount":{"type":"number","description":"Total number of videos tracked in the period"},"accountCount":{"type":"number","description":"Total number of accounts tracked"},"viewCount":{"type":"number","description":"Total video views across all content"},"likeCount":{"type":"number","description":"Total likes received across all videos"},"commentCount":{"type":"number","description":"Total comments received across all videos"},"shareCount":{"type":"number","description":"Total shares across all videos"},"bookmarkCount":{"type":"number","description":"Total bookmarks/saves across all videos"},"engagementRate":{"type":"number","description":"Overall engagement rate calculated as (likes+comments+shares+bookmarks)/views"},"appRevenue":{"type":"number","description":"Revenue generated from mobile app downloads and in-app purchases (USD)"},"newAppInstalls":{"type":"number","description":"Number of new mobile app installations"},"previous":{"type":"object","properties":{"videoCount":{"type":"number","description":"Total number of videos tracked in the period"},"accountCount":{"type":"number","description":"Total number of accounts tracked"},"viewCount":{"type":"number","description":"Total video views across all content"},"likeCount":{"type":"number","description":"Total likes received across all videos"},"commentCount":{"type":"number","description":"Total comments received across all videos"},"shareCount":{"type":"number","description":"Total shares across all videos"},"bookmarkCount":{"type":"number","description":"Total bookmarks/saves across all videos"},"engagementRate":{"type":"number","description":"Overall engagement rate calculated as (likes+comments+shares+bookmarks)/views"},"appRevenue":{"type":"number","description":"Revenue generated from mobile app downloads and in-app purchases (USD)"},"newAppInstalls":{"type":"number","description":"Number of new mobile app installations"}},"required":["videoCount","accountCount","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","appRevenue","newAppInstalls"],"description":"KPI values from the previous period for comparison"},"changes":{"type":"object","properties":{"videoCount":{"type":"number","description":"Total number of videos tracked in the period"},"accountCount":{"type":"number","description":"Total number of accounts tracked"},"viewCount":{"type":"number","description":"Total video views across all content"},"likeCount":{"type":"number","description":"Total likes received across all videos"},"commentCount":{"type":"number","description":"Total comments received across all videos"},"shareCount":{"type":"number","description":"Total shares across all videos"},"bookmarkCount":{"type":"number","description":"Total bookmarks/saves across all videos"},"engagementRate":{"type":"number","description":"Overall engagement rate calculated as (likes+comments+shares+bookmarks)/views"},"appRevenue":{"type":"number","description":"Revenue generated from mobile app downloads and in-app purchases (USD)"},"newAppInstalls":{"type":"number","description":"Number of new mobile app installations"}},"required":["videoCount","accountCount","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","appRevenue","newAppInstalls"],"description":"Absolute change values between current and previous period (current - previous)"}},"required":["videoCount","accountCount","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","appRevenue","newAppInstalls","previous","changes"],"description":"KPI comparison data with current period, previous period, and absolute changes","examples":[{"videoCount":245,"accountCount":18,"viewCount":15420000,"likeCount":1280000,"commentCount":95000,"shareCount":78000,"bookmarkCount":156000,"engagementRate":0.1076,"appRevenue":24680.5,"newAppInstalls":3420,"previous":{"videoCount":198,"accountCount":16,"viewCount":12100000,"likeCount":985000,"commentCount":72000,"shareCount":58000,"bookmarkCount":118000,"engagementRate":0.1018,"appRevenue":18950.25,"newAppInstalls":2680},"changes":{"videoCount":47,"accountCount":2,"viewCount":3320000,"likeCount":295000,"commentCount":23000,"shareCount":20000,"bookmarkCount":38000,"engagementRate":0.0058,"appRevenue":5730.25,"newAppInstalls":740}}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/interaction-metrics":{"get":{"operationId":"analytics.getInteractionMetrics","summary":"[DEPRECATED] Get overview metrics history","description":"Use `/analytics/metrics` instead.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date in ISO format (YYYY-MM-DD)"},"views":{"type":"number","description":"Total video views gained on this date"},"likes":{"type":"number","description":"Total likes received on this date"},"comments":{"type":"number","description":"Total comments received on this date"},"shares":{"type":"number","description":"Total shares gained on this date"},"bookmarks":{"type":"number","description":"Total bookmarks/saves gained on this date"},"postedVideos":{"type":"number","description":"Number of videos published on this date within the selected filters"},"appRevenue":{"type":"number","description":"Revenue generated from mobile app on this date (USD)"},"newAppInstalls":{"type":"number","description":"Number of new mobile app installations on this date"}},"required":["date","views","likes","comments","shares","bookmarks","postedVideos","appRevenue","newAppInstalls"],"description":"Daily interaction metrics for a specific date"},"description":"Array of daily interaction metrics for each day in the date range"},"totals":{"type":"object","properties":{"views":{"type":"number","description":"Total views across all videos in the period"},"likes":{"type":"number","description":"Total likes across all videos in the period"},"comments":{"type":"number","description":"Total comments across all videos in the period"},"shares":{"type":"number","description":"Total shares across all videos in the period"},"bookmarks":{"type":"number","description":"Total bookmarks/saves across all videos in the period"},"accounts":{"type":"number","description":"Total number of unique accounts tracked in the period"},"videos":{"type":"number","description":"Total number of videos tracked in the period"}},"required":["views","likes","comments","shares","bookmarks","accounts","videos"],"description":"Aggregated totals for the entire period"}},"required":["dailyMetrics","totals"],"description":"Daily interaction metrics with aggregated totals for comprehensive analytics","examples":[{"dailyMetrics":[{"date":"2025-12-01","views":485000,"likes":42500,"comments":3200,"shares":1850,"bookmarks":5400,"postedVideos":9,"appRevenue":1250.75,"newAppInstalls":85},{"date":"2025-12-02","views":520000,"likes":48000,"comments":3600,"shares":2100,"bookmarks":6200,"postedVideos":6,"appRevenue":1450.25,"newAppInstalls":95},{"date":"2025-12-03","views":680000,"likes":62000,"comments":4500,"shares":2800,"bookmarks":8100,"postedVideos":11,"appRevenue":1820.5,"newAppInstalls":125}],"totals":{"views":15420000,"likes":1280000,"comments":95000,"shares":78000,"bookmarks":156000,"accounts":18,"videos":245}}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/metrics":{"get":{"operationId":"analytics.metrics","summary":"Get overview metrics history","description":"Retrieves only the requested overview metric series for the specified date range. Supports day, week, or month aggregation for video gains, posted videos, app revenue, installs, and engagement rate. Zero-fills missing buckets and respects the standard analytics overview filters.","tags":["General Analytics"],"parameters":[{"name":"dateRange[from]","in":"query","required":true,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":true,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"platforms","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","required":false,"schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"metrics","in":"query","required":true,"schema":{"type":"array","items":{"enum":["views","likes","comments","shares","bookmarks","postedVideos","activeAccounts","appRevenue","newAppInstalls","engagementRate"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"aggregation","in":"query","required":false,"schema":{"enum":["day","week","month"],"type":"string","default":"day"},"allowEmptyValue":true,"allowReserved":true},{"name":"stackMetric","in":"query","required":false,"schema":{"enum":["views","likes","comments","shares","bookmarks","postedVideos","activeAccounts","appRevenue","newAppInstalls","engagementRate"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"stackBy","in":"query","required":false,"schema":{"enum":["platform","contentType"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"aggregation":{"enum":["day","week","month"],"type":"string","description":"Time-series aggregation used for the returned metrics"},"stacking":{"type":"object","properties":{"metric":{"enum":["views","likes","comments","shares","bookmarks","postedVideos","activeAccounts","appRevenue","newAppInstalls","engagementRate"],"type":"string"},"by":{"enum":["platform","contentType"],"type":"string"},"entities":{"type":"array","items":{"anyOf":[{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]}]}}},"required":["metric","by","entities"]},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Bucket start date in ISO format (YYYY-MM-DD)"},"endDate":{"type":"string","description":"Bucket end date in ISO format (YYYY-MM-DD)"},"views":{"type":"number"},"likes":{"type":"number"},"comments":{"type":"number"},"shares":{"type":"number"},"bookmarks":{"type":"number"},"postedVideos":{"type":"number"},"activeAccounts":{"type":"number"},"appRevenue":{"type":"number"},"newAppInstalls":{"type":"number"},"engagementRate":{"type":"number"},"stackedValues":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["date","endDate"],"description":"Metric values for the selected overview metrics within a returned bucket"},"description":"Array of aggregated metric buckets for the requested date range"}},"required":["aggregation","dailyMetrics"],"description":"Overview metrics with only the requested metric series populated in each returned bucket"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/analytics/video-daily-gains/export":{"post":{"operationId":"analytics.exportVideoDailyGains","summary":"Export detailed video daily gains as CSV","description":"Exports daily video performance metrics as CSV with presigned download URL. Includes video details, daily gains (views, likes, comments, shares, bookmarks), engagement rates, and metadata. Row-level data with one entry per video per day. Returns secure download URL valid for 5 minutes. Use narrow filters for faster processing of large datasets.","tags":["General Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dateRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"platforms":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"accounts":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"contentTypes":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"projects":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"viewMode":{"enum":["internal","competitors","all"],"type":"string"},"publicationMode":{"enum":["allEligible","onlyPublished"],"type":"string"}},"required":["dateRange"],"description":"Request parameters for fetching daily interaction metrics and totals","examples":[{"dateRange":{"from":"2025-12-01","to":"2025-12-31"},"platforms":["tiktok","instagram"],"accounts":null,"contentTypes":["video"],"projects":null},{"dateRange":{"from":"2025-11-01","to":"2025-11-30"},"platforms":["youtube"],"accounts":["orgacc_W97M6KLWV4Yq"],"contentTypes":null,"projects":["orgproj_RwmraAffhMt9"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"type":"string","format":"uri","description":"Presigned download URL for the CSV export file"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date","description":"Expiration timestamp for the download URL (typically 5 minutes)"},"rowCount":{"type":"number","description":"Total number of data rows included in the export file"},"fileName":{"type":"string","description":"Generated filename for the export (includes timestamp)"}},"required":["downloadUrl","expiresAt","rowCount","fileName"],"description":"Export file download information with presigned URL and metadata","examples":[{"downloadUrl":"https://storage.cloudflare.com/exports/video-daily-gains-2025-12-20-143052.csv?signature=abc123","expiresAt":"2025-12-20T14:35:52.000Z","rowCount":15420,"fileName":"video-daily-gains-2025-12-20-143052.csv"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts":{"get":{"operationId":"accounts.list","summary":"List all accounts with analytics","description":"Retrieves paginated accounts with comprehensive analytics including profile data (followers, following, display name), computed metrics (total views, engagement rate, virality rate), and tracking metadata. Video totals are provided as totalVideosTracked, totalVideosRetained, and totalVideosPublished. Supports sorting, searching by username, and filtering by platforms, projects, and date ranges.","tags":["Account Analytics"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","minLength":1,"description":"Account username on the platform","examples":["acme","creator_name"]},"allowEmptyValue":true,"allowReserved":true},{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange[from]","in":"query","required":false,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":false,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"contentTypes","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Organization-specific account ID"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (tiktok, instagram, youtube)"},"platformAccountId":{"type":"string","description":"Platform-specific account identifier"},"maxVideos":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"description":"Maximum number of videos to track for this account"},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Hashtag filters for content tracking (comma-separated)"},"lastErrorAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}],"description":"Timestamp of last sync error, if any"},"lastErrorCode":{"anyOf":[{"enum":["NOT_FOUND","INVALID_DATA","PRIVATE_CONTENT","RESTRICTED","APPLE_REQUIRED_AGREEMENT","APPLE_INVALID_VENDOR","APPLE_INVALID_CREDENTIALS"],"type":"string"},{"type":"null"}],"description":"Error code from last failed sync attempt"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was created"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was last updated"},"userId":{"type":"string","description":"ID of the user who added this account"},"orgId":{"type":"string","description":"Organization that owns this account tracking"},"orgCreatorId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assigned organization creator ID, if linked"},"creatorUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assigned creator user ID for this account, if linked"},"creatorName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assigned creator display name, if linked"},"creatorEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Assigned creator email, if linked"},"creatorImage":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}],"description":"Assigned creator profile image URL, if linked"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Account username/handle on the platform"},"loadAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp when account data was last loaded"},"followerCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Number of followers for this account"},"followingCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Number of accounts this account is following"},"profilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to the account's profile picture"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name of the account"},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Country code where the account is based"},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]},"totalVideosTracked":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Count of videos actively tracked within the max videos setting"},"totalVideosRetained":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Count of historic videos retained beyond the active tracking limit"},"totalVideosPublished":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total number of all-time videos published by this account"},"totalViews":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total lifetime views across all videos"},"totalLikes":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total lifetime likes across all videos"},"totalComments":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total lifetime comments across all videos"},"totalShares":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total lifetime shares across all videos"},"totalBookmarks":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Total lifetime bookmarks across all videos"},"averageViewsPerVideo":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Average views across all tracked videos"},"p10Views":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"10th percentile views across all tracked videos"},"p50Views":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Median (50th percentile) views across all tracked videos"},"p90Views":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"90th percentile views across all tracked videos"},"viralityRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Virality rate based on capped P90/P50 lift (0–100)"},"latestVideoPublishedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp of when the latest video was published"},"postActivity":{"type":"object","properties":{"dayCount":{"const":10},"days":{"type":"array","minItems":10,"maxItems":10,"items":{"type":"object","properties":{"date":{"type":"string"},"postedVideos":{"type":"number"}},"required":["date","postedVideos"]}}},"required":["dayCount","days"],"description":"Daily posted-video activity across the latest 10 days"},"daysSinceLastPost":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Number of days since the last video was published"},"engagementRate":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Overall engagement rate (likes+comments+shares+bookmarks)/views"},"user":{"type":"object","properties":{"id":{"type":"string","description":"Internal tracking record ID"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Platform identifier"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Username for tracking purposes"},"maxVideos":{"type":"integer","minimum":-2147483648,"maximum":2147483647,"description":"Maximum number of videos to track"},"userId":{"type":"string","description":"ID of the user who added this account"},"orgId":{"type":"string","description":"Organization that owns this account tracking"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was created"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date","description":"When this account tracking was last updated"},"lastErrorAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}],"description":"Timestamp of last sync error, if any"},"lastErrorCode":{"anyOf":[{"enum":["NOT_FOUND","INVALID_DATA","PRIVATE_CONTENT","RESTRICTED","APPLE_REQUIRED_AGREEMENT","APPLE_INVALID_VENDOR","APPLE_INVALID_CREDENTIALS"],"type":"string"},{"type":"null"}],"description":"Error code from last failed sync attempt"}},"required":["id","platform","username","maxVideos","userId","orgId","createdAt","updatedAt","lastErrorAt","lastErrorCode"],"description":"Internal tracking metadata for this account"}},"required":["id","platform","platformAccountId","maxVideos","hashtagsFilter","lastErrorAt","lastErrorCode","createdAt","updatedAt","userId","orgId","orgCreatorId","creatorUserId","creatorName","creatorEmail","creatorImage","username","loadAt","followerCount","followingCount","profilePictureUrl","displayName","countryCode","isCompetitor","totalVideosTracked","totalVideosRetained","totalVideosPublished","totalViews","totalLikes","totalComments","totalShares","totalBookmarks","averageViewsPerVideo","p10Views","p50Views","p90Views","viralityRate","latestVideoPublishedAt","postActivity","daysSinceLastPost","engagementRate","user"],"description":"Account data with profile information, tracking metadata, and computed analytics"},"description":"Array of accounts with comprehensive analytics and profile data"},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated response containing accounts with analytics data, profile information, and pagination metadata","examples":[{"data":[{"id":"orgacc_W97M6KLWV4Yq","platform":"tiktok","platformAccountId":"6891234567890","maxVideos":100,"hashtagsFilter":"brand,viral,trending","lastErrorAt":null,"lastErrorCode":null,"createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW","orgCreatorId":"orgcre_Ab12Cd34Ef56","creatorUserId":"user_3o2HG67jKQ1d","creatorName":"Alex Rivera","creatorEmail":"alex@example.com","creatorImage":"https://example.com/alex.jpg","username":"viral_creator","loadAt":"2025-12-20T08:00:00Z","followerCount":2500000,"followingCount":150,"profilePictureUrl":"https://example.com/profile.jpg","displayName":"Viral Creator","countryCode":"US","totalVideosTracked":60,"totalVideosRetained":1,"totalVideosPublished":120,"totalViews":45000000,"totalLikes":3200000,"totalComments":180000,"totalShares":95000,"totalBookmarks":250000,"averageViewsPerVideo":375000,"p10Views":45000,"p50Views":210000,"p90Views":750000,"viralityRate":72,"latestVideoPublishedAt":"2025-12-18T15:30:00Z","postActivity":{"dayCount":10,"days":[{"date":"2025-12-11","postedVideos":0},{"date":"2025-12-12","postedVideos":1},{"date":"2025-12-13","postedVideos":0},{"date":"2025-12-14","postedVideos":0},{"date":"2025-12-15","postedVideos":1},{"date":"2025-12-16","postedVideos":0},{"date":"2025-12-17","postedVideos":2},{"date":"2025-12-18","postedVideos":1},{"date":"2025-12-19","postedVideos":0},{"date":"2025-12-20","postedVideos":0}]},"daysSinceLastPost":2,"engagementRate":0.0811,"user":{"id":"orgacc_W97M6KLWV4Yq","platform":"tiktok","username":"viral_creator","maxVideos":100,"userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","lastErrorAt":null,"lastErrorCode":null}}],"pageCount":1,"totalRows":18}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/export":{"post":{"operationId":"accounts.export","summary":"Export accounts to CSV","description":"Exports accounts data as CSV with presigned download URL. Includes profile data, analytics metrics, tracking metadata, and computed performance indicators. Respects all filtering options (search, platforms, projects, date ranges). Returns secure download URL valid for 5 minutes.","tags":["Account Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"search":{"type":"string","minLength":1,"description":"Account username on the platform","examples":["acme","creator_name"]},"platforms":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"accounts":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"projects":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"dateRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"contentTypes":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"viewMode":{"enum":["internal","competitors","all"],"type":"string"}},"description":"Filtering options for accounts export (excludes pagination)","examples":[{"search":"viral_creator","platforms":["tiktok","instagram"],"accounts":null,"projects":null,"dateRange":{"from":"2025-01-01","to":"2025-01-31"},"contentTypes":["video"]},{"platforms":["tiktok"],"accounts":["orgacc_W97M6KLWV4Yq"],"projects":["orgproj_RwmraAffhMt9"],"contentTypes":["video"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"type":"string","format":"uri","description":"Presigned download URL for the CSV export file"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date","description":"Expiration timestamp for the download URL (typically 5 minutes)"},"rowCount":{"type":"number","description":"Total number of data rows included in the export file"},"fileName":{"type":"string","description":"Generated filename for the export (includes timestamp)"}},"required":["downloadUrl","expiresAt","rowCount","fileName"],"description":"Export file download information with presigned URL and metadata","examples":[{"downloadUrl":"https://storage.cloudflare.com/exports/video-daily-gains-2025-12-20-143052.csv?signature=abc123","expiresAt":"2025-12-20T14:35:52.000Z","rowCount":15420,"fileName":"video-daily-gains-2025-12-20-143052.csv"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked":{"get":{"operationId":"accounts.tracked.list","summary":"List all tracked accounts","description":"Retrieves paginated organization tracked accounts with user details, analytics data, and project associations.","tags":["Tracked Accounts"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","minLength":1,"description":"Account username on the platform","examples":["acme","creator_name"]},"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"initialUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}]},"maxVideos":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"isCompetitor":{"type":"boolean"},"tiktokAdvancedScrapingEnabled":{"type":"boolean"},"orgCreatorId":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"lastErrorAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"enum":["NOT_FOUND","INVALID_DATA","PRIVATE_CONTENT","RESTRICTED","APPLE_REQUIRED_AGREEMENT","APPLE_INVALID_VENDOR","APPLE_INVALID_CREDENTIALS"],"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"individualVideos":{"type":"number","default":0},"analyticsLatestLoadAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"excludedVideosCount":{"type":"number","default":0},"totalVideosTracked":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalVideosRetained":{"anyOf":[{"type":"number"},{"type":"null"}]},"totalVideosPublished":{"anyOf":[{"type":"number"},{"type":"null"}]},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","image","firstName","lastName","role"]},{"type":"null"}]},"creator":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","name","image","email"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]}}},"required":["id","user","accounts"]},{"type":"null"}]},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"name":{"type":"string"},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"description":"Hashtag filters for content filtering","examples":[["brand","marketing","viral"],["holiday","winter","campaign"]]},{"type":"null"}]}},"required":["id","name","logo","hashtagsFilter"]},"default":[]}},"required":["id","platform","platformAccountId","initialUsername","region","maxVideos","isCompetitor","tiktokAdvancedScrapingEnabled","orgCreatorId","hashtagsFilter","createdAt","updatedAt","actorType","userId","orgId","lastErrorAt","lastErrorCode","username","displayName","analyticsLatestLoadAt","totalVideosTracked","totalVideosRetained","totalVideosPublished","user","creator"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated response containing tracked accounts with user details, project associations, and analytics metadata","examples":[{"data":[{"id":"orgacc_W97M6KLWV4Yq","platform":"tiktok","platformAccountId":"68968912345678900","maxVideos":100,"orgCreatorId":null,"hashtagsFilter":["brand","marketing"],"lastErrorAt":null,"lastErrorCode":null,"createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","actorType":"user","userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW","username":"viral_creator","displayName":"Viral Creator","individualVideos":15,"analyticsLatestLoadAt":"2025-12-20T08:00:00Z","user":{"id":"user_PxyfnFj5JUx5","name":"John Doe","image":"https://example.com/avatar.jpg","firstName":"John","lastName":"Doe","role":"member"},"projects":[{"id":"orgproj_RwmraAffhMt9","name":"Holiday Campaign 2024","logo":"https://example.com/project-logo.png","hashtagsFilter":["holiday","winter","campaign"]}]},{"id":"orgacc_pbWejFdiFqQK","platform":"facebook","platformAccountId":"100044278427060","maxVideos":30,"orgCreatorId":null,"hashtagsFilter":null,"lastErrorAt":"2025-12-18T14:30:00.000Z","lastErrorCode":"PRIVATE_CONTENT","createdAt":"2025-02-01T14:30:00.000Z","updatedAt":"2025-12-18T14:30:00.000Z","actorType":"user","userId":"user_9uzTzeSobgkd","orgId":"org_QgqAir1Eydfc","username":"mrtechnicaldifficult","displayName":"Mr Technical Difficult","individualVideos":8,"analyticsLatestLoadAt":"2025-12-17T10:15:00Z","user":{"id":"user_9uzTzeSobgkd","name":"Jane Smith","image":null,"firstName":"Jane","lastName":"Smith","role":"admin"},"projects":[]}],"pageCount":5,"totalRows":23}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"post":{"operationId":"accounts.tracked.add","summary":"Add tracked accounts","description":"Adds new accounts to track for the organization. Validates against subscription limits. Initiates data synchronization.","tags":["Tracked Accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accounts":{"type":"array","minItems":1,"items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"username":{"type":"string","minLength":1,"description":"Username without leading @","examples":[{"username":"viral_creator"}]},"max_videos":{"anyOf":[{"const":0},{"const":10},{"const":30},{"const":60},{"const":100},{"const":200},{"const":300},{"const":400},{"const":500},{"const":1000},{"const":2000}]},"platform_account_id":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"region":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]}},"required":["platform","username","max_videos"],"description":"Social account without platform ID","examples":[{"platform":"tiktok","username":"viral_creator","max_videos":10,"platform_account_id":"68912345678900"}]},"description":"Social accounts","examples":[{"platform":"tiktok","username":"viral_creator","max_videos":10},{"platform":"tiktok","username":"viral_creator","max_videos":10}]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false],"default":false}},"required":["accounts"],"description":"Request to add tracked accounts for external API access","examples":[{"isCompetitor":false,"accounts":[{"platform":"tiktok","username":"viral_creator","max_videos":100},{"platform":"instagram","username":"fashion_influencer","max_videos":50},{"platform":"youtube","username":"tech_reviewer","max_videos":30}]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"eventIds":{"type":"array","items":{"type":"string","description":"Event ID for Inngest events"}}},"required":["count","eventIds"],"description":"Result of adding tracked accounts including count and sync job identifiers","examples":[{"count":3,"eventIds":["01JGXKPQ9MNTV2R4W8KPMB5YT1","01JGXKPQ9MNTV2R4W8KPMB5YT2","01JGXKPQ9MNTV2R4W8KPMB5YT3"]}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"TRACKED_ACCOUNT_VALIDATION_FAILED"},"status":{"const":400},"message":{"type":"string","default":"Validation failed for tracked accounts."},"data":{"type":"object","properties":{"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"identifier":{"type":"string"},"errorCode":{"enum":["NOT_FOUND","PRIVATE","INVALID_INPUT","RATE_LIMITED","UNKNOWN","RESTRICTED"],"type":"string"},"message":{"type":"string"}},"required":["platform","identifier","errorCode","message"]}}},"required":["issues"]}},"required":["defined","code","status","message","data"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/count":{"get":{"operationId":"accounts.tracked.count","summary":"Get total count of tracked accounts","description":"Returns the total number of tracked accounts for the organization.","tags":["Tracked Accounts"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"number","description":"Total number of tracked accounts for the organization","examples":[23]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/refresh":{"post":{"operationId":"accounts.tracked.refresh","summary":"Refresh tracked accounts data","description":"Manually refresh data for specific tracked accounts. Only refreshes accounts that are actively tracked.","tags":["Tracked Accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"id":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]}},"required":["platform","id"]}}},"required":["items"],"description":"Refresh tracked accounts data","examples":[{"items":[{"platform":"facebook","id":"100044278427060"},{"platform":"tiktok","id":"102215305149431808"},{"platform":"instagram","id":"10674663966"},{"platform":"youtube","id":"UCXWVIsxzHo905JK7_PPONA"}]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"refreshed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},"required":["id","platformAccountId","username","platform"]}},"totalRefreshed":{"type":"number"},"eventIds":{"type":"array","items":{"type":"string","description":"Event ID for Inngest events"}}},"required":["refreshed","totalRefreshed","eventIds"],"description":"Result of refreshing tracked accounts","examples":[{"refreshed":[{"id":"orgacc_VA542FB0001","platformAccountId":"100044278427060","username":"mrtechnicaldifficult","platform":"facebook"},{"id":"orgacc_W97M6KLWV4Yq","platformAccountId":"102215305149431808","username":"vioundvivi","platform":"tiktok"},{"id":"orgacc_X98N7LMXW5Zr","platformAccountId":"10674663966","username":"domi.succeeds","platform":"instagram"},{"id":"orgacc_Y99O8MNYX6As","platformAccountId":"UCXWVIsxzHo905JK7_PPONA","username":"fullthrottlef1yt","platform":"youtube"}],"totalRefreshed":4,"eventIds":["01HQX5N6R4Z8K7WJQT9S3YVMGH","01HQX5N6R5A9M8XKRU0T4ZWNHJ","01HQX5N6R6B0N9YMRV1U5AXOJK","01HQX5N6R7C1P0ZNSW2V6BYPKL"]}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/{id}/max-videos":{"put":{"operationId":"accounts.tracked.updateMaxVideos","summary":"Update account max videos limit","description":"Updates the maximum video tracking limit for a specific account.","tags":["Tracked Accounts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newMaxVideos":{"anyOf":[{"const":0},{"const":10},{"const":30},{"const":60},{"const":100},{"const":200},{"const":300},{"const":400},{"const":500},{"const":1000},{"const":2000}]}},"required":["newMaxVideos"],"description":"Request to update the maximum video tracking limit for a tracked account","examples":[{"newMaxVideos":100}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"maxVideos":{"anyOf":[{"const":0},{"const":10},{"const":30},{"const":60},{"const":100},{"const":200},{"const":300},{"const":400},{"const":500},{"const":1000},{"const":2000}]}},"required":["accountId","maxVideos"],"description":"Result of updating account max videos limit","examples":[{"accountId":"orgacc_W97M6KLWV4Yq","maxVideos":100}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/max-videos/bulk":{"put":{"operationId":"accounts.tracked.bulkUpdateMaxVideos","summary":"Bulk update account max videos limits","description":"Updates the maximum video tracking limit for multiple accounts at once.","tags":["Tracked Accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs for bulk operations","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"]]},"newMaxVideos":{"anyOf":[{"const":0},{"const":10},{"const":30},{"const":60},{"const":100},{"const":200},{"const":300},{"const":400},{"const":500},{"const":1000},{"const":2000}]}},"required":["accountIds","newMaxVideos"],"description":"Request to bulk update maximum video tracking limits for multiple accounts","examples":[{"accountIds":["orgacc_W97M6KLWV4Yq","orgacc_X98N7LMXW5Zr","orgacc_Y99O8MNYX6As"],"newMaxVideos":100}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"successCount":{"type":"number"},"failedCount":{"type":"number"},"totalRequested":{"type":"number"},"creditsConsumed":{"type":"number"},"failedAccountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}},"required":["successCount","failedCount","totalRequested","creditsConsumed"],"description":"Result of bulk updating account max videos limits","examples":[{"successCount":3,"failedCount":0,"totalRequested":3,"creditsConsumed":150}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/{id}/hashtags":{"put":{"operationId":"accounts.tracked.updateHashtags","summary":"Update account hashtags filter","description":"Updates the hashtag filter for a specific account to filter content by hashtags.","tags":["Tracked Accounts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"description":"Hashtag filters for content filtering","examples":[["brand","marketing","viral"],["holiday","winter","campaign"]]},{"type":"null"}]}},"required":["hashtagsFilter"],"description":"Request to update hashtag filters for a tracked account","examples":[{"hashtagsFilter":["brand","marketing","viral"]},{"hashtagsFilter":null}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"description":"Hashtag filters for content filtering","examples":[["brand","marketing","viral"],["holiday","winter","campaign"]]},{"type":"null"}]}},"required":["accountId","hashtagsFilter"],"description":"Result of updating account hashtag filters","examples":[{"accountId":"orgacc_W97M6KLWV4Yq","hashtagsFilter":["brand","marketing","viral"]}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/{accountId}/project-hashtags":{"put":{"operationId":"accounts.tracked.updateProjectHashtags","summary":"Update account project hashtags filter","description":"Updates hashtag filters for account projects and merges them at the account level.","tags":["Tracked Accounts"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectHashtags":{"type":"array","items":{"type":"object","properties":{"projectId":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"description":"Hashtag filters for content filtering","examples":[["brand","marketing","viral"],["holiday","winter","campaign"]]},{"type":"null"}]}},"required":["projectId","hashtagsFilter"]}}},"required":["projectHashtags"],"description":"Request to update hashtag filters for account projects","examples":[{"projectHashtags":[{"projectId":"orgproj_RwmraAffhMt9","hashtagsFilter":["holiday","winter","campaign"]},{"projectId":"orgproj_TAH7kHyU6h59","hashtagsFilter":["summer","beach","vacation"]}]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string","description":"Hashtag","examples":["brand","marketing","viral"]},"description":"Hashtag filters for content filtering","examples":[["brand","marketing","viral"],["holiday","winter","campaign"]]},{"type":"null"}]}},"required":["accountId","hashtagsFilter"],"description":"Result of updating account project hashtag filters (account hashtags unchanged)","examples":[{"accountId":"orgacc_W97M6KLWV4Yq","hashtagsFilter":null}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/{id}/competitor":{"put":{"operationId":"accounts.tracked.setCompetitor","summary":"Set competitor flag for tracked account","description":"Marks or unmarks a tracked account as a competitor.","tags":["Tracked Accounts"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]}},"required":["isCompetitor"],"description":"Set whether a tracked account is marked as a competitor.","examples":[{"isCompetitor":true}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]}},"required":["accountId","isCompetitor"],"description":"Result of setting the competitor flag for a tracked account.","examples":[{"accountId":"orgacc_W97M6KLWV4Yq","isCompetitor":true}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/accounts/tracked/competitor/bulk":{"put":{"operationId":"accounts.tracked.setCompetitors","summary":"Bulk set competitor flag","description":"Marks or unmarks multiple tracked accounts as competitors in one request.","tags":["Tracked Accounts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs for bulk operations","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"]]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]}},"required":["accountIds","isCompetitor"],"description":"Bulk-set whether tracked accounts are marked as competitors.","examples":[{"accountIds":["orgacc_W97M6KLWV4Yq","orgacc_pbWejFdiFqQK"],"isCompetitor":false}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updatedCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["updatedCount"],"description":"Result of bulk setting the competitor flag.","examples":[{"updatedCount":2}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/{platform}/{platformVideoId}":{"get":{"operationId":"videos.detail","summary":"Get video details","description":"Retrieves comprehensive video details including metadata (title, caption, hashtags, music), analytics metrics (views, likes, engagement rate), account information, and content properties. Includes platform-specific data and computed performance indicators.","tags":["Video Analytics"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"platformVideoId":{"type":"string"},"platform":{"type":"string"},"accountUsername":{"type":"string"},"platformAccountId":{"type":"string"},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountProfilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"type":"array","items":{"type":"string"}},"contentType":{"type":"string"},"videoIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicId":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicArtist":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicAlbum":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicPlayUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicCoverUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"isOriginalMusic":{"anyOf":[{"type":"integer","minimum":-32768,"maximum":32767},{"type":"null"}]},"durationSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"viewCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"likeCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"commentCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"shareCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookmarkCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"engagementRate":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}]},"viralityFactor":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}]},"publishedDate":{"type":"string"},"publishedAt":{"type":"string"},"loadAt":{"type":"string"},"orgAccountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"orgVideoId":{"anyOf":[{"type":"string","pattern":"^orgvid_.*","description":"Organization video ID with orgvid_ prefix"},{"type":"null"}]},"orgCreatorId":{"anyOf":[{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},{"type":"null"}]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false],"default":false},"tracking_status":{"anyOf":[{"const":0},{"const":1}],"description":"Tracking status indicator: 1 for actively tracked videos, 0 for retained data no longer actively tracked"}},"required":["id","platformVideoId","platform","accountUsername","platformAccountId","accountDisplayName","accountProfilePictureUrl","caption","hashtags","contentType","videoIndex","thumbnailUrl","musicId","musicTitle","musicArtist","musicAlbum","musicPlayUrl","musicCoverUrl","isOriginalMusic","durationSeconds","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","viralityFactor","publishedDate","publishedAt","loadAt","orgAccountId","orgCreatorId","tracking_status"]},{"type":"null"}],"description":"Comprehensive video details including metadata, analytics, and account information","examples":[{"id":"vid_91rBGUI9L6Db","platformVideoId":"76891234567890012345678","platform":"tiktok","accountUsername":"viral_creator","platformAccountId":"6891234567890","accountDisplayName":"Viral Creator","accountProfilePictureUrl":"https://example.com/profile.jpg","caption":"Amazing viral content! #trending #viral #fyp","hashtags":["trending","viral","fyp"],"contentType":"video","videoIndex":1,"thumbnailUrl":"https://example.com/thumbnail.jpg","musicId":"music_123","musicTitle":"Trending Song","musicArtist":"Popular Artist","musicAlbum":"Hit Album","musicPlayUrl":"https://example.com/music.mp3","musicCoverUrl":"https://example.com/cover.jpg","isOriginalMusic":false,"durationSeconds":45,"viewCount":1250000,"likeCount":125000,"commentCount":8500,"shareCount":15000,"bookmarkCount":35000,"engagementRate":0.1464,"viralityFactor":8.5,"publishedDate":"2025-12-15","publishedAt":"2025-12-15T18:30:00Z","loadAt":"2025-12-20T08:00:00Z","orgAccountId":"orgacc_W97M6KLWV4Yq","tracking_status":1}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Video not found"},"data":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}},"required":["platform","platformVideoId"],"description":"Request parameters for fetching detailed video information by platform and video ID","examples":[{"platform":"tiktok","platformVideoId":"76891234567890012345678"},{"platform":"instagram","platformVideoId":"Cz1234567890"},{"platform":"youtube","platformVideoId":"dQw4w9WgXcQ"}]}},"required":["defined","code","status","message","data"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/{platform}/{platformVideoId}/download":{"get":{"operationId":"videos.download","summary":"Get video download link","description":"Fetches a temporary MP4 download link for a specific TikTok, Instagram, or YouTube video. Requires an Ultra-or-higher plan.","tags":["Video Analytics"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"description":"URL","examples":["https://www.myproject.com"]},"consumedExtraCredit":{"type":"boolean"}},"required":["consumedExtraCredit"],"description":"Direct HTTPS MP4 URL for the requested video plus a flag indicating if an extra credit was consumed. Links may include query parameters for authorization and can expire."}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNSUPPORTED_PLATFORM"},"status":{"const":400},"message":{"type":"string","default":"Video download is not supported for this platform"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"VIDEO_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Video not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"DOWNLOAD_URL_UNAVAILABLE"},"status":{"const":409},"message":{"type":"string","default":"Download link unavailable"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/{platform}/{platformVideoId}/history":{"get":{"operationId":"videos.history","summary":"[DEPRECATED] Get video metrics history","description":"Use `/videos/{platform}/{platformVideoId}/metrics` instead.","tags":["Video Analytics"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date in ISO format (YYYY-MM-DD)"},"viewCount":{"type":"number","description":"Total views on this date"},"likeCount":{"type":"number","description":"Total likes on this date"},"commentCount":{"type":"number","description":"Total comments on this date"},"shareCount":{"type":"number","description":"Total shares on this date"},"bookmarkCount":{"type":"number","description":"Total bookmarks/saves on this date"},"engagementRate":{"type":"number","description":"Engagement rate on this date (interactions/views)"}},"required":["date","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate"],"description":"Daily metrics snapshot for a video at a specific date"},"description":"Array of daily metrics history from video publication date to present","examples":[[{"date":"2025-12-15","viewCount":15000,"likeCount":1200,"commentCount":85,"shareCount":150,"bookmarkCount":300,"engagementRate":0.116},{"date":"2025-12-16","viewCount":45000,"likeCount":3800,"commentCount":250,"shareCount":450,"bookmarkCount":950,"engagementRate":0.122},{"date":"2025-12-17","viewCount":125000,"likeCount":12500,"commentCount":850,"shareCount":1500,"bookmarkCount":3500,"engagementRate":0.1464}]]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/{platform}/{platformVideoId}/metrics":{"get":{"operationId":"videos.metrics","summary":"Get video metrics history","description":"Retrieves only the requested video metric series for the selected video. Supports day, week, or month aggregation and returns chart-ready buckets from the video's published date through today.","tags":["Video Analytics"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}},{"name":"metrics","in":"query","required":true,"schema":{"type":"array","items":{"enum":["viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"aggregation","in":"query","required":false,"schema":{"enum":["day","week","month"],"type":"string","default":"day"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"aggregation":{"enum":["day","week","month"],"type":"string"},"dailyMetrics":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Bucket start date in ISO format (YYYY-MM-DD)"},"endDate":{"type":"string","description":"Bucket end date in ISO format (YYYY-MM-DD)"},"viewCount":{"type":"number"},"likeCount":{"type":"number"},"commentCount":{"type":"number"},"shareCount":{"type":"number"},"bookmarkCount":{"type":"number"},"engagementRate":{"type":"number"}},"required":["date","endDate"],"description":"Metric values for the selected video metrics within a returned bucket."}}},"required":["aggregation","dailyMetrics"],"description":"Video metrics with only the requested metric series populated in each returned bucket."}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Video not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/{platform}/{platformVideoId}/history/export":{"post":{"operationId":"videos.exportHistory","summary":"Export video metrics history","description":"Exports recent daily metrics history for a specific video as CSV with a presigned download URL.","tags":["Video Analytics"],"parameters":[{"name":"platform","in":"path","required":true,"schema":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},{"name":"platformVideoId","in":"path","required":true,"schema":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer","minimum":1,"maximum":365,"description":"Number of most recent days to include in the export.","examples":[14]}},"description":"Request parameters for exporting video metrics history by platform and video ID"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"type":"string","format":"uri","description":"Presigned download URL for the CSV export file"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date","description":"Expiration timestamp for the download URL (typically 5 minutes)"},"rowCount":{"type":"number","description":"Total number of data rows included in the export file"},"fileName":{"type":"string","description":"Generated filename for the export (includes timestamp)"}},"required":["downloadUrl","expiresAt","rowCount","fileName"],"description":"Export file download information with presigned URL and metadata","examples":[{"downloadUrl":"https://storage.cloudflare.com/exports/video-daily-gains-2025-12-20-143052.csv?signature=abc123","expiresAt":"2025-12-20T14:35:52.000Z","rowCount":15420,"fileName":"video-daily-gains-2025-12-20-143052.csv"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Video not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos":{"get":{"operationId":"videos.list","summary":"List all tracked videos with analytics","description":"Retrieves paginated videos with comprehensive analytics data. Supports filtering by platforms (TikTok, Instagram, YouTube), accounts, content types, projects, and date ranges.","tags":["Video Analytics"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accountUsername","in":"query","schema":{"type":"string","minLength":1,"description":"Account username on the platform","examples":["acme","creator_name"]},"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange[from]","in":"query","required":false,"description":"Start date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-01"}},{"name":"dateRange[to]","in":"query","required":false,"description":"End date in ISO format (YYYY-MM-DD)","schema":{"type":"string","example":"2025-01-31"}},{"name":"expand","in":"query","schema":{"type":"array","items":{"enum":["projects"],"type":"string"},"description":"Expand related resources in the response","examples":[[],["projects"]]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Internal video ID, null if not in analytics view"},"platformVideoId":{"type":"string","description":"Platform-specific video ID (e.g., TikTok video ID)"},"platform":{"type":"string","description":"Social media platform where the video was posted"},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Account username on the platform"},"isCompetitor":{"type":"boolean","description":"Whether the owning account is marked as a competitor","default":false},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Platform-specific account ID"},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Display name of the account"},"accountProfilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to the account's profile picture"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Video caption or description text"},"hashtags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Array of hashtags extracted from the caption"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Type of content (video, image, carousel)"},"videoIndex":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Index of video in carousel posts (1-based)"},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to the video thumbnail image"},"musicId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Platform-specific music track ID"},"musicTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Title of the background music"},"musicArtist":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Artist of the background music"},"musicAlbum":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Album of the background music"},"musicPlayUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to play the background music"},"musicCoverUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL to the music cover art"},"isOriginalMusic":{"anyOf":[{"type":"integer","minimum":-32768,"maximum":32767},{"type":"null"}],"description":"Whether the music is original content by the creator"},"durationSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Video duration in seconds"},"viewCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Total number of views"},"likeCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Total number of likes"},"commentCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Total number of comments"},"shareCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Total number of shares"},"bookmarkCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Total number of bookmarks/saves"},"engagementRate":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}],"description":"Engagement rate calculated as (likes + comments + shares + bookmarks) / views"},"viralityFactor":{"anyOf":[{"type":"number","minimum":-140737488355328,"maximum":140737488355327},{"type":"null"}],"description":"Proprietary virality score based on engagement patterns"},"publishedDate":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Date when the video was published (YYYY-MM-DD)"},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp when the video was published (ISO 8601)"},"loadAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp when the video data was last loaded into our system"},"tracking_status":{"anyOf":[{"const":0},{"const":1}],"description":"Tracking status indicator: 1 for actively tracked entries, 0 for retained historic data"},"isFromAnalytics":{"type":"boolean","description":"Whether the row came from the analytics video table"},"lastErrorAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}],"description":"Timestamp of the last sync error for this video"},"lastErrorCode":{"anyOf":[{"enum":["NOT_FOUND","INVALID_DATA","PRIVATE_CONTENT","RESTRICTED","APPLE_REQUIRED_AGREEMENT","APPLE_INVALID_VENDOR","APPLE_INVALID_CREDENTIALS"],"type":"string"},{"type":"null"}],"description":"Error code from the last failed sync attempt"},"orgAccountId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Organization-specific account ID that owns this video"},"orgVideoId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Organization-specific video tracking ID"},"projects":{"type":"array","items":{"anyOf":[{"type":"string","pattern":"^orgproj_.*","title":"Project ID (default)","description":"Returned when expand[]=projects is omitted.","example":"orgproj_1A2B3C4D5E6F"},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","url","logo","description"],"title":"Expanded Project (expand[]=projects)","description":"Returned when expand[]=projects is provided.","example":{"id":"orgproj_1A2B3C4D5E6F","name":"Creator Launch Campaign","url":"https://example.com","logo":null,"description":null}}]},"description":"Projects linked to the video. Returns project IDs by default, or full objects when using expand[]=projects.","examples":[["orgproj_1A2B3C4D5E6F","orgproj_7H8I9J0K1L2M"],[{"id":"orgproj_1A2B3C4D5E6F","name":"Creator Launch Campaign","url":"https://example.com","logo":null,"description":null}]]}},"required":["id","platformVideoId","platform","accountUsername","platformAccountId","accountDisplayName","accountProfilePictureUrl","caption","hashtags","contentType","videoIndex","thumbnailUrl","musicId","musicTitle","musicArtist","musicAlbum","musicPlayUrl","musicCoverUrl","isOriginalMusic","durationSeconds","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","viralityFactor","publishedDate","publishedAt","loadAt","tracking_status","isFromAnalytics","lastErrorAt","lastErrorCode","orgAccountId","orgVideoId","projects"]},"description":"Array of video objects with comprehensive analytics and metadata"},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated response containing videos with analytics data and pagination metadata","examples":[{"data":[{"id":"vid_91rBGUI9L6Db","platformVideoId":"74567890689123456789001","platform":"tiktok","accountUsername":"viral_creator","platformAccountId":"68968912345678900","accountDisplayName":"Viral Creator","accountProfilePictureUrl":"https://example.com/profile.jpg","caption":"Amazing viral content! #trending #viral #fyp","hashtags":["trending","viral","fyp"],"contentType":"video","videoIndex":1,"thumbnailUrl":"https://example.com/thumbnail.jpg","musicId":"music_123","musicTitle":"Trending Song","musicArtist":"Popular Artist","musicAlbum":"Hit Album","musicPlayUrl":"https://example.com/music.mp3","musicCoverUrl":"https://example.com/cover.jpg","isOriginalMusic":false,"durationSeconds":45,"viewCount":1250000,"likeCount":125000,"commentCount":8500,"shareCount":15000,"bookmarkCount":35000,"engagementRate":0.1464,"viralityFactor":8.5,"publishedDate":"2025-12-15","publishedAt":"2025-12-15T18:30:00Z","loadAt":"2025-12-20T08:00:00Z","tracking_status":1,"lastErrorAt":null,"lastErrorCode":null,"orgAccountId":"orgacc_W97M6KLWV4Yq","orgVideoId":"orgvid_91rBGUI9L6Db","projects":["orgproj_1A2B3C4D5E6F"]}],"pageCount":8,"totalRows":150}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/activity":{"get":{"operationId":"videos.activity","summary":"Get daily posting activity data","description":"Retrieves daily post counts for the last ~1 year (53 weeks ending last Saturday). Ignores dateRange filter, respects platform/account/projects filters.","tags":["Video Analytics"],"parameters":[{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"accounts","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"days","in":"query","schema":{"type":"number","minimum":1,"maximum":365,"description":"Number of days to look back for activity data (1-365 days)"},"allowEmptyValue":true,"allowReserved":true},{"name":"contentTypes","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"projects","in":"query","schema":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"Date in ISO format (YYYY-MM-DD)"},"count":{"type":"number","description":"Number of videos posted on this date"}},"required":["date","count"],"description":"Daily activity data point with post count"},"description":"Array of daily posting activity showing post counts over time","examples":[[{"date":"2025-12-15","count":3},{"date":"2025-12-16","count":5},{"date":"2025-12-17","count":2},{"date":"2025-12-18","count":0}]]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/export":{"post":{"operationId":"videos.export","summary":"Export videos to CSV","description":"Exports filtered videos data as CSV file stored in R2. Returns a presigned download URL valid for 5 minutes.","tags":["Video Analytics"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platforms":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"accountUsername":{"type":"string","minLength":1,"description":"Account username on the platform","examples":["acme","creator_name"]},"accounts":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization account IDs","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"],null]},"contentTypes":{"anyOf":[{"type":"array","items":{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},{"type":"null"}],"description":"Content types (video, slideshow)","examples":[["video"],["slideshow"],null]},"projects":{"anyOf":[{"type":"array","items":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"},"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},{"type":"null"}],"description":"Organization project IDs","examples":[["orgproj_1A2B3C4D5E6F"],["orgproj_1A2B3C4D5E6F","orgproj_2B3C4D5E6F7G"],null]},"dateRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"expand":{"type":"array","items":{"enum":["projects"],"type":"string"},"description":"Expand related resources in the response","examples":[[],["projects"]]},"viewMode":{"enum":["internal","competitors","all"],"type":"string"}},"description":"Filtering options for videos export (excludes pagination)","examples":[{"platforms":["tiktok","instagram"],"accountUsername":"viral_creator","accounts":null,"projects":null,"dateRange":{"from":"2025-01-01","to":"2025-01-31"},"contentTypes":["video"]},{"platforms":["tiktok"],"accounts":["orgacc_W97M6KLWV4Yq"],"projects":["orgproj_RwmraAffhMt9"],"contentTypes":["video"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"downloadUrl":{"type":"string","format":"uri","description":"Presigned download URL for the CSV export file"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date","description":"Expiration timestamp for the download URL (typically 5 minutes)"},"rowCount":{"type":"number","description":"Total number of data rows included in the export file"},"fileName":{"type":"string","description":"Generated filename for the export (includes timestamp)"}},"required":["downloadUrl","expiresAt","rowCount","fileName"],"description":"Export file download information with presigned URL and metadata","examples":[{"downloadUrl":"https://storage.cloudflare.com/exports/video-daily-gains-2025-12-20-143052.csv?signature=abc123","expiresAt":"2025-12-20T14:35:52.000Z","rowCount":15420,"fileName":"video-daily-gains-2025-12-20-143052.csv"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/tracked":{"get":{"operationId":"videos.tracked.list","summary":"List all tracked videos","description":"Retrieves paginated organization tracked videos with user details and analytics data.","tags":["Tracked Individual Videos"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"platforms","in":"query","schema":{"anyOf":[{"type":"array","items":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},{"type":"null"}],"description":"Social media platforms (facebook, instagram, tiktok, youtube)","examples":[["facebook","instagram"],["youtube"],null]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"viewMode","in":"query","schema":{"enum":["internal","competitors","all"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgAccountId":{"type":"string"},"platformVideoId":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"lastErrorAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"lastErrorCode":{"anyOf":[{"enum":["NOT_FOUND","INVALID_DATA","PRIVATE_CONTENT","RESTRICTED","APPLE_REQUIRED_AGREEMENT","APPLE_INVALID_VENDOR","APPLE_INVALID_CREDENTIALS"],"type":"string"},{"type":"null"}]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"analyticsLatestLoadAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"orgAccountMaxVideos":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false]},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","image","firstName","lastName","role"]},{"type":"null"}]}},"required":["id","orgAccountId","platformVideoId","platform","createdAt","updatedAt","actorType","userId","orgId","lastErrorAt","lastErrorCode","username","accountDisplayName","analyticsLatestLoadAt","orgAccountMaxVideos","platformAccountId","isCompetitor","user"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated response containing tracked videos with user details and analytics metadata","examples":[{"data":[{"id":"orgvid_91rBGUI9L6Db","platform":"youtube","platformVideoId":"7w4uZc7xCzU","orgAccountId":"orgacc_W97M6KLWV4Yq","lastErrorAt":null,"lastErrorCode":null,"createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","actorType":"user","userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW","username":"viral_creator","analyticsLatestLoadAt":"2025-12-20T08:00:00Z","orgAccountMaxVideos":100,"user":{"id":"user_PxyfnFj5JUx5","name":"John Doe","image":"https://example.com/avatar.jpg","firstName":"John","lastName":"Doe","role":"member"}},{"id":"orgvid_Fiudsi4oSByx","platform":"facebook","platformVideoId":"1487463749406225","orgAccountId":"orgacc_pbWejFdiFqQK","lastErrorAt":"2025-12-18T14:30:00.000Z","lastErrorCode":"NOT_FOUND","createdAt":"2025-02-01T14:30:00.000Z","updatedAt":"2025-12-18T14:30:00.000Z","actorType":"user","userId":"user_9uzTzeSobgkd","orgId":"org_QgqAir1Eydfc","username":"mrtechnicaldifficult","analyticsLatestLoadAt":null,"orgAccountMaxVideos":50,"user":{"id":"user_9uzTzeSobgkd","name":"Jane Smith","image":null,"firstName":"Jane","lastName":"Smith","role":"admin"}}],"pageCount":8,"totalRows":156}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"post":{"operationId":"videos.tracked.add","summary":"Add tracked videos","description":"Adds new individual videos to track for the organization. Initiates data synchronization.","tags":["Tracked Individual Videos"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"videos":{"type":"array","minItems":1,"items":{"type":"object","properties":{"videoId":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platform_account_id":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"initial_username":{"type":"string","minLength":1,"description":"Username without leading @","examples":[{"username":"viral_creator"}]},"region":{"anyOf":[{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}]}},"required":["videoId","platform"],"description":"Social video","examples":[{"videoId":"76891234567890012345678","platform":"tiktok"}]},"description":"Social videos","examples":[{"videoId":"76891234567890012345678","platform":"tiktok"},{"videoId":"76891234567890012345678","platform":"tiktok"}]},"isCompetitor":{"type":"boolean","description":"Whether the tracked account is marked as a competitor","examples":[true,false],"default":false}},"required":["videos"],"description":"Request to add tracked videos for organization monitoring","examples":[{"videos":[{"videoId":"1487463749406225","platform":"facebook"},{"videoId":"74567890689123456789001","platform":"tiktok"},{"videoId":"C2VfGhIjKlM","platform":"instagram"},{"videoId":"7w4uZc7xCzU","platform":"youtube"}],"isCompetitor":true}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number"},"eventIds":{"type":"array","items":{"type":"string","description":"Event ID for Inngest events"}}},"required":["count","eventIds"],"description":"Result of adding tracked videos including count and sync job identifiers","examples":[{"count":4,"eventIds":["01JGXKPQ9MNTV2R4W8KPMB5YT4","01JGXKPQ9MNTV2R4W8KPMB5YT5","01JGXKPQ9MNTV2R4W8KPMB5YT6","01JGXKPQ9MNTV2R4W8KPMB5YT7"]}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"TRACKED_VIDEO_VALIDATION_FAILED"},"status":{"const":400},"message":{"type":"string","default":"Validation failed for tracked videos."},"data":{"type":"object","properties":{"issues":{"type":"array","minItems":1,"items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"identifier":{"type":"string"},"errorCode":{"enum":["NOT_FOUND","PRIVATE","INVALID_INPUT","RATE_LIMITED","UNKNOWN","RESTRICTED"],"type":"string"},"message":{"type":"string"}},"required":["platform","identifier","errorCode","message"]}}},"required":["issues"]}},"required":["defined","code","status","message","data"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/videos/tracked/refresh":{"post":{"operationId":"videos.tracked.refresh","summary":"Refresh individually tracked videos data","description":"Manually refresh data for specific individually tracked videos. Only works for individual videos, not videos from tracked accounts.","tags":["Tracked Individual Videos"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"id":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]}},"required":["platform","id"]}}},"required":["items"],"description":"Refresh individually tracked videos data","examples":[{"items":[{"platform":"facebook","id":"1487463749406225"},{"platform":"tiktok","id":"6768504823336815877"},{"platform":"instagram","id":"C_WdbENfYw"},{"platform":"youtube","id":"iZvCjtYck"}]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"refreshed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgvid_.*","description":"Organization video ID with orgvid_ prefix"},"platformVideoId":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]}},"required":["id","platformVideoId","platform"]}},"totalRefreshed":{"type":"number"}},"required":["refreshed","totalRefreshed"],"description":"Result of refreshing individually tracked videos","examples":[{"refreshed":[{"id":"orgvid_90qAFTH8K5Ca","platformVideoId":"1487463749406225","platform":"facebook"},{"id":"orgvid_91rBGUI9L6Db","platformVideoId":"6768504823336815877","platform":"tiktok"},{"id":"orgvid_92sCHVJ0M7Ec","platformVideoId":"C_WdbENfYw","platform":"instagram"},{"id":"orgvid_93tDIWK1N8Fd","platformVideoId":"iZvCjtYck","platform":"youtube"}],"totalRefreshed":4}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/projects":{"get":{"operationId":"projects.list","summary":"List organization projects","description":"Retrieves a paginated list of projects for the organization with filtering and sorting options.","tags":["Projects"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","description":"Filter by project name","examples":["Fitness","Music"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"appleAppId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"trackedAccounts":{"anyOf":[{"type":"number"},{"type":"null"}]},"competitorStatus":{"anyOf":[{"enum":["internal","competitor","mixed","none"],"type":"string"},{"type":"null"}]},"appleApp":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"appleIdentifier":{"type":"string"}},"required":["id","title","appleIdentifier"]},{"type":"null"}]},"createdByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"banReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"creatorProfileId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","emailVerified","image","createdAt","updatedAt","role","banned","banReason","banExpires","firstName","lastName","creatorProfileId"]},{"type":"null"}]}},"required":["id","name","url","description","logo","appleAppId","createdAt","updatedAt","actorType","userId","orgId","trackedAccounts","appleApp"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated list of organization projects with tracking data","examples":[{"data":[{"id":"orgproj_FiT123NeS456","name":"FitTracker Pro","url":"https://fittracker.app","description":"Premium fitness tracking app with social features and community challenges","logo":"{{BUCKET_URL}}/org_fit789/logo/file_fit123.png","createdAt":"2025-09-23T08:15:30.254Z","updatedAt":"2025-09-23T08:15:30.254Z","appleAppId":"orgaplapp_FIT789xyz012","orgId":"org_abc123DEF456","userId":"user_creator123","trackedAccounts":142,"appleApp":{"id":"orgaplapp_FIT789xyz012","title":"FitTracker - Workout Planner","appleIdentifier":"6474123456"}},{"id":"orgproj_MuS456iC789","name":"MusicHub","url":"https://musichub.fm","description":"Social music discovery platform connecting artists and fans","logo":"{{BUCKET_URL}}/org_music123/logo/file_music456.png","createdAt":"2025-09-22T14:30:15.123Z","updatedAt":"2025-09-22T14:30:15.123Z","appleAppId":null,"orgId":"org_abc123DEF456","userId":"user_creator456","trackedAccounts":75,"appleApp":null},{"id":"orgproj_FoO789dApp","name":"TasteBlend","url":"https://tasteblend.io","description":null,"logo":null,"createdAt":"2025-09-21T09:45:22.789Z","updatedAt":"2025-09-21T09:45:22.789Z","appleAppId":null,"orgId":"org_abc123DEF456","userId":"user_creator789","trackedAccounts":0,"appleApp":null}],"totalCount":12,"page":1,"perPage":10,"totalPages":2}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"post":{"operationId":"projects.create","summary":"Create a new project","description":"Creates a new project for organizing and tracking content across different platforms and accounts.","tags":["Projects"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"Project name","examples":["My Project"]},"url":{"anyOf":[{"type":"string","maxLength":4096,"description":"URL","examples":["https://www.myproject.com"]},{"const":""}],"description":"Project URL","examples":["https://www.myproject.com"]},"description":{"type":"string","maxLength":500,"description":"Project description","examples":["My Project description"]},"logo":{"type":"string","description":"Project logo"},"appleAppId":{"anyOf":[{"type":"string","pattern":"^orgaplapp_[0-9a-zA-Z]{12}$"},{"type":"null"}],"description":"Apple app ID","examples":["orgaplapp_1A2B3C4D5E6F"]}},"required":["name"],"description":"Request to create a new project for organizing content tracking","examples":[{"name":"Holiday Campaign 2024","url":"https://www.example.com/holiday-campaign","description":"Winter holiday marketing campaign across all social platforms","logo":"https://www.example.com/images/holiday-logo.png","appleAppId":"orgaplapp_R4W8KPM5YTB9"},{"name":"Product Launch","url":"","description":"New product launch tracking project","logo":null,"appleAppId":null}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"appleAppId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"}},"required":["id","name","url","description","logo","appleAppId","createdAt","updatedAt","actorType","userId","orgId"],"description":"Created project with all database fields and generated ID","examples":[{"id":"orgproj_RwmraAffhMt9","name":"Holiday Campaign 2024","url":"https://www.example.com/holiday-campaign","description":"Winter holiday marketing campaign across all social platforms","logo":"https://www.example.com/images/holiday-logo.png","appleAppId":"orgaplapp_R4W8KPM5YTB9","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-01-15T10:00:00.000Z","userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"APPLE_APP_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"The Apple app was not found or you do not have permission to use it"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_UNIQUE"},"status":{"const":409},"message":{"type":"string","default":"Couldn't create project"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/projects/{id}":{"put":{"operationId":"projects.update","summary":"Update an existing project","description":"Updates project details including name, description, and associated Apple app integrations.","tags":["Projects"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":50,"description":"Project name","examples":["My Project"]},"url":{"anyOf":[{"type":"string","maxLength":4096,"description":"URL","examples":["https://www.myproject.com"]},{"const":""}],"description":"Project URL","examples":["https://www.myproject.com"]},"description":{"type":"string","maxLength":500,"description":"Project description","examples":["My Project description"]},"logo":{"type":"string","description":"Project logo"},"appleAppId":{"anyOf":[{"type":"string","pattern":"^orgaplapp_[0-9a-zA-Z]{12}$"},{"type":"null"}],"description":"Apple app ID","examples":["orgaplapp_1A2B3C4D5E6F"]}},"description":"Request to update an existing project","examples":[{"name":"Holiday Campaign 2025","url":"https://www.example.com/holiday-campaign-2025","description":"Updated winter holiday marketing campaign for 2025","logo":"https://www.example.com/images/holiday-logo-2025.png","appleAppId":"orgaplapp_M5YTB9R4W8KP"},{"description":"Updated product launch description"}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"logo":{"anyOf":[{"type":"string"},{"type":"null"}]},"appleAppId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"}},"required":["id","name","url","description","logo","appleAppId","createdAt","updatedAt","actorType","userId","orgId"],"description":"Updated project with all database fields","examples":[{"id":"orgproj_RwmraAffhMt9","name":"Holiday Campaign 2025","url":"https://www.example.com/holiday-campaign-2025","description":"Updated winter holiday marketing campaign for 2025","logo":"https://www.example.com/images/holiday-logo-2025.png","appleAppId":"orgaplapp_2B3C4D5E6F7G","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T15:30:00.000Z","userId":"user_PxyfnFj5JUx5","orgId":"org_GbuDqv3RjdSW"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"APPLE_APP_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"The Apple app was not found or you do not have permission to use it"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"delete":{"operationId":"projects.delete","summary":"Delete a project","description":"Permanently deletes a project and all its associations with accounts and content.","tags":["Projects"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{},{"not":{}}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/projects/{projectId}/accounts/{accountId}":{"post":{"operationId":"projects.addToAccount","summary":"Associate account with project","description":"Adds a tracked account to a project for organized content tracking and analytics.","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"projectId":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}},"required":["accountId","projectId"],"description":"Result of associating a project with a tracked account","examples":[{"accountId":"orgacc_W97M6KLWV4Yq","projectId":"orgproj_RwmraAffhMt9"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"delete":{"operationId":"projects.removeFromAccount","summary":"Remove account from project","description":"Removes the association between a tracked account and a project.","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}},{"name":"accountId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"not":{},"description":"Successful project-account association removal. Returns empty response on success."},{"not":{}}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/projects/{projectId}/accounts/bulk":{"post":{"operationId":"projects.bulkAddToProject","summary":"Bulk add accounts to project","description":"Associates multiple tracked accounts with a project in one operation.","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs for bulk operations","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"]]}},"required":["accountIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"successCount":{"type":"number"},"failedCount":{"type":"number"},"totalRequested":{"type":"number"},"failedAccountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}},"required":["successCount","failedCount","totalRequested"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"delete":{"operationId":"projects.bulkRemoveFromProject","summary":"Bulk remove accounts from project","description":"Removes the association between multiple tracked accounts and a project.","tags":["Projects"],"parameters":[{"name":"projectId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgproj_.*","description":"Organization project ID with orgproj_ prefix"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"description":"Organization account IDs for bulk operations","examples":[["orgacc_1A2B3C4D5E6F"],["orgacc_1A2B3C4D5E6F","orgacc_2B3C4D5E6F7G"]]}},"required":["accountIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"successCount":{"type":"number"},"failedCount":{"type":"number"},"totalRequested":{"type":"number"},"failedAccountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}},"required":["successCount","failedCount","totalRequested"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators":{"get":{"operationId":"creators.list","summary":"List all creators with user information","description":"Retrieves paginated creators with comprehensive user data including names, emails, and profile information. Supports searching by creator name or email address. Returns creator metadata with associated user details for organization management, campaign assignment, and collaboration workflows.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"anyOf":[{"enum":["name","status","email","firstName","lastName","createdAt","updatedAt"],"type":"string"},{"type":"string"}],"default":"createdAt","description":"Sort column","examples":["name","status","email","createdAt"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"campaigns","in":"query","schema":{"type":"array","items":{"type":"string"},"description":"Filter by the creator's latest campaign assignment."},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"type":"array","items":{"enum":["active","archived"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"creatorUserId":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"banReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"creatorProfileId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","emailVerified","image","createdAt","updatedAt","role","banned","banReason","banExpires","firstName","lastName","creatorProfileId"]},"createdByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"banReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"creatorProfileId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","emailVerified","image","createdAt","updatedAt","role","banned","banReason","banExpires","firstName","lastName","creatorProfileId"]},{"type":"null"}]},"creatorProfile":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["id","address","city","postalCode","countryCode","phoneNumber","createdAt","updatedAt"]},{"type":"null"}]},"member":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"null"}]},"invitation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date"},"status":{"enum":["pending","accepted","rejected","canceled"],"type":"string"}},"required":["id","expiresAt","status"]},{"type":"null"}]},"status":{"enum":["not invited","invitation sent","invitation rejected","joined"],"type":"string"},"creatorStatus":{"enum":["active","archived"],"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]}},"activeCampaign":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},{"type":"null"}]},"activeCampaignEndsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignDisplay":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"currency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignmentValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignmentValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"billingAnchor":{"enum":["rolling","fixed"],"type":"string"},"description":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}]}},"required":["id","name","status","startDate","endDate"]},{"type":"null"}]},"campaignProrationApplied":{"anyOf":[{"type":"boolean"},{"type":"null"}]}},"required":["id","creatorUserId","notes","createdAt","updatedAt","deletedAt","actorType","userId","orgId","user","status","creatorStatus","accounts"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"post":{"operationId":"creators.create","summary":"Create a new creator","description":"Creates a new creator user and associates them with the organization. The creator will not have authentication credentials initially and would need to be invited or set up auth separately.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","minLength":1,"maxLength":50,"description":"User's first name","examples":["John","Jane"]},"lastName":{"type":"string","maxLength":50},"email":{"type":"string","format":"email"},"invite":{"type":"boolean"},"accountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}},"notes":{"type":"string"}},"required":["firstName","lastName","email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"creatorUserId":{"type":"string"}},"required":["id","creatorUserId"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"USER_HAS_NON_CREATOR_MEMBERSHIP"},"status":{"const":409},"message":{"type":"string","default":"This user already has a non-creator membership in an organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ALREADY_EXISTS"},"status":{"const":409},"message":{"type":"string","default":"This creator already exists in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/count":{"get":{"operationId":"creators.count","summary":"Count creators by status","description":"Returns creator counts for active/archived status filters.","tags":["Creator Hub"],"parameters":[{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"type":"array","items":{"enum":["active","archived"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["total"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/{id}":{"get":{"operationId":"creators.get","summary":"Get creator details by ID","description":"Retrieves detailed information about a specific creator including comprehensive user data, invitation status, associated tracked social media accounts, and profile information. Returns null if the creator is not found or doesn't belong to your organization. This endpoint provides all necessary data for viewing creator profiles and managing creator-account associations.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"creatorUserId":{"type":"string"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"actorType":{"enum":["user","system","api_token"],"type":"string"},"userId":{"type":"string"},"orgId":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"banReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"creatorProfileId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","emailVerified","image","createdAt","updatedAt","role","banned","banReason","banExpires","firstName","lastName","creatorProfileId"]},"createdByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"banned":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"banReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"banExpires":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"firstName":{"type":"string"},"lastName":{"type":"string"},"creatorProfileId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","emailVerified","image","createdAt","updatedAt","role","banned","banReason","banExpires","firstName","lastName","creatorProfileId"]},{"type":"null"}]},"creatorProfile":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"address":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"countryCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"phoneNumber":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"}},"required":["id","address","city","postalCode","countryCode","phoneNumber","createdAt","updatedAt"]},{"type":"null"}]},"member":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"null"}]},"invitation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","x-native-type":"date"},"status":{"enum":["pending","accepted","rejected","canceled"],"type":"string"}},"required":["id","expiresAt","status"]},{"type":"null"}]},"status":{"enum":["not invited","invitation sent","invitation rejected","joined"],"type":"string"},"creatorStatus":{"enum":["active","archived"],"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]}},"activeCampaign":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},{"type":"null"}]},"activeCampaignEndsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignDisplay":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"currency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignmentValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"assignmentValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"billingAnchor":{"enum":["rolling","fixed"],"type":"string"},"description":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}]}},"required":["id","name","status","startDate","endDate"]},{"type":"null"}]},"campaignProrationApplied":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"campaignHistory":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcrcampaign_.*"},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaign":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"currency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"validFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-2147483648,"maximum":2147483647},"billingAnchor":{"enum":["rolling","fixed"],"type":"string"},"description":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}]}},"required":["id","name","status"]}},"required":["id","validFrom","validUntil","campaign"]}}},"required":["id","creatorUserId","notes","createdAt","updatedAt","deletedAt","actorType","userId","orgId","user","status","creatorStatus","accounts","campaignHistory"]},{"type":"null"}],"description":"Creator details with user information, accounts, and invitation status. Returns null if creator not found or doesn't belong to organization.","examples":[{"id":"orgcre_1A2B3C4D5E6F","orgId":"org_abc123DEF456","creatorUserId":"user_xyz789ABC012","notes":"Fashion content creator specializing in sustainable brands","userId":"user_admin123ABC","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-01-15T10:00:00.000Z","user":{"id":"user_xyz789ABC012","name":"Sarah Johnson","firstName":"Sarah","lastName":"Johnson","email":"sarah.johnson@example.com","emailVerified":true,"image":null,"createdAt":"2025-01-15T09:30:00.000Z","updatedAt":"2025-01-15T09:30:00.000Z","creatorProfileId":"creprof_abc123XYZ","ssoUserId":null},"createdByUser":{"id":"user_admin123ABC","name":"Admin User","firstName":"Admin","lastName":"User","email":"admin@company.com","emailVerified":true,"image":null,"createdAt":"2025-01-01T08:00:00.000Z","updatedAt":"2025-01-01T08:00:00.000Z","creatorProfileId":null,"ssoUserId":null},"creatorProfile":{"id":"creprof_abc123XYZ","bio":"Sustainable fashion influencer | Eco-conscious living","userId":"user_xyz789ABC012","createdAt":"2025-01-15T09:30:00.000Z","updatedAt":"2025-01-15T09:30:00.000Z"},"member":{"id":"orgmem_creator123ABC"},"invitation":null,"status":"joined","accounts":[{"id":"orgacc_1A2B3C4D5E6F","platform":"instagram","platformAccountId":"17841405822304914","username":"sarah_sustainable"},{"id":"orgacc_2B3C4D5E6F7G","platform":"tiktok","platformAccountId":"7123456789012345678","username":"sarahsustainablestyle"}],"campaignDisplay":{"id":"campaign_abc123","name":"Creator Program","status":"active","startDate":"2025-01-01","endDate":null}},null]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found or doesn't belong to your organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"put":{"operationId":"creators.update","summary":"Update creator details","description":"Updates creator user information including first name, last name, and email address. The creator must exist in the organization and the email must not be in use by another user.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"firstName":{"type":"string","minLength":1,"maxLength":50,"description":"User's first name","examples":["John","Jane"]},"lastName":{"type":"string","maxLength":50},"accountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}},"notes":{"type":"string"}},"description":"Request to update an existing creator","examples":[{"firstName":"John","lastName":"Doe","email":"john.doe@example.com","accountIds":["orgacc_abc123","orgacc_def456"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"creatorUserId":{"type":"string"}},"required":["id","creatorUserId"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"USER_EMAIL_VERIFIED"},"status":{"const":403},"message":{"type":"string","default":"Cannot update name or email for verified users. User manages their own profile."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Archived creators cannot be edited"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"EMAIL_ALREADY_IN_USE"},"status":{"const":409},"message":{"type":"string","default":"Email address is already in use by another user"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}},"delete":{"operationId":"creators.delete","summary":"Delete creator","description":"Deletes a creator from the organization. If the user has not verified their email and this is their only creator profile, the user account will also be deleted. Otherwise, only the creator profile and membership are removed.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"The organization creator ID to delete","examples":["orgcre_abc123DEF456"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates if the operation was successful"},"deletedUser":{"type":"boolean","description":"Indicates if the user account was also deleted (true when user had unverified email and this was their only creator profile)"},"message":{"type":"string","description":"Optional message describing the operation result"}},"required":["success","deletedUser"],"description":"Response for deleting a creator","examples":[{"success":true,"deletedUser":false,"message":"Creator deleted successfully (user account preserved)"},{"success":true,"deletedUser":true,"message":"Creator and user account deleted successfully"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"USER_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"User not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_HAS_ASSIGNMENTS"},"status":{"const":409},"message":{"type":"string","default":"Creator has campaign assignment history"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_HAS_PAYOUTS"},"status":{"const":409},"message":{"type":"string","default":"Creator has paid payout history"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_HAS_CANCELED_PAYOUTS"},"status":{"const":409},"message":{"type":"string","default":"Creator has canceled payout history"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/{id}/invite":{"post":{"operationId":"creators.invite","summary":"Invite creator to organization","description":"Sends an invitation email to a creator with the 'creator' role. The creator must exist in the organization and have a valid email address. Supports resending invitations.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"The organization creator ID to invite","examples":["orgcre_abc123DEF456"]}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"resend":{"type":"boolean","default":false,"description":"Whether to resend the invitation if one already exists","examples":[false,true]}},"description":"Parameters for inviting a creator to the organization","examples":[{"resend":false}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"not":{}},{"not":{}}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_EMAIL_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator email not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Archived creators cannot be invited"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/invitation":{"delete":{"operationId":"creators.revokeInvitation","summary":"Revoke creator invitation","description":"Cancels a pending invitation for a creator. The invitation must belong to the current organization. This removes the invitation from the system and prevents the creator from accepting it.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invitationId":{"type":"string","pattern":"^(orginv|inv)_[0-9a-zA-Z]{12}$","description":"The invitation ID to revoke","examples":["orginv_abc123DEF456"]}},"required":["invitationId"],"description":"Parameters for revoking a creator invitation","examples":[{"invitationId":"orginv_abc123DEF456"}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}},"required":["success"],"description":"Response for revoking an invitation","examples":[{"success":true,"message":"Invitation revoked successfully"}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"403":{"description":"403","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":403},"message":{"type":"string","default":"This invitation does not belong to your organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INVITATION_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Invitation not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/campaigns/assign":{"post":{"operationId":"creators.assignCampaign","summary":"Assign creators to campaign","description":"Assign one or more creators to a campaign. Enforces single active campaign per creator.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"creatorIds":{"type":"array","minItems":1,"items":{"type":"string"}},"campaignId":{"type":"string"},"startBasis":{"enum":["prev","current","next","custom"],"type":"string"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["creatorIds","campaignId","startBasis"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["updated"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INVALID_ROLLING_BASIS"},"status":{"const":400},"message":{"type":"string","default":"Rolling anchors require a custom date"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INVALID_FIXED_START_DATE"},"status":{"const":400},"message":{"type":"string","default":"Fixed anchors require a billing cycle start date"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"START_BEFORE_CAMPAIGN"},"status":{"const":400},"message":{"type":"string","default":"Assignments cannot start before the campaign starts"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CAMPAIGN_ENDS_BEFORE_CYCLE"},"status":{"const":400},"message":{"type":"string","default":"Campaign ends before the selected billing cycle completes"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CAMPAIGN_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Campaign not found or inactive"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"One or more creators not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Archived creators cannot be assigned"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ALREADY_ASSIGNED"},"status":{"const":409},"message":{"type":"string","default":"One or more creators already have an active campaign"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"START_OVERLAPS_EXISTING_ASSIGNMENT"},"status":{"const":409},"message":{"type":"string","default":"Start date overlaps an existing campaign assignment"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/campaigns/unassign":{"post":{"operationId":"creators.unassignCampaign","summary":"Unassign creators from campaign","description":"Ends the active campaign assignment for one or more creators. All creators must share the same active campaign.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"creatorIds":{"type":"array","minItems":1,"items":{"type":"string"}},"endBasis":{"enum":["prev","current","next","custom"],"type":"string"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["creatorIds","endBasis"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"updated":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["updated"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INVALID_END_DATE"},"status":{"const":400},"message":{"type":"string","default":"End date must align to a billing cycle"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creators not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Archived creators cannot be unassigned"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"ACTIVE_ASSIGNMENT_REQUIRED"},"status":{"const":409},"message":{"type":"string","default":"Creators must have an active assignment to unassign"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"MIXED_CAMPAIGNS"},"status":{"const":409},"message":{"type":"string","default":"Selected creators are not in the same active campaign"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYOUTS_ALREADY_ISSUED"},"status":{"const":409},"message":{"type":"string","default":"Cannot end assignments before paid or canceled payout periods"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/{id}/unarchive":{"post":{"operationId":"creators.unarchive","summary":"Unarchive creator","description":"Restores a previously archived creator to active status.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"The organization creator ID to unarchive","examples":["orgcre_abc123DEF456"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Creator is already active"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creators/{id}/accounts":{"post":{"operationId":"creators.updateAccounts","summary":"Update creator account associations","description":"Replaces all tracked account associations for a creator with the provided list. Supports force override to reassign accounts from other creators.","tags":["Creator Hub"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}},"force":{"type":"boolean","default":false}},"required":["accountIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"accountIds":{"type":"array","items":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."}}},"required":["accountIds"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Creator not found in this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"ACCOUNTS_NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Some accounts were not found or don't belong to this organization"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"CREATOR_ARCHIVED"},"status":{"const":409},"message":{"type":"string","default":"Archived creators cannot be edited"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":true},"code":{"const":"ACCOUNTS_ALREADY_ASSIGNED"},"status":{"const":409},"message":{"type":"string","default":"Some accounts are already assigned to other creators."},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/campaigns/count":{"get":{"operationId":"campaigns.count","summary":"Count campaigns","description":"Returns the total number of campaigns matching optional status, search, and creator filters.","tags":["Creator Hub"],"parameters":[{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"type":"array","items":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["total"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/campaigns":{"get":{"operationId":"campaigns.list","summary":"List campaigns","description":"Retrieves campaigns including cadence, billing anchor, and rule metadata for the current organization.","tags":["Creator Hub"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","description":"Search by campaign name or description","examples":["Retention","Creator Accelerator"]},"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"type":"array","items":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"description":"Filter campaigns by one or more derived statuses: upcoming (validFrom in future), active (started with no end date), closing (has end date in present/future), ended (validUntil in the past). When omitted defaults to current campaigns (upcoming, active, closing).","examples":[["upcoming","active","closing"]]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"description":"Filter campaigns by creators they are assigned to","examples":[["orgcre_ABC123","orgcre_XYZ789"]]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["rolling","fixed"],"type":"string"},"timeZone":{"enum":["UTC"],"type":"string"},"videoTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"validFrom":{"type":"string","format":"date-time","x-native-type":"date"},"validUntil":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"orgId":{"type":"string","pattern":"^org_.*","description":"Organization ID with org_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"actorType":{"enum":["user","system","api_token"],"type":"string"},"rules":{"type":"array","items":{"anyOf":[{},{"type":"null"}]}},"createdByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]},{"type":"null"}]},"creatorSummary":{"type":"object","properties":{"totalCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"activeCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"activeCreators":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]}},"required":["id","user"]}}},"required":["totalCount","activeCount","activeCreators"],"description":"Creator summary scoped to current or scheduled assignments (valid_until is NULL or in the future). totalCount still reflects all historical assignments."},"warnings":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"const":"tracking_limit_low"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]}},"required":["id","user"]},"videoTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"requiredMaxVideos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"accounts":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxVideos":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","platform","platformAccountId","username","maxVideos"]}}},"required":["type","creator","videoTarget","requiredMaxVideos","accounts"]},{"type":"object","properties":{"type":{"const":"manual_video_tracking"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"user":{"type":"object","properties":{"id":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]}},"required":["id","user"]},"videoTarget":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"requiredMaxVideos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"accounts":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"maxVideos":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["id","platform","platformAccountId","username","maxVideos"]}}},"required":["type","creator","videoTarget","requiredMaxVideos","accounts"]}]}}},"required":["id","name","description","currency","interval","intervalCount","billingAnchor","timeZone","videoTarget","validFrom","validUntil","status","createdAt","updatedAt","orgId","userId","actorType","rules","createdByUser","creatorSummary","warnings"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated list of campaigns with cadence and anchor metadata","examples":[{"data":[{"id":"orgcamp_ABC123456789","name":"Monthly Retainer","description":"Baseline cadence for recurring creators","currency":"USD","interval":"month","intervalCount":1,"billingAnchor":"fixed","timeZone":"UTC","videoTarget":4,"validFrom":"2025-01-01","validUntil":null,"createdAt":"2025-01-02T15:00:00.000Z","updatedAt":"2025-02-15T11:30:00.000Z","orgId":"org_1234567890","userId":"user_0987654321","actorType":"user","rules":[],"createdByUser":{"id":"user_0987654321","name":"Alex Johnson","email":"alex@example.com","image":null},"warnings":[]}],"pageCount":1,"totalRows":1}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creator-hub/overview/kpis":{"get":{"operationId":"creatorHubOverview.kpis","summary":"Get Creator Hub overview KPIs","description":"Returns Creator Hub overview metrics for assigned creators, eligible activity, spend, and CPM.","tags":["Creator Hub"],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"enum":["dateRange","allTime"],"type":"string","default":"dateRange"},"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","required":true,"schema":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"scope":{"const":"allTime"},"metrics":{"type":"object","properties":{"effectiveCpm":{"type":"number","description":"Effective CPM based on payouts and views for the KPI period"},"totalViews":{"type":"number","description":"Eligible views for the KPI period"},"activeCreators":{"type":"number","description":"Distinct active creators who posted eligible videos in the KPI period"},"activeAccounts":{"type":"number","description":"Distinct active accounts that posted eligible videos in the KPI period"},"payoutsUsd":{"type":"number","description":"Total payouts in USD (major units) for the KPI period"},"publishedVideos":{"type":"number","description":"Eligible posted videos for the KPI period"},"eligibleVideos":{"type":"number","description":"Distinct eligible videos for the KPI period"},"spendPerVideo":{"type":"number","description":"Average payout per published video for the KPI period"},"paidCpm":{"type":"number","description":"Paid CPM based on paid payouts and views for the KPI period"},"paidPayoutsUsd":{"type":"number","description":"Paid payouts in USD (major units) for the KPI period"}},"required":["effectiveCpm","totalViews","activeCreators","activeAccounts","payoutsUsd","publishedVideos","eligibleVideos","spendPerVideo","paidCpm","paidPayoutsUsd"],"description":"All-time KPI totals for the campaign scope"},"eligibilityRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp of the last eligibility refresh (UTC ISO)"}},"required":["scope","metrics","eligibilityRefreshedAt"]},{"type":"object","properties":{"scope":{"const":"dateRange"},"metrics":{"type":"object","properties":{"effectiveCpm":{"type":"number","description":"Effective CPM based on payouts and views for the KPI period"},"totalViews":{"type":"number","description":"Eligible views for the KPI period"},"activeCreators":{"type":"number","description":"Distinct active creators who posted eligible videos in the KPI period"},"activeAccounts":{"type":"number","description":"Distinct active accounts that posted eligible videos in the KPI period"},"payoutsUsd":{"type":"number","description":"Total payouts in USD (major units) for the KPI period"},"publishedVideos":{"type":"number","description":"Eligible posted videos for the KPI period"},"eligibleVideos":{"type":"number","description":"Distinct eligible videos for the KPI period"},"spendPerVideo":{"type":"number","description":"Average payout per published video for the KPI period"},"paidCpm":{"type":"number","description":"Paid CPM based on paid payouts and views for the KPI period"},"paidPayoutsUsd":{"type":"number","description":"Paid payouts in USD (major units) for the KPI period"}},"required":["effectiveCpm","totalViews","activeCreators","activeAccounts","payoutsUsd","publishedVideos","eligibleVideos","spendPerVideo","paidCpm","paidPayoutsUsd"],"description":"KPI totals for the selected date range"},"previous":{"type":"object","properties":{"effectiveCpm":{"type":"number","description":"Effective CPM based on payouts and views for the KPI period"},"totalViews":{"type":"number","description":"Eligible views for the KPI period"},"activeCreators":{"type":"number","description":"Distinct active creators who posted eligible videos in the KPI period"},"activeAccounts":{"type":"number","description":"Distinct active accounts that posted eligible videos in the KPI period"},"payoutsUsd":{"type":"number","description":"Total payouts in USD (major units) for the KPI period"},"publishedVideos":{"type":"number","description":"Eligible posted videos for the KPI period"},"eligibleVideos":{"type":"number","description":"Distinct eligible videos for the KPI period"},"spendPerVideo":{"type":"number","description":"Average payout per published video for the KPI period"},"paidCpm":{"type":"number","description":"Paid CPM based on paid payouts and views for the KPI period"},"paidPayoutsUsd":{"type":"number","description":"Paid payouts in USD (major units) for the KPI period"}},"required":["effectiveCpm","totalViews","activeCreators","activeAccounts","payoutsUsd","publishedVideos","eligibleVideos","spendPerVideo","paidCpm","paidPayoutsUsd"],"description":"KPI totals for the previous period"},"changes":{"type":"object","properties":{"effectiveCpm":{"type":"number","description":"Effective CPM based on payouts and views for the KPI period"},"totalViews":{"type":"number","description":"Eligible views for the KPI period"},"activeCreators":{"type":"number","description":"Distinct active creators who posted eligible videos in the KPI period"},"activeAccounts":{"type":"number","description":"Distinct active accounts that posted eligible videos in the KPI period"},"payoutsUsd":{"type":"number","description":"Total payouts in USD (major units) for the KPI period"},"publishedVideos":{"type":"number","description":"Eligible posted videos for the KPI period"},"eligibleVideos":{"type":"number","description":"Distinct eligible videos for the KPI period"},"spendPerVideo":{"type":"number","description":"Average payout per published video for the KPI period"},"paidCpm":{"type":"number","description":"Paid CPM based on paid payouts and views for the KPI period"},"paidPayoutsUsd":{"type":"number","description":"Paid payouts in USD (major units) for the KPI period"}},"required":["effectiveCpm","totalViews","activeCreators","activeAccounts","payoutsUsd","publishedVideos","eligibleVideos","spendPerVideo","paidCpm","paidPayoutsUsd"],"description":"Percentage change vs previous period for each KPI"},"eligibilityRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Timestamp of the last eligibility refresh (UTC ISO)"}},"required":["scope","metrics","previous","changes","eligibilityRefreshedAt"]}],"description":"Creator Hub overview KPIs"}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creator-hub/overview/activity":{"get":{"operationId":"creatorHubOverview.activity","summary":"Get Creator Hub creator activity table","description":"Returns paginated creator activity rows with posted-video progress against rounded prorated campaign targets, averaged per-cycle progress, and recent 14-day post activity. Supports progress-based filtering (all, behind, onTrack) and defaults to sorting by progress ratio descending.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":5,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","required":false,"schema":{"enum":["creatorName","campaignName","postedVideos","eligibleVideos","targetVideos","progressRatio"],"type":"string","default":"progressRatio"},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc"},"allowEmptyValue":true,"allowReserved":true},{"name":"progressFilter","in":"query","required":false,"schema":{"enum":["all","behind","onTrack"],"type":"string","default":"all"},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","required":false,"schema":{"enum":["dateRange","allTime"],"type":"string","default":"dateRange"},"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","required":true,"schema":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creator":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"intervalDayCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"videoTarget":{"type":"integer","minimum":0,"maximum":9007199254740991},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","currency","interval","intervalCount","intervalDayCount","videoTarget","billingAnchor","status","validFrom","validUntil"]},"postedVideos":{"type":"number"},"eligibleVideos":{"type":"number"},"targetVideos":{"type":"number"},"progressRatio":{"type":"number"},"progressPercent":{"type":"number"},"averagedPostedVideos":{"type":"number"},"averagedTargetVideos":{"type":"number"},"averagedProgressRatio":{"type":"number"},"averagedProgressPercent":{"type":"number"},"postActivity":{"type":"object","properties":{"dayCount":{"const":14},"days":{"type":"array","minItems":14,"maxItems":14,"items":{"type":"object","properties":{"date":{"type":"string"},"postedVideos":{"type":"number"}},"required":["date","postedVideos"]}}},"required":["dayCount","days"]},"lastVideo":{"anyOf":[{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"publishedDate":{"type":"string"},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["platform","platformVideoId","caption","thumbnailUrl","accountUsername","contentType","publishedDate","publishedAt"]},{"type":"null"}]}},"required":["id","creatorId","creator","campaign","postedVideos","eligibleVideos","targetVideos","progressRatio","progressPercent","averagedPostedVideos","averagedTargetVideos","averagedProgressRatio","averagedProgressPercent","postActivity","lastVideo"]}},"resolvedRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"eligibilityRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"totals":{"type":"object","properties":{"rowCount":{"type":"number"},"postedVideos":{"type":"number"},"eligibleVideos":{"type":"number"},"targetVideos":{"type":"number"}},"required":["rowCount","postedVideos","eligibleVideos","targetVideos"]},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","resolvedRange","eligibilityRefreshedAt","totals","pageCount","totalRows"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creator-hub/overview/performance":{"get":{"operationId":"creatorHubOverview.performance","summary":"Get Creator Hub creator performance table","description":"Returns paginated creator performance rows with engagement and virality metrics for eligible videos.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":5,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","required":false,"schema":{"enum":["creatorName","campaignName","totalPosts","totalVideosEligible","totalViews","creatorCpm","totalLikes","totalComments","totalShares","totalBookmarks","engagementRate","viralityRate"],"type":"string","default":"totalViews"},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc"},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","required":false,"schema":{"enum":["dateRange","allTime"],"type":"string","default":"dateRange"},"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","required":true,"schema":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creator":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","image"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","description","currency","interval","intervalCount","billingAnchor","status","validFrom","validUntil"]},"totalPosts":{"type":"number"},"totalVideosEligible":{"type":"number"},"totalViews":{"type":"number"},"creatorCpm":{"type":"number"},"totalLikes":{"type":"number"},"totalComments":{"type":"number"},"totalShares":{"type":"number"},"totalBookmarks":{"type":"number"},"engagementRate":{"type":"number"},"viralityRate":{"type":"number"},"topVideo":{"anyOf":[{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string","minLength":1,"description":"Native platform video id found in the URL of the video","examples":["7123456789012345678","z1234567890"]},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"publishedDate":{"type":"string"},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewGain":{"type":"number"}},"required":["platform","platformVideoId","caption","thumbnailUrl","accountUsername","contentType","publishedDate","publishedAt","viewGain"]},{"type":"null"}]}},"required":["id","creatorId","creator","campaign","totalPosts","totalVideosEligible","totalViews","creatorCpm","totalLikes","totalComments","totalShares","totalBookmarks","engagementRate","viralityRate","topVideo"]}},"resolvedRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"eligibilityRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"totals":{"type":"object","properties":{"rowCount":{"type":"number"},"totalPosts":{"type":"number"},"totalVideosEligible":{"type":"number"},"totalViews":{"type":"number"},"totalLikes":{"type":"number"},"totalComments":{"type":"number"},"totalShares":{"type":"number"},"totalBookmarks":{"type":"number"}},"required":["rowCount","totalPosts","totalVideosEligible","totalViews","totalLikes","totalComments","totalShares","totalBookmarks"]},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","resolvedRange","eligibilityRefreshedAt","totals","pageCount","totalRows"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/creator-hub/overview/events":{"get":{"operationId":"creatorHubOverview.events","summary":"Get Creator Hub overview events feed","description":"Returns timeline events across campaign lifecycle, creator assignments, posted videos, cycles, and payouts.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","required":false,"schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"scope","in":"query","required":false,"schema":{"enum":["dateRange","allTime"],"type":"string","default":"dateRange"},"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","required":true,"schema":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"publicationMode","in":"query","required":false,"schema":{"enum":["allEligible","onlyPublished"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"eventCategory","in":"query","required":false,"schema":{"enum":["all","campaign","videos"],"type":"string","default":"all"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"campaign_created"}},"required":["id","occurredAt","campaign","type"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"campaign_started"}},"required":["id","occurredAt","campaign","type"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"campaign_ended"}},"required":["id","occurredAt","campaign","type"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"creator_joined_campaign"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","userId","name","email"]}},"required":["id","occurredAt","campaign","type","creator"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"creator_left_campaign"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","userId","name","email"]}},"required":["id","occurredAt","campaign","type","creator"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"creator_posted_video"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","userId","name","email"]},"video":{"type":"object","properties":{"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string","minLength":1}},"required":["platform","platformVideoId"]}},"required":["id","occurredAt","campaign","type","creator","video"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"campaign_cycle_started"},"cycle":{"type":"object","properties":{"windowStart":{"type":"string"},"windowEnd":{"type":"string"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["windowStart","windowEnd","interval","intervalCount","billingAnchor"]}},"required":["id","occurredAt","campaign","type","cycle"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"campaign_cycle_ended"},"cycle":{"type":"object","properties":{"windowStart":{"type":"string"},"windowEnd":{"type":"string"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["windowStart","windowEnd","interval","intervalCount","billingAnchor"]}},"required":["id","occurredAt","campaign","type","cycle"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"creator_paid_out"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","userId","name","email"]},"payout":{"type":"object","properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"precision":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"billingPeriodStart":{"type":"string"},"billingPeriodEnd":{"type":"string"}},"required":["amount","precision","currency","billingPeriodStart","billingPeriodEnd"]}},"required":["id","occurredAt","campaign","type","creator","payout"]},{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string"},"campaign":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"name":{"type":"string"},"status":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"validFrom":{"type":"string"},"validUntil":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","status","validFrom","validUntil"]},"type":{"const":"creator_payout_canceled"},"creator":{"type":"object","properties":{"id":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"userId":{"type":"string","pattern":"^user_.*","description":"User ID with user_ prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"}},"required":["id","userId","name","email"]},"payout":{"type":"object","properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"precision":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"billingPeriodStart":{"type":"string"},"billingPeriodEnd":{"type":"string"}},"required":["amount","precision","currency","billingPeriodStart","billingPeriodEnd"]}},"required":["id","occurredAt","campaign","type","creator","payout"]}]}},"resolvedRange":{"type":"object","properties":{"from":{"type":"string","description":"Start date in ISO format (YYYY-MM-DD)"},"to":{"type":"string","description":"End date in ISO format (YYYY-MM-DD)"}},"required":["from","to"],"description":"Date range filter for analytics queries","examples":[{"from":"2025-01-01","to":"2025-01-31"},{"from":"2025-12-01","to":"2025-12-31"}]},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","resolvedRange","pageCount","totalRows"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/counts":{"get":{"operationId":"payouts.counts","summary":"Count payouts by status","description":"Returns counts for upcoming, due, canceled, and paid payouts. Use `statuses` to limit which counts are returned.","tags":["Creator Hub"],"parameters":[{"name":"campaignIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"statuses","in":"query","schema":{"type":"array","minItems":1,"items":{"enum":["upcoming","due","canceled","paid"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"referenceDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"upcoming":{"type":"integer","minimum":0,"maximum":9007199254740991},"due":{"type":"integer","minimum":0,"maximum":9007199254740991},"canceled":{"type":"integer","minimum":0,"maximum":9007199254740991},"paid":{"type":"integer","minimum":0,"maximum":9007199254740991}}}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/due":{"get":{"operationId":"payouts.due","summary":"List due creator payouts","description":"Returns completed billing periods that have no recorded payouts yet. Uses campaign billing anchors and creator assignment windows to surface only fully finished periods.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"includeEmpty","in":"query","schema":{"type":"boolean","default":true},"allowEmptyValue":true,"allowReserved":true},{"name":"mode","in":"query","schema":{"enum":["data","count"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"referenceDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"campaignName":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creatorUserId":{"type":"string"},"creatorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorEmail":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaignStatus":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"campaignValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"timeZone":{"enum":["UTC"],"type":"string"},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"payoutAmount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutPrecision":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"calculationRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"analyticsDataRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","campaignId","campaignName","creatorId","creatorUserId","creatorName","creatorEmail","billingPeriodStart","billingPeriodEnd","interval","intervalCount","billingAnchor","timeZone","currency","payoutAmount","payoutPrecision","payoutCurrency","calculationRefreshedAt","analyticsDataRefreshedAt"]}}},"required":["page","perPage","total","data"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/calculate":{"post":{"operationId":"payouts.calculate","summary":"Calculate payout details","description":"Runs the payout engine for a specific creator and billing window, returning the finalized calculation payload, the default server-generated line items, and an `integrityToken`. Use the returned `calculation` plus `integrityToken` as the basis for `POST /payouts/initiate` when you need custom line items.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"billingPeriodStart":{"type":"string","minLength":1},"billingPeriodEnd":{"type":"string","minLength":1}},"required":["campaignId","creatorId","billingPeriodStart","billingPeriodEnd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"label":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"}},"required":["index","label","start","end"]},"payouts":{"type":"object","properties":{"total":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"breakdown":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ruleName":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventType":{"enum":["flat","rate","rate_min_max"],"type":"string"},"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"},"calculationDetails":{"anyOf":[{"type":"object","properties":{"metricKey":{"type":"string"},"metricValue":{"type":"number"},"rawMetricValue":{"type":"number"},"metricStartValue":{"type":"number"},"metricEndValue":{"type":"number"},"eligibleVideoCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"ratePerUnit":{"type":"number"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"appliedTierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"tierBreakdown":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"calculationType":{"const":"rate"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"rate":{"type":"number"},"perQuantity":{"type":"number","exclusiveMinimum":0},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","rate","payout"]},{"type":"object","properties":{"calculationType":{"const":"flat"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","payout"]}]}},"maxPayoutApplied":{"type":"boolean"}},"required":["metricKey","metricValue"]},{"type":"null"}]}},"required":["label","ruleName","eventType","amount","precision","currency","value","calculationDetails"]}}},"required":["total","breakdown"]},"metrics":{"type":"object","properties":{"facts":{"type":"array","items":{"type":"object","properties":{"factName":{"type":"string"},"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"label":{"type":"string"},"total":{"type":"number"}},"required":["factName","metric","label","total"]}},"perVideo":{"anyOf":[{"type":"object","properties":{"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"label":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string"},"value":{"type":"number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCompetitor":{"type":"boolean"},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"orgAccountId":{"anyOf":[{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},{"type":"null"}]},"payoutAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"payoutValue":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","platform","platformVideoId","value","title","thumbnailUrl","publishedAt","accountUsername","platformAccountId","isCompetitor","contentType","orgAccountId","payoutAmount","payoutCurrency","payoutValue"]}}},"required":["metric","label","items"]},{"type":"null"}]},"perCategory":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"metricKey":{"type":"string"},"metricLabel":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string"},"value":{"type":"number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCompetitor":{"type":"boolean"},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"orgAccountId":{"anyOf":[{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},{"type":"null"}]},"payoutAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"payoutValue":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","platform","platformVideoId","value","title","thumbnailUrl","publishedAt","accountUsername","platformAccountId","isCompetitor","contentType","orgAccountId","payoutAmount","payoutCurrency","payoutValue"]}}},"required":["category","metric","metricKey","metricLabel","items"]}},{"type":"null"}]}},"required":["facts","perVideo","perCategory"]},"engine":{"type":"object","properties":{"prorationFactor":{"type":"number"},"rulesSnapshot":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^rule_[0-9a-zA-Z]{12}$"},"conditions":{"anyOf":[{"type":"object","properties":{"all":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["lessThan","lessThanInclusive","greaterThan","greaterThanInclusive"],"type":"string"},"value":{"type":"number"}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["equal","notEqual"],"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["in","notIn","contains","doesNotContain"],"type":"string"},"value":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}}},"required":["fact","operator","value"]}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all"]},{"type":"object","properties":{"any":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["lessThan","lessThanInclusive","greaterThan","greaterThanInclusive"],"type":"string"},"value":{"type":"number"}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["equal","notEqual"],"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["in","notIn","contains","doesNotContain"],"type":"string"},"value":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}}},"required":["fact","operator","value"]}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["any"]},{"type":"object","properties":{"not":{"anyOf":[{"type":"object","properties":{"all":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{},"operator":{},"value":{}}},{"type":"object","properties":{"fact":{},"operator":{},"value":{}}},{"type":"object","properties":{"fact":{},"operator":{},"value":{}}}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all"]},{"type":"object","properties":{"any":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{},"operator":{},"value":{}}},{"type":"object","properties":{"fact":{},"operator":{},"value":{}}},{"type":"object","properties":{"fact":{},"operator":{},"value":{}}}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["any"]},{"type":"object","properties":{"not":{"anyOf":[{"type":"object","properties":{"all":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all"]},{"type":"object","properties":{"any":{"type":"array","minItems":1,"items":{"anyOf":[{},{"type":"null"}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["any"]},{"type":"object","properties":{"not":{},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}}]},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["not"]}]},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["not"]}]},"event":{"anyOf":[{"type":"object","properties":{"type":{"const":"flat"},"params":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"global"}},"required":["amount","precision","source"]},{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{"anyOf":[{},{}]},{"type":"null"}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{},"direction":{}}}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{},"on":{},"type":{}}}}},"required":["select","from","agg","as"]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"mode":{"enum":["progressive","allocation"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"rangeMin":{"type":"number"},"rangeMax":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["amount","precision","source","query"]}]}},"required":["type","params"]},{"type":"object","properties":{"type":{"const":"rate"},"params":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{},"column":{},"value":{}}},{"type":"object","properties":{"type":{},"sql":{}}}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{},"column":{},"value":{}}},{"type":"object","properties":{"type":{},"sql":{}}}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{"type":"string","minLength":1},"direction":{"enum":["asc","desc"],"type":"string"}},"required":["column","direction"]}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{"type":"object","properties":{"schema":{},"table":{}}},"on":{"type":"string","minLength":1},"type":{"enum":["inner","left","right","full"],"type":"string"}},"required":["table","on"]}}},"required":["select","from","agg","as"]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["amount","precision","source","query"]}},"required":["type","params"]},{"type":"object","properties":{"type":{"const":"rate_min_max"},"params":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{},"column":{},"value":{}}},{"type":"object","properties":{"type":{},"sql":{}}}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{},"column":{},"value":{}}},{"type":"object","properties":{"type":{},"sql":{}}}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{"type":"string","minLength":1},"direction":{"enum":["asc","desc"],"type":"string"}},"required":["column","direction"]}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{},{},{},{}]},{"type":"array","items":{"anyOf":[{},{"type":"null"}]}}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{"type":"object","properties":{"schema":{},"table":{}}},"on":{"type":"string","minLength":1},"type":{"enum":["inner","left","right","full"],"type":"string"}},"required":["table","on"]}}},"required":["select","from","agg","as"]},"rangeMin":{"type":"number"},"rangeMax":{"anyOf":[{"type":"number"},{"type":"null"}]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxPayout":{"type":"number","exclusiveMinimum":0}},"required":["amount","precision","source","query","rangeMin","rangeMax"]}},"required":["type","params"]}]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"}},"required":["conditions","event"]}},"queryPlans":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{"enum":["eq","ne","gt","gte","lt","lte","in","not_in","like","ilike","between"],"type":"string"},"column":{"type":"string","minLength":1},"value":{}},"required":["op","column"]},{"type":"object","properties":{"type":{"const":"raw"},"sql":{"type":"string","minLength":1}},"required":["type","sql"]}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{"enum":["eq","ne","gt","gte","lt","lte","in","not_in","like","ilike","between"],"type":"string"},"column":{"type":"string","minLength":1},"value":{}},"required":["op","column"]},{"type":"object","properties":{"type":{"const":"raw"},"sql":{"type":"string","minLength":1}},"required":["type","sql"]}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{"type":"string","minLength":1},"direction":{"enum":["asc","desc"],"type":"string"}},"required":["column","direction"]}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"on":{"type":"string","minLength":1},"type":{"enum":["inner","left","right","full"],"type":"string"}},"required":["table","on"]}}},"required":["select","from","agg","as"]},"hash":{"type":"string"},"cacheKey":{"type":"string"},"sql":{"type":"string"},"parameters":{"type":"array","items":{"anyOf":[{},{"type":"null"}]}}},"required":["metadata","hash","cacheKey","sql","parameters"]}},"engineTotals":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"engineEvents":{"type":"array","items":{"type":"object","properties":{"ruleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruleName":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruleIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"eventType":{"enum":["flat","rate","rate_min_max"],"type":"string"},"source":{"enum":["global","query"],"type":"string"},"queryHash":{"type":"string"},"payout":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"fact":{"type":"object","properties":{"creatorId":{"type":"string","minLength":1},"campaignId":{"type":"string","minLength":1},"billingPeriodStart":{"type":"string","minLength":1},"billingPeriodEnd":{"type":"string","minLength":1},"prorationFactor":{"type":"number","minimum":0,"maximum":1}},"required":["creatorId","campaignId","billingPeriodStart","billingPeriodEnd","prorationFactor"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"details":{"anyOf":[{"type":"object","properties":{"metricKey":{"type":"string"},"metricValue":{"type":"number"},"rawMetricValue":{"type":"number"},"metricStartValue":{"type":"number"},"metricEndValue":{"type":"number"},"eligibleVideoCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"ratePerUnit":{"type":"number"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"appliedTierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"tierBreakdown":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"calculationType":{"const":"rate"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"rate":{"type":"number"},"perQuantity":{"type":"number","exclusiveMinimum":0},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","rate","payout"]},{"type":"object","properties":{"calculationType":{"const":"flat"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","payout"]}]}},"maxPayoutApplied":{"type":"boolean"}},"required":["metricKey","metricValue"]},{"type":"null"}]}},"required":["eventType","source","payout","fact","details"]}},"engineFacts":{"type":"array","items":{"type":"object","properties":{"creatorId":{"type":"string","minLength":1},"campaignId":{"type":"string","minLength":1},"billingPeriodStart":{"type":"string","minLength":1},"billingPeriodEnd":{"type":"string","minLength":1},"prorationFactor":{"type":"number","minimum":0,"maximum":1},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"totalViews":{"type":"number","minimum":0},"totalEarnings":{"type":"number"},"totalImpressions":{"type":"number","minimum":0}},"required":["creatorId","campaignId","billingPeriodStart","billingPeriodEnd","prorationFactor","interval","intervalCount"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"engineWarnings":{"type":"array","items":{"type":"string"}},"accountSnapshot":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"orgAccountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"maxVideos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["orgAccountId","platform","platformAccountId","maxVideos","hashtagsFilter"]}},"excludedVideosHash":{"type":"string"},"excludedVideosCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["accounts","excludedVideosHash","excludedVideosCount"]}},"required":["prorationFactor","rulesSnapshot","queryPlans","engineTotals","engineEvents","engineFacts","engineWarnings","accountSnapshot"]},"lineItems":{"type":"array","minItems":1,"items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"number"}},"required":["title","amount"]}},"integrityToken":{"type":"string","minLength":1,"description":"Integrity token returned alongside the calculation. Pass it unchanged to POST /payouts/initiate together with the calculation payload."}},"required":["period","payouts","metrics","engine","lineItems","integrityToken"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/initiate":{"post":{"operationId":"payouts.initiate","summary":"Initiate a payout","description":"Stores the finalized payout calculation, engine metadata, and caller-supplied invoice line items for a completed billing window. Call `POST /payouts/calculate` first and pass the returned `calculation` payload plus `integrityToken` here. `autoApproveTalentir=true` is only valid with `payoutProvider=\"talentir\"` and also requires `acknowledgeFullPayoutLiability=true`, confirming that your API caller accepts full responsibility for any payout approval, calculation, recipient, configuration, or integration errors triggered by the request, including any resulting lost funds.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"lineItems":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"number"}},"required":["title","amount"]}},"calculation":{"type":"object","properties":{"period":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"maximum":9007199254740991},"label":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"}},"required":["index","label","start","end"]},"payouts":{"type":"object","properties":{"total":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"breakdown":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"ruleName":{"anyOf":[{"type":"string"},{"type":"null"}]},"eventType":{"enum":["flat","rate","rate_min_max"],"type":"string"},"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"},"calculationDetails":{"anyOf":[{"type":"object","properties":{"metricKey":{"type":"string"},"metricValue":{"type":"number"},"rawMetricValue":{"type":"number"},"metricStartValue":{"type":"number"},"metricEndValue":{"type":"number"},"eligibleVideoCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"ratePerUnit":{"type":"number"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"appliedTierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"tierBreakdown":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"calculationType":{"const":"rate"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"rate":{"type":"number"},"perQuantity":{"type":"number","exclusiveMinimum":0},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","rate","payout"]},{"type":"object","properties":{"calculationType":{"const":"flat"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","payout"]}]}},"maxPayoutApplied":{"type":"boolean"}},"required":["metricKey","metricValue"]},{"type":"null"}]}},"required":["label","ruleName","eventType","amount","precision","currency","value","calculationDetails"]}}},"required":["total","breakdown"]},"metrics":{"type":"object","properties":{"facts":{"type":"array","items":{"type":"object","properties":{"factName":{"type":"string"},"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"label":{"type":"string"},"total":{"type":"number"}},"required":["factName","metric","label","total"]}},"perVideo":{"anyOf":[{"type":"object","properties":{"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"label":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string"},"value":{"type":"number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCompetitor":{"type":"boolean"},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"orgAccountId":{"anyOf":[{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},{"type":"null"}]},"payoutAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"payoutValue":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","platform","platformVideoId","value","title","thumbnailUrl","publishedAt","accountUsername","platformAccountId","isCompetitor","contentType","orgAccountId","payoutAmount","payoutCurrency","payoutValue"]}}},"required":["metric","label","items"]},{"type":"null"}]},"perCategory":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"metric":{"enum":["views","likes","shares","comments","videoCount","engagementRate"],"type":"string"},"metricKey":{"type":"string"},"metricLabel":{"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}]},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string"},"value":{"type":"number"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isCompetitor":{"type":"boolean"},"contentType":{"anyOf":[{"enum":["video","slideshow"],"type":"string","description":"Filter by content types (video, slideshow)","examples":[["video"],["slideshow"],[]]},{"type":"null"}]},"orgAccountId":{"anyOf":[{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},{"type":"null"}]},"payoutAmount":{"anyOf":[{"type":"number"},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"type":"string"},{"type":"null"}]},"payoutValue":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","platform","platformVideoId","value","title","thumbnailUrl","publishedAt","accountUsername","platformAccountId","isCompetitor","contentType","orgAccountId","payoutAmount","payoutCurrency","payoutValue"]}}},"required":["category","metric","metricKey","metricLabel","items"]}},{"type":"null"}]}},"required":["facts","perVideo","perCategory"]},"engine":{"type":"object","properties":{"prorationFactor":{"type":"number"},"rulesSnapshot":{"type":"array","minItems":1,"items":{"type":"object","properties":{"id":{"type":"string","pattern":"^rule_[0-9a-zA-Z]{12}$"},"conditions":{"anyOf":[{"type":"object","properties":{"all":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["lessThan","lessThanInclusive","greaterThan","greaterThanInclusive"],"type":"string"},"value":{"type":"number"}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["equal","notEqual"],"type":"string"},"value":{"anyOf":[{},{},{}]}},"required":["fact","operator"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["in","notIn","contains","doesNotContain"],"type":"string"},"value":{"type":"array","minItems":1,"items":{}}},"required":["fact","operator","value"]}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all"]},{"type":"object","properties":{"any":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["lessThan","lessThanInclusive","greaterThan","greaterThanInclusive"],"type":"string"},"value":{"type":"number"}},"required":["fact","operator","value"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["equal","notEqual"],"type":"string"},"value":{"anyOf":[{},{},{}]}},"required":["fact","operator"]},{"type":"object","properties":{"fact":{"type":"string","minLength":1},"operator":{"enum":["in","notIn","contains","doesNotContain"],"type":"string"},"value":{"type":"array","minItems":1,"items":{}}},"required":["fact","operator","value"]}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["any"]},{"type":"object","properties":{"not":{"anyOf":[{"type":"object","properties":{"all":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["all"]},{"type":"object","properties":{"any":{"type":"array","minItems":1,"items":{"anyOf":[{},{},{}]}},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["any"]},{"type":"object","properties":{"not":{"anyOf":[{"type":"object","properties":{"all":{},"name":{},"priority":{}}},{"type":"object","properties":{"any":{},"name":{},"priority":{}}},{"type":"object","properties":{"not":{},"name":{},"priority":{}}}]},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["not"]}]},"name":{"type":"string"},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["not"]}]},"event":{"anyOf":[{"type":"object","properties":{"type":{"const":"flat"},"params":{"anyOf":[{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"global"}},"required":["amount","precision","source"]},{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{},"table":{}}},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{}},"where":{"type":"array","minItems":1,"items":{}},"having":{"type":"array","minItems":1,"items":{}},"orderBy":{"type":"array","minItems":1,"items":{}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{},"additionalProperties":{}},"joins":{"type":"array","minItems":1,"items":{}}},"required":["select","from","agg","as"]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"mode":{"enum":["progressive","allocation"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"rangeMin":{"type":"number"},"rangeMax":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["amount","precision","source","query"]}]}},"required":["type","params"]},{"type":"object","properties":{"type":{"const":"rate"},"params":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{},{}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{},{}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{},"direction":{}}}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{},"on":{},"type":{}}}}},"required":["select","from","agg","as"]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["amount","precision","source","query"]}},"required":["type","params"]},{"type":"object","properties":{"type":{"const":"rate_min_max"},"params":{"type":"object","properties":{"amount":{"type":"number","minimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"source":{"const":"query"},"query":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{},{}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{},{}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{},"direction":{}}}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{},{}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{},"on":{},"type":{}}}}},"required":["select","from","agg","as"]},"rangeMin":{"type":"number"},"rangeMax":{"anyOf":[{"type":"number"},{"type":"null"}]},"metric":{"type":"string","minLength":1},"scope":{"type":"string"},"aggregation":{"type":"string"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"maxPayout":{"type":"number","exclusiveMinimum":0}},"required":["amount","precision","source","query","rangeMin","rangeMax"]}},"required":["type","params"]}]},"priority":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"}},"required":["conditions","event"]}},"queryPlans":{"type":"array","items":{"type":"object","properties":{"metadata":{"type":"object","properties":{"select":{"type":"string","minLength":1},"from":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"agg":{"enum":["sum","avg","count","min","max"],"type":"string"},"as":{"type":"string","minLength":1},"groupBy":{"type":"array","minItems":1,"items":{"type":"string","minLength":1}},"where":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{"enum":["eq","ne","gt","gte","lt","lte","in","not_in","like","ilike","between"],"type":"string"},"column":{"type":"string","minLength":1},"value":{}},"required":["op","column"]},{"type":"object","properties":{"type":{"const":"raw"},"sql":{"type":"string","minLength":1}},"required":["type","sql"]}]}},"having":{"type":"array","minItems":1,"items":{"anyOf":[{"type":"object","properties":{"op":{"enum":["eq","ne","gt","gte","lt","lte","in","not_in","like","ilike","between"],"type":"string"},"column":{"type":"string","minLength":1},"value":{}},"required":["op","column"]},{"type":"object","properties":{"type":{"const":"raw"},"sql":{"type":"string","minLength":1}},"required":["type","sql"]}]}},"orderBy":{"type":"array","minItems":1,"items":{"type":"object","properties":{"column":{"type":"string","minLength":1},"direction":{"enum":["asc","desc"],"type":"string"}},"required":["column","direction"]}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"parameters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}]}},"joins":{"type":"array","minItems":1,"items":{"type":"object","properties":{"table":{"type":"object","properties":{"schema":{"type":"string","minLength":1},"table":{"type":"string","minLength":1}},"required":["schema","table"]},"on":{"type":"string","minLength":1},"type":{"enum":["inner","left","right","full"],"type":"string"}},"required":["table","on"]}}},"required":["select","from","agg","as"]},"hash":{"type":"string"},"cacheKey":{"type":"string"},"sql":{"type":"string"},"parameters":{"type":"array","items":{}}},"required":["metadata","hash","cacheKey","sql","parameters"]}},"engineTotals":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"engineEvents":{"type":"array","items":{"type":"object","properties":{"ruleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruleName":{"anyOf":[{"type":"string"},{"type":"null"}]},"ruleIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"eventType":{"enum":["flat","rate","rate_min_max"],"type":"string"},"source":{"enum":["global","query"],"type":"string"},"queryHash":{"type":"string"},"payout":{"type":"object","properties":{"amount":{"type":"number"},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"type":"string","minLength":3,"maxLength":3},"value":{"type":"number"}},"required":["amount","precision","currency","value"]},"fact":{"type":"object","properties":{"creatorId":{"type":"string","minLength":1},"campaignId":{"type":"string","minLength":1},"billingPeriodStart":{"type":"string","minLength":1},"billingPeriodEnd":{"type":"string","minLength":1},"prorationFactor":{"type":"number","minimum":0,"maximum":1}},"required":["creatorId","campaignId","billingPeriodStart","billingPeriodEnd","prorationFactor"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"details":{"anyOf":[{"type":"object","properties":{"metricKey":{"type":"string"},"metricValue":{"type":"number"},"rawMetricValue":{"type":"number"},"metricStartValue":{"type":"number"},"metricEndValue":{"type":"number"},"eligibleVideoCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"ratePerUnit":{"type":"number"},"perQuantity":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"mode":{"enum":["allocation","progressive"],"type":"string"},"payoutTiming":{"enum":["gains","milestone"],"type":"string"},"appliedTierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"tierBreakdown":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"calculationType":{"const":"rate"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"rate":{"type":"number"},"perQuantity":{"type":"number","exclusiveMinimum":0},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","rate","payout"]},{"type":"object","properties":{"calculationType":{"const":"flat"},"tierIndex":{"type":"integer","minimum":0,"maximum":9007199254740991},"min":{"type":"number"},"max":{"anyOf":[{"type":"number"},{"type":"null"}]},"metricValue":{"type":"number"},"payout":{"type":"number"}},"required":["calculationType","tierIndex","min","max","metricValue","payout"]}]}},"maxPayoutApplied":{"type":"boolean"}},"required":["metricKey","metricValue"]},{"type":"null"}]}},"required":["eventType","source","payout","fact","details"]}},"engineFacts":{"type":"array","items":{"type":"object","properties":{"creatorId":{"type":"string","minLength":1},"campaignId":{"type":"string","minLength":1},"billingPeriodStart":{"type":"string","minLength":1},"billingPeriodEnd":{"type":"string","minLength":1},"prorationFactor":{"type":"number","minimum":0,"maximum":1},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"totalViews":{"type":"number","minimum":0},"totalEarnings":{"type":"number"},"totalImpressions":{"type":"number","minimum":0}},"required":["creatorId","campaignId","billingPeriodStart","billingPeriodEnd","prorationFactor","interval","intervalCount"],"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"engineWarnings":{"type":"array","items":{"type":"string"}},"accountSnapshot":{"type":"object","properties":{"accounts":{"type":"array","items":{"type":"object","properties":{"orgAccountId":{"type":"string","pattern":"^orgacc_.*","description":"Organization account ID with orgacc_ prefix. Not the same as platform account ID."},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformAccountId":{"type":"string","minLength":1,"description":"Native platform account id","examples":["7123456789012345678","z1234567890"]},"maxVideos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hashtagsFilter":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["orgAccountId","platform","platformAccountId","maxVideos","hashtagsFilter"]}},"excludedVideosHash":{"type":"string"},"excludedVideosCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["accounts","excludedVideosHash","excludedVideosCount"]}},"required":["prorationFactor","rulesSnapshot","queryPlans","engineTotals","engineEvents","engineFacts","engineWarnings","accountSnapshot"]}},"required":["period","payouts","metrics","engine"]},"integrityToken":{"type":"string","minLength":1,"description":"Required integrity token returned by POST /payouts/calculate for this exact calculation payload and billing window. Pass it unchanged."},"reference":{"type":"string","maxLength":255,"description":"Optional payout reference for reconciliation, invoicing, or external bookkeeping."},"payoutProvider":{"enum":["manual","talentir"],"type":"string","default":"manual"},"autoApproveTalentir":{"type":"boolean","default":false},"acknowledgeFullPayoutLiability":{"type":"boolean","default":false,"description":"Required when payoutProvider is talentir and autoApproveTalentir is true. Confirms that your API caller accepts full responsibility for any payout approval, calculation, recipient, configuration, or integration errors triggered by the request, including any resulting lost funds."}},"required":["campaignId","creatorId","billingPeriodStart","billingPeriodEnd","lineItems","calculation","integrityToken"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true},"payoutId":{"type":"string","pattern":"^orgpay_[0-9a-zA-Z]{12}$","description":"Payout ID with orgpay_ prefix","examples":["orgpay_RwmraAffhMt9"]}},"required":["success","payoutId"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYOUT_CONFLICT"},"status":{"const":409},"message":{"type":"string","default":"This billing window is already settled or canceled"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"412":{"description":"412","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYOUT_PROVIDER_NOT_CONFIGURED"},"status":{"const":412},"message":{"type":"string","default":"Payout provider not configured"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"502":{"description":"502","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYOUT_PROVIDER_FAILED"},"status":{"const":502},"message":{"type":"string","default":"Payout provider request failed"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/upcoming":{"get":{"operationId":"payouts.upcoming","summary":"List upcoming creator payouts","description":"Returns billing periods that have started but are not yet finished. Uses campaign anchors and creator assignments to identify the current in-progress cycle for each assignment.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"includeEmpty","in":"query","schema":{"type":"boolean","default":true},"allowEmptyValue":true,"allowReserved":true},{"name":"mode","in":"query","schema":{"enum":["data","count"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"referenceDate","in":"query","schema":{"type":"string","format":"date-time"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"campaignName":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creatorUserId":{"type":"string"},"creatorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorEmail":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaignStatus":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"campaignValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"timeZone":{"enum":["UTC"],"type":"string"},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"payoutAmount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutPrecision":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"calculationRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"analyticsDataRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","campaignId","campaignName","creatorId","creatorUserId","creatorName","creatorEmail","billingPeriodStart","billingPeriodEnd","interval","intervalCount","billingAnchor","timeZone","currency","payoutAmount","payoutPrecision","payoutCurrency","calculationRefreshedAt","analyticsDataRefreshedAt"]}}},"required":["page","perPage","total","data"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/canceled":{"get":{"operationId":"payouts.canceled","summary":"List canceled payout windows","description":"Returns billing periods that were explicitly canceled and removed from the payout queue.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"includeEmpty","in":"query","schema":{"type":"boolean","default":true},"allowEmptyValue":true,"allowReserved":true},{"name":"mode","in":"query","schema":{"enum":["data","count"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"campaignName":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creatorUserId":{"type":"string"},"creatorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorEmail":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaignStatus":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"campaignValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"timeZone":{"enum":["UTC"],"type":"string"},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"payoutAmount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutPrecision":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"payoutCurrency":{"anyOf":[{"enum":["USD","EUR","CHF","GBP"],"type":"string"},{"type":"null"}]},"calculationRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"analyticsDataRefreshedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"canceledAt":{"type":"string"},"canceledByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"canceledByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"canceledByEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"canceledByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}]}},"required":["id","name","email","image"]},{"type":"null"}]},"reasonNote":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","campaignId","campaignName","creatorId","creatorUserId","creatorName","creatorEmail","billingPeriodStart","billingPeriodEnd","interval","intervalCount","billingAnchor","timeZone","currency","payoutAmount","payoutPrecision","payoutCurrency","calculationRefreshedAt","analyticsDataRefreshedAt","canceledAt","canceledByUserId","canceledByName","canceledByEmail","canceledByUser","reasonNote"]}}},"required":["page","perPage","total","data"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/paid":{"get":{"operationId":"payouts.paid","summary":"List paid creator payouts","description":"Returns completed payout records for finished billing windows.","tags":["Creator Hub"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"creatorIds","in":"query","schema":{"type":"array","items":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"providerPayoutStatus","in":"query","schema":{"enum":["created","approved","completed","deleted","requested","expired"],"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"mode","in":"query","schema":{"enum":["data","count"],"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"perPage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"total":{"type":"integer","minimum":0,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"campaignName":{"type":"string"},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"creatorUserId":{"type":"string"},"creatorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorEmail":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string"},"platformAccountId":{"type":"string"},"isCompetitor":{"type":"boolean","default":false},"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","platform","platformAccountId","username"]},"default":[]},"campaignStatus":{"enum":["upcoming","active","closing","ended"],"type":"string","description":"Campaign lifecycle status derived from validity window. upcoming: validFrom in the future; active: started with no end date; closing: started and has an end date in the present/future; ended: end date is in the past.","examples":["active","closing"]},"campaignValidFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignValidUntil":{"anyOf":[{"type":"string"},{"type":"null"}]},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"interval":{"enum":["day","week","month"],"type":"string"},"intervalCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"exclusiveMinimum":0},"billingAnchor":{"enum":["fixed","rolling"],"type":"string"},"timeZone":{"enum":["UTC"],"type":"string"},"amount":{"type":"number","exclusiveMinimum":0},"precision":{"type":"integer","minimum":0,"maximum":9007199254740991},"currency":{"enum":["USD","EUR","CHF","GBP"],"type":"string"},"lineItems":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"amount":{"type":"number"}},"required":["title","amount"]},"default":[]},"provider":{"anyOf":[{"enum":["talentir"],"type":"string"},{"type":"null"}]},"providerPayoutId":{"anyOf":[{"type":"string"},{"type":"null"}]},"providerState":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"providerPayoutStatus":{"anyOf":[{"enum":["created","approved","completed","deleted","requested","expired"],"type":"string"},{"type":"null"}]},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidAt":{"type":"string"},"paidByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"paidByUser":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"image":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"null"}]},{"type":"null"}]}},"required":["id","name","email","image"]},{"type":"null"}]}},"required":["id","campaignId","campaignName","creatorId","creatorUserId","creatorName","creatorEmail","billingPeriodStart","billingPeriodEnd","interval","intervalCount","billingAnchor","timeZone","amount","precision","currency","provider","providerPayoutId","providerState","providerPayoutStatus","reference","paidAt","paidByUserId","paidByUser"]}}},"required":["page","perPage","total","data"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/cancel":{"post":{"operationId":"payouts.cancelPayout","summary":"Cancel a payout window","description":"Marks a completed billing window as canceled so it is excluded from payout calculations.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"},"reasonNote":{"type":"string","maxLength":1000}},"required":["campaignId","creatorId","billingPeriodStart","billingPeriodEnd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYOUT_CONFLICT"},"status":{"const":409},"message":{"type":"string","default":"This billing window is already settled or canceled"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/payouts/cancel/reinstate":{"post":{"operationId":"payouts.reinstateCanceled","summary":"Reinstate a canceled payout window","description":"Deletes the cancel record so the billing window returns to the Due list.","tags":["Creator Hub"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaignId":{"type":"string","pattern":"^orgcamp_[0-9a-zA-Z]{12}$","description":"Campaign ID with orgcamp_ prefix","examples":["orgcamp_RwmraAffhMt9"]},"creatorId":{"type":"string","pattern":"^orgcre_.*","description":"Organization creator ID with orgcre_ prefix"},"billingPeriodStart":{"type":"string","format":"date-time"},"billingPeriodEnd":{"type":"string","format":"date-time"}},"required":["campaignId","creatorId","billingPeriodStart","billingPeriodEnd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"const":true}},"required":["success"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"409":{"description":"409","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INVALID_STATE"},"status":{"const":409},"message":{"type":"string","default":"Cannot reinstate this payout window"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/library/viral-videos":{"get":{"operationId":"library.viralVideos.list","summary":"List viral videos","description":"Retrieves viral videos from the research library using offset pagination. Supports filtering by search term, brand, region, date range, minimum views, outlier factor, taxonomy facets, and detected entities.","tags":["Viral Video Library"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","default":""},"allowEmptyValue":true,"allowReserved":true},{"name":"brandId","in":"query","schema":{"type":"string","default":""},"allowEmptyValue":true,"allowReserved":true},{"name":"dateRange","in":"query","schema":{"enum":["all","7d","14d","30d"],"type":"string","default":"30d"},"allowEmptyValue":true,"allowReserved":true},{"name":"sort","in":"query","schema":{"enum":["latest","views","engagement","outlier"],"type":"string","default":"latest"},"allowEmptyValue":true,"allowReserved":true},{"name":"minViews","in":"query","schema":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"default":null},"allowEmptyValue":true,"allowReserved":true},{"name":"minOutlierFactor","in":"query","schema":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"default":null},"allowEmptyValue":true,"allowReserved":true},{"name":"regions","in":"query","schema":{"type":"array","items":{"type":"string","minLength":2,"maxLength":2,"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"productTypes","in":"query","schema":{"type":"array","items":{"enum":["ecommerce_physical","ecommerce_digital","mobile_app","saas","course_coaching","service","marketplace","subscription_content","other","unknown"],"type":"string"},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"verticals","in":"query","schema":{"type":"array","items":{"enum":["education_study","career_work","business_entrepreneurship","marketing_sales","technology_ai","software_apps","finance_investing","ecommerce_retail","health_fitness","beauty_fashion","food_cooking","home_lifestyle","travel_outdoors","relationships_family","entertainment_culture","gaming","news_commentary","other","unknown"],"type":"string"},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"formats","in":"query","schema":{"type":"array","items":{"enum":["tutorial_how_to","talking_head","screen_recording","product_demo_review","storytime_vlog","skit_pov","listicle_countdown","comparison_reaction","trend_meme_remix","interview_street","cinematic_montage","other","unknown"],"type":"string"},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"hookArchetypes","in":"query","schema":{"type":"array","items":{"enum":["bold_claim","pain_point_callout","curiosity_gap","mistake_warning","quick_win_promise","contrarian_take","question_hook","story_in_medias_res","proof_results","secret_reveal","challenge_dare","other","unknown"],"type":"string"},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"productDetected","in":"query","schema":{"enum":["any","yes","no"],"type":"string","default":"any"},"allowEmptyValue":true,"allowReserved":true},{"name":"brandDetected","in":"query","schema":{"enum":["any","yes","no"],"type":"string","default":"any"},"allowEmptyValue":true,"allowReserved":true},{"name":"matchedTerms","in":"query","schema":{"type":"array","items":{"type":"string"},"default":[]},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":60,"default":36},"allowEmptyValue":true,"allowReserved":true},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"enum":["facebook","instagram","tiktok","youtube"],"type":"string","description":"Social media platform (facebook, instagram, tiktok, youtube)","examples":["facebook","instagram","tiktok","youtube"]},"platformVideoId":{"type":"string"},"platformAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountUsername":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountDisplayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountProfilePictureUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountFollowerCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"region":{"anyOf":[{"description":"Region code (2-letter ISO country code)","examples":["US","GB","IT"]},{"type":"null"}],"default":null},"caption":{"anyOf":[{"type":"string"},{"type":"null"}]},"hashtags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"downloadUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"musicArtist":{"anyOf":[{"type":"string"},{"type":"null"}]},"durationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"thumbnailUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"viewCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"likeCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"commentCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"shareCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"bookmarkCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"engagementRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"outlierFactor":{"anyOf":[{"type":"number"},{"type":"null"}]},"publishedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"lastSeenAt":{"type":"string","format":"date-time","x-native-type":"date"},"matchedTerms":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"isUgc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ugcConfidence":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["id","platform","platformVideoId","platformAccountId","accountUsername","accountDisplayName","accountProfilePictureUrl","accountFollowerCount","caption","hashtags","downloadUrl","musicTitle","musicArtist","durationSeconds","thumbnailUrl","viewCount","likeCount","commentCount","shareCount","bookmarkCount","engagementRate","outlierFactor","publishedAt","lastSeenAt","matchedTerms","isUgc","ugcConfidence"]}},"nextOffset":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["data","nextOffset"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/library/viral-videos/{videoId}/ai-insights":{"get":{"operationId":"library.viralVideos.aiInsights","summary":"Get AI insights for a viral video","description":"Returns the latest AI enrichment facet statuses and extracted outputs for a viral video.","tags":["Viral Video Library"],"parameters":[{"name":"videoId","in":"path","required":true,"schema":{"type":"string","pattern":"^orgrsv_[0-9a-zA-Z]{12}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"videoId":{"type":"string","pattern":"^orgrsv_[0-9a-zA-Z]{12}$"},"ugc":{"type":"object","properties":{"status":{"enum":["missing","succeeded"],"type":"string"},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"isUgc":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"ugcConfidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"ugcRationale":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["isUgc","ugcConfidence"]},{"type":"null"}]}},"required":["status","updatedAt","result"]},"forensic":{"type":"object","properties":{"status":{"enum":["missing","succeeded"],"type":"string"},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"vertical":{"anyOf":[{"type":"string"},{"type":"null"}]},"formatPrimary":{"anyOf":[{"type":"string"},{"type":"null"}]},"hookVisual":{"anyOf":[{"type":"string"},{"type":"null"}]},"hookTextOverlay":{"anyOf":[{"type":"string"},{"type":"null"}]},"hookAudio":{"anyOf":[{"type":"string"},{"type":"null"}]},"hookArchetype":{"anyOf":[{"type":"string"},{"type":"null"}]},"hookTimestampSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"primaryPsychTrigger":{"anyOf":[{"type":"string"},{"type":"null"}]},"retentionPattern":{"anyOf":[{"type":"string"},{"type":"null"}]},"shareDriver":{"anyOf":[{"type":"string"},{"type":"null"}]},"saveDriver":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["vertical","formatPrimary","hookVisual","hookTextOverlay","hookAudio","hookArchetype","hookTimestampSeconds","primaryPsychTrigger","retentionPattern","shareDriver","saveDriver"]},{"type":"null"}]}},"required":["status","updatedAt","result"]},"commercial":{"type":"object","properties":{"status":{"enum":["missing","succeeded"],"type":"string"},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"productShown":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"productShownTimestampSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"productNameRaw":{"anyOf":[{"type":"string"},{"type":"null"}]},"productType":{"anyOf":[{"type":"string"},{"type":"null"}]},"productTypeOther":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedProduct":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"productUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"appStoreUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"playStoreUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","productUrl","appStoreUrl","playStoreUrl"]},{"type":"null"}]},"brandShown":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"brandShownTimestampSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"brandRaw":{"anyOf":[{"type":"string"},{"type":"null"}]},"brandId":{"anyOf":[{"type":"string"},{"type":"null"}]},"resolvedBrand":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"websiteUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"logoUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","websiteUrl","logoUrl","domain"]},{"type":"null"}]},"entityResearchedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"entityResearchError":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["productShown","productShownTimestampSeconds","productNameRaw","productType","productTypeOther","productId","resolvedProduct","brandShown","brandShownTimestampSeconds","brandRaw","brandId","resolvedBrand","entityResearchedAt","entityResearchError"]},{"type":"null"}]}},"required":["status","updatedAt","result"]},"persona":{"type":"object","properties":{"status":{"enum":["missing","succeeded"],"type":"string"},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"creatorGroupType":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorGenderPresentation":{"anyOf":[{"type":"string"},{"type":"null"}]},"creatorAgeCategory":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["creatorGroupType","creatorGenderPresentation","creatorAgeCategory"]},{"type":"null"}]}},"required":["status","updatedAt","result"]},"scenes":{"type":"object","properties":{"status":{"enum":["missing","succeeded"],"type":"string"},"confidence":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"updatedAt":{"anyOf":[{"type":"string","format":"date-time","x-native-type":"date"},{"type":"null"}]},"result":{"anyOf":[{"type":"object","properties":{"sceneCount":{"type":"integer","minimum":0,"maximum":9007199254740991},"musicSoundDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"scenes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sceneIndex":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"startSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"endSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"durationSeconds":{"anyOf":[{"type":"number"},{"type":"null"}]},"sceneDescription":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"anyOf":[{"type":"string"},{"type":"null"}]},"environmentSetting":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string"},{"type":"null"}]},"lightingStyle":{"anyOf":[{"type":"string"},{"type":"null"}]},"cameraAngleMovement":{"anyOf":[{"type":"string"},{"type":"null"}]},"soundDescription":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","sceneIndex","startSeconds","endSeconds","durationSeconds","sceneDescription","subject","environmentSetting","action","lightingStyle","cameraAngleMovement","soundDescription"]}}},"required":["sceneCount","musicSoundDescription","scenes"]},{"type":"null"}]}},"required":["status","updatedAt","result"]}},"required":["videoId","ugc","forensic","commercial","persona","scenes"]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}},"/apps":{"get":{"operationId":"integrations.apps.list","summary":"List all integrated apps","description":"Retrieves paginated integration apps (Apple, Google, etc.) with analytics data including sync times and credential information.","tags":["Integrations"],"parameters":[{"name":"page","in":"query","schema":{"type":"number","minimum":1,"default":1,"description":"Page number (1-based index)","examples":[1,2,3]},"allowEmptyValue":true,"allowReserved":true},{"name":"perPage","in":"query","schema":{"type":"number","minimum":1,"maximum":100,"default":10,"description":"Number of items per page (1-100)","examples":[10,20,50,100]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortCol","in":"query","schema":{"type":"string","default":"publishedAt","description":"Sort column","examples":["publishedAt","viewCount","engagementRate"]},"allowEmptyValue":true,"allowReserved":true},{"name":"sortDir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc","description":"Sort direction","examples":["asc","desc"]},"allowEmptyValue":true,"allowReserved":true},{"name":"provider","in":"query","schema":{"enum":["apple","google"],"type":"string","description":"App provider for integrations (apple)"},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"appleCredentialId":{"type":"string"},"appleIdentifier":{"type":"string"},"title":{"type":"string"},"sku":{"type":"string"},"bundleId":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSeenAt":{"type":"string","format":"date-time","x-native-type":"date"},"createdAt":{"type":"string","format":"date-time","x-native-type":"date"},"updatedAt":{"type":"string","format":"date-time","x-native-type":"date"},"provider":{"const":"apple"},"credential":{"type":"object","properties":{"id":{"type":"string"},"vendorNumber":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","vendorNumber"]},"analyticsLatestLoadAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"nextSyncAt":{"type":"string"}},"required":["id","appleCredentialId","appleIdentifier","title","sku","bundleId","lastSeenAt","createdAt","updatedAt","provider","credential","analyticsLatestLoadAt","nextSyncAt"]}},"pageCount":{"type":"number","description":"Total number of pages"},"totalRows":{"type":"number","description":"Total number of rows"}},"required":["data","pageCount","totalRows"],"description":"Paginated response containing integrated apps with sync status and credential information","examples":[{"data":[{"id":"orgaplapp_R4W8KPM5YTB9","appleCredentialId":"apc_R4W8KPM5YTB9","appleIdentifier":"68912345678900","title":"MyApp - Social Analytics","sku":"com.example.myapp","bundleId":"com.example.myapp","lastSeenAt":"2025-12-20T08:00:00.000Z","createdAt":"2025-01-15T10:00:00.000Z","updatedAt":"2025-12-20T08:00:00.000Z","provider":"apple","credential":{"id":"apc_R4W8KPM5YTB9","vendorNumber":"87654321"},"analyticsLatestLoadAt":"2025-12-20T06:00:00Z","nextSyncAt":"2025-12-21T05:00:00Z"},{"id":"orgaplapp_2B3C4D5E6F7G","appleCredentialId":"apc_R4W8KPM5YTB9","appleIdentifier":"9876543210","title":"MyApp Pro - Premium Analytics","sku":"com.example.myapp.pro","bundleId":"com.example.myapp.pro","lastSeenAt":"2025-12-19T08:00:00.000Z","createdAt":"2025-03-10T14:30:00.000Z","updatedAt":"2025-12-19T08:00:00.000Z","provider":"apple","credential":{"id":"apc_R4W8KPM5YTB9","vendorNumber":"87654321"},"analyticsLatestLoadAt":null,"nextSyncAt":"2025-12-21T05:00:00Z"}],"pageCount":3,"totalRows":12}]}}}},"400":{"description":"400","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"BAD_REQUEST"},"status":{"const":400},"message":{"type":"string","default":"Bad request"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"401":{"description":"401","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"UNAUTHORIZED"},"status":{"const":401},"message":{"type":"string","default":"Not authenticated"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"402":{"description":"402","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"PAYMENT_REQUIRED"},"status":{"const":402},"message":{"type":"string","default":"Payment required"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"404":{"description":"404","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"NOT_FOUND"},"status":{"const":404},"message":{"type":"string","default":"Not found"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"408":{"description":"408","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"REQUEST_TIMEOUT"},"status":{"const":408},"message":{"type":"string","default":"Request timeout"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"429":{"description":"429","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"RATE_LIMITED"},"status":{"const":429},"message":{"type":"string","default":"Too many requests"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}},"500":{"description":"500","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"defined":{"const":true},"code":{"const":"INTERNAL_SERVER_ERROR"},"status":{"const":500},"message":{"type":"string","default":"Internal server error"},"data":{}},"required":["defined","code","status","message"]},{"type":"object","properties":{"defined":{"const":false},"code":{"type":"string"},"status":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["defined","code","status","message"]}]}}}}}}}}}