{"openapi":"3.1.0","info":{"title":"Adeli API","version":"1.0.0","summary":"One REST API to publish, comment, message, and read analytics on Instagram, Facebook, TikTok, YouTube, X, and Bluesky.","description":"Adeli maintains the developer app on every network, completes each platform's review, and manages OAuth and token refresh, so you hold one API key. Your first 3 connected accounts are free. Guides and examples: https://www.tryadeli.com/docs","contact":{"name":"Adeli","url":"https://www.tryadeli.com","email":"hello@tryadeli.com"},"termsOfService":"https://www.tryadeli.com/terms"},"externalDocs":{"description":"Adeli API documentation","url":"https://www.tryadeli.com/docs"},"servers":[{"url":"https://app.tryadeli.com"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Profiles","description":"One profile per customer or brand. Every request names its profile."},{"name":"Accounts","description":"Social accounts connected to a profile through OAuth."},{"name":"Posts","description":"Publish and track posts across every connected network."},{"name":"Comments","description":"Read, reply to, and moderate comments."},{"name":"Messages","description":"Direct-message conversations."},{"name":"Analytics","description":"Account and post insights from each platform."},{"name":"Ads","description":"Meta ad accounts, campaigns, insights, and leads."},{"name":"Usage","description":"Usage that is billed by the platform, such as X API fees."}],"paths":{"/api/v1/profiles":{"get":{"operationId":"listProfiles","summary":"List profiles","description":"Every profile in the API key's organization, the default first.","tags":["Profiles"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createProfile","summary":"Create a profile","description":"Send an `Idempotency-Key` header to make retries safe.","tags":["Profiles"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"externalId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}":{"get":{"operationId":"getProfile","summary":"Get a profile","tags":["Profiles"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"updateProfile","summary":"Replace a profile's fields","tags":["Profiles"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"externalId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteProfile","summary":"Delete a profile and its connected accounts","tags":["Profiles"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}/connect":{"post":{"operationId":"startConnection","summary":"Start connecting a social account","description":"Returns a URL for your customer to authorize the account on the platform.","tags":["Profiles"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["instagram","tiktok","facebook","whatsapp","youtube","x","bluesky"]},"redirectUrl":{"type":"string","format":"uri"},"authMethod":{"type":"string","enum":["instagram_login","facebook_login"]},"handle":{"type":"string","maxLength":253,"pattern":"^(?:did:(?:plc|web):[A-Za-z0-9._:%-]+|@?(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)$"}},"required":["platform"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}/connect/{connectionSessionId}":{"get":{"operationId":"getConnection","summary":"Check a connection's status","tags":["Profiles"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}},{"name":"connectionSessionId","in":"path","required":true,"description":"The id returned when the connection was started.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/accounts":{"get":{"operationId":"listAccounts","summary":"List connected accounts","tags":["Accounts"],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["instagram","tiktok","facebook","whatsapp","youtube","x","bluesky"]}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"207":{"description":"Partial: some providers failed. Successful records are kept, and `errors` names each failed account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}/accounts":{"get":{"operationId":"listProfileAccounts","summary":"List a profile's connected accounts","tags":["Accounts"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"207":{"description":"Partial: some providers failed. Successful records are kept, and `errors` names each failed account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}/accounts/{accountId}":{"get":{"operationId":"getAccount","summary":"Get a connected account","tags":["Accounts"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"The connected account's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAccount","summary":"Switch an X account's paid background reads","tags":["Accounts"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"The connected account's id.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"xCapabilities":{"type":"object","properties":{"analytics":{"type":"boolean"},"inbox":{"type":"boolean"}},"additionalProperties":false}},"required":["xCapabilities"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"disconnectAccount","summary":"Disconnect an account","tags":["Accounts"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}},{"name":"accountId","in":"path","required":true,"description":"The connected account's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/profiles/{profileId}/accounts/refresh":{"post":{"operationId":"refreshAccounts","summary":"Refresh every account's access token","tags":["Accounts"],"parameters":[{"name":"profileId","in":"path","required":true,"description":"The profile's id.","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"207":{"description":"Partial: some providers failed. Successful records are kept, and `errors` names each failed account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts":{"get":{"operationId":"listPosts","summary":"List posts","tags":["Posts"],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["instagram","tiktok","facebook","whatsapp","youtube","x","bluesky"]}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"207":{"description":"Partial: some providers failed. Successful records are kept, and `errors` names each failed account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createPost","summary":"Publish a post","description":"Publish to Instagram, Facebook, TikTok, YouTube, X, or Bluesky. Send JSON with media as public URLs or base64, or send `multipart/form-data` to upload TikTok, Instagram, or Facebook media files directly.","tags":["Posts"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"platform":{"type":"string","const":"instagram"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"caption":{"type":"string","maxLength":2200},"collaborators":{"maxItems":3,"type":"array","items":{"type":"string"}},"isAiGenerated":{"type":"boolean"},"image":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":1},"altText":{"type":"string","maxLength":1000},"userTags":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"username":{"type":"string"},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["username","x","y"],"additionalProperties":false}}},"required":["contentType","base64"],"additionalProperties":false}},"required":["platform","accountId","image"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"instagram"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"caption":{"type":"string","maxLength":2200},"collaborators":{"maxItems":3,"type":"array","items":{"type":"string"}},"isAiGenerated":{"type":"boolean"},"images":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":1},"altText":{"type":"string","maxLength":1000},"userTags":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"username":{"type":"string"},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1}},"required":["username","x","y"],"additionalProperties":false}}},"required":["contentType","base64"],"additionalProperties":false}}},"required":["platform","accountId","images"],"additionalProperties":false}]},{"anyOf":[{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"message":{"type":"string","maxLength":2200},"image":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":4,"maxLength":5592408}},"required":["contentType","base64"],"additionalProperties":false}},"required":["platform","accountId","image"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"message":{"type":"string","maxLength":2200},"images":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"contentType":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":4,"maxLength":5592408}},"required":["contentType","base64"],"additionalProperties":false}}},"required":["platform","accountId","images"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"message":{"type":"string","maxLength":2200},"reel":{"type":"object","properties":{"contentType":{"type":"string","enum":["video/mp4","video/quicktime","video/webm"]},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["contentType","base64"],"additionalProperties":false}},"required":["platform","accountId","reel"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"message":{"type":"string","maxLength":2200},"video":{"type":"object","properties":{"contentType":{"type":"string","enum":["video/mp4","video/quicktime","video/webm"]},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["contentType","base64"],"additionalProperties":false},"title":{"type":"string","maxLength":255}},"required":["platform","accountId","video"],"additionalProperties":false}]},{"type":"object","properties":{"platform":{"type":"string","const":"tiktok"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"post_mode":{"default":"DIRECT_POST","type":"string","enum":["DIRECT_POST","MEDIA_UPLOAD"]},"tiktok_title":{"type":"string","maxLength":2200},"tiktok_description":{"type":"string","maxLength":4000},"privacy_level":{"type":"string","enum":["PUBLIC_TO_EVERYONE","MUTUAL_FOLLOW_FRIENDS","FOLLOWER_OF_CREATOR","SELF_ONLY"]},"disable_comment":{"default":false,"type":"boolean"},"disable_duet":{"default":false,"type":"boolean"},"disable_stitch":{"default":false,"type":"boolean"},"cover_timestamp":{"default":1000,"type":"integer","minimum":0,"maximum":9007199254740991},"photo_cover_index":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"auto_add_music":{"default":false,"type":"boolean"},"is_aigc":{"default":false,"type":"boolean"},"brand_content_toggle":{"default":false,"type":"boolean"},"brand_organic_toggle":{"default":false,"type":"boolean"},"music_usage_confirmed":{"type":"boolean","const":true},"video":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","const":"video/mp4"},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["content_type","base64"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]},"photos":{"minItems":1,"maxItems":35,"type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":4,"maxLength":27962040}},"required":["content_type","base64"],"additionalProperties":false}},"scheduled_date":{"not":{}},"add_to_queue":{"not":{}},"async_upload":{"not":{}}},"required":["platform","accountId","music_usage_confirmed"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"youtube"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"title":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string"},"tags":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":500}},"category_id":{"type":"string","pattern":"^\\d+$"},"privacy_status":{"type":"string","enum":["public","unlisted","private"]},"made_for_kids":{"type":"boolean"},"contains_synthetic_media":{"type":"boolean"},"publish_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"notify_subscribers":{"type":"boolean"},"video":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"content_type":{"type":"string","enum":["video/mp4","video/quicktime","video/webm"]},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["content_type","base64"],"additionalProperties":false}]}},"required":["platform","accountId","title","privacy_status","made_for_kids","video"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"x"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"text":{"type":"string","maxLength":25000},"media":{"maxItems":4,"type":"array","items":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif","video/mp4"]},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["content_type","base64"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]}},"thread":{"maxItems":24,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":25000},"media":{"maxItems":4,"type":"array","items":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp","image/gif","video/mp4"]},"base64":{"type":"string","minLength":4,"maxLength":89478488}},"required":["content_type","base64"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}]}}},"required":["text"],"additionalProperties":false}}},"required":["platform","accountId","text"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"bluesky"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"text":{"type":"string","maxLength":3000},"images":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":4,"maxLength":27962028},"altText":{"type":"string","maxLength":2000}},"required":["content_type","base64"],"additionalProperties":false}},"video":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","const":"video/mp4"},"base64":{"type":"string","minLength":4,"maxLength":139810136},"altText":{"type":"string","maxLength":2000}},"required":["content_type","base64"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":2000}},"required":["url"],"additionalProperties":false}]},"langs":{"maxItems":3,"type":"array","items":{"type":"string","pattern":"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$"}},"thread":{"maxItems":24,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":3000},"images":{"maxItems":4,"type":"array","items":{"type":"object","properties":{"content_type":{"type":"string","enum":["image/jpeg","image/png","image/webp"]},"base64":{"type":"string","minLength":4,"maxLength":27962028},"altText":{"type":"string","maxLength":2000}},"required":["content_type","base64"],"additionalProperties":false}},"video":{"anyOf":[{"type":"object","properties":{"content_type":{"type":"string","const":"video/mp4"},"base64":{"type":"string","minLength":4,"maxLength":139810136},"altText":{"type":"string","maxLength":2000}},"required":["content_type","base64"],"additionalProperties":false},{"type":"object","properties":{"url":{"type":"string","format":"uri"},"altText":{"type":"string","maxLength":2000}},"required":["url"],"additionalProperties":false}]}},"required":["text"],"additionalProperties":false}}},"required":["platform","accountId","text"],"additionalProperties":false}]}},"multipart/form-data":{"schema":{"type":"object","required":["platform","accountId"],"properties":{"platform":{"type":"string","description":"`tiktok`, `instagram`, or `facebook`."},"accountId":{"type":"string","description":"The connected account to publish from."},"profileId":{"type":"string"},"video":{"type":"string","format":"binary","description":"The video file (TikTok, Facebook)."},"photos[]":{"type":"array","items":{"type":"string","format":"binary"},"description":"Photo files (TikTok photo posts, Instagram, Facebook)."},"post_mode":{"type":"string"},"tiktok_title":{"type":"string"},"tiktok_description":{"type":"string"},"privacy_level":{"type":"string"},"instagram_caption":{"type":"string"},"instagram_options":{"type":"string","description":"JSON-encoded Instagram options."},"facebook_media_kind":{"type":"string"},"facebook_message":{"type":"string"},"facebook_video_title":{"type":"string"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Accepted: the platform is still processing the media. Poll the matching status endpoint.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/youtube":{"post":{"operationId":"uploadYouTubeVideo","summary":"Upload a video file to YouTube","description":"Multipart upload of a video file. To publish from a URL or base64 instead, use `POST /api/v1/posts`.","tags":["Posts"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["accountId","video","title","made_for_kids"],"properties":{"platform":{"type":"string","description":"`youtube`."},"accountId":{"type":"string"},"profileId":{"type":"string"},"video":{"type":"string","format":"binary","description":"The video file."},"title":{"type":"string"},"description":{"type":"string"},"tags":{"type":"string"},"category_id":{"type":"string"},"privacy_status":{"type":"string","description":"`public`, `unlisted`, or `private`."},"made_for_kids":{"type":"string","description":"`true` or `false`. Required."},"contains_synthetic_media":{"type":"string"},"publish_at":{"type":"string","description":"ISO 8601 time to publish a private video."},"notify_subscribers":{"type":"string"}}}}}},"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/x/{postId}":{"delete":{"operationId":"deleteXPost","summary":"Delete an X post","tags":["Posts"],"parameters":[{"name":"postId","in":"path","required":true,"description":"The provider's post id.","schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/bluesky/{postId}":{"delete":{"operationId":"deleteBlueskyPost","summary":"Delete a Bluesky post","tags":["Posts"],"parameters":[{"name":"postId","in":"path","required":true,"description":"The provider's post id.","schema":{"type":"string"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/facebook/status":{"get":{"operationId":"getFacebookPostStatus","summary":"Check a Facebook video's processing status","tags":["Posts"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"publishId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/tiktok/status":{"get":{"operationId":"getTikTokPostStatus","summary":"Check a TikTok post's publishing status","tags":["Posts"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"publishId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[A-Za-z0-9._~-]+$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/tiktok/creator-info":{"get":{"operationId":"getTikTokCreatorInfo","summary":"Get a TikTok creator's posting options","description":"TikTok requires showing these options (privacy levels, interaction settings) before posting.","tags":["Posts"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/posts/youtube/status":{"get":{"operationId":"getYouTubeVideoStatus","summary":"Check a YouTube video's processing status","tags":["Posts"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"videoId","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{6,20}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/comments":{"get":{"operationId":"listComments","summary":"List comments","tags":["Comments"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["instagram","facebook","tiktok","youtube"]}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"postId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,256}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createComment","summary":"Reply to a post or a comment","tags":["Comments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["instagram","facebook","tiktok","youtube"]},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"postId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"},"parentId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["platform","accountId","message"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/comments/{commentId}":{"patch":{"operationId":"updateComment","summary":"Hide, unhide, or moderate a comment","tags":["Comments"],"parameters":[{"name":"commentId","in":"path","required":true,"description":"The provider's comment id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["instagram","facebook","tiktok","youtube"]},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"postId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"},"hidden":{"type":"boolean"},"liked":{"type":"boolean"}},"required":["platform","accountId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteComment","summary":"Delete a comment","tags":["Comments"],"parameters":[{"name":"commentId","in":"path","required":true,"description":"The provider's comment id.","schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9_.-]+$"}},{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["instagram","facebook","tiktok","youtube"]}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"banAuthor","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/messages":{"get":{"operationId":"listMessages","summary":"List direct-message conversations","tags":["Messages"],"parameters":[{"name":"platform","in":"query","required":false,"schema":{"type":"string","enum":["instagram","tiktok","facebook","whatsapp","youtube","x","bluesky"]}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"207":{"description":"Partial: some providers failed. Successful records are kept, and `errors` names each failed account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateResponse"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"sendMessage","summary":"Send a direct message","tags":["Messages"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"platform":{"type":"string","const":"instagram"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"recipient":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["platform","accountId","recipient","text"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"facebook"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"recipient":{"type":"string","minLength":1,"maxLength":200},"text":{"type":"string","minLength":1,"maxLength":1000}},"required":["platform","accountId","recipient","text"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","const":"whatsapp"},"accountId":{"type":"string","format":"uuid"},"profileId":{"type":"string","format":"uuid"},"recipient":{"type":"string","pattern":"^\\+?[1-9]\\d{7,14}$"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":512,"pattern":"^[a-z0-9_]+$"},"language":{"type":"string","pattern":"^[a-z]{2,3}(_[A-Z]{2})?$"},"bodyParameters":{"default":[],"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":1024}}},"required":["name","language"],"additionalProperties":false}},"required":["platform","accountId","recipient","template"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/instagram/account-insights":{"get":{"operationId":"getInstagramAccountInsights","summary":"Instagram account insights","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/facebook/page-metrics":{"get":{"operationId":"getFacebookPageMetrics","summary":"Facebook Page metrics","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/tiktok/account-analytics":{"get":{"operationId":"getTikTokAccountAnalytics","summary":"TikTok account analytics","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/tiktok/account-insights":{"get":{"operationId":"getTikTokAccountInsights","summary":"TikTok account insights (TikTok API for Business)","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/tiktok/video-insights":{"get":{"operationId":"getTikTokVideoInsights","summary":"TikTok video insights","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"videoIds","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/youtube/channel-insights":{"get":{"operationId":"getYouTubeChannelInsights","summary":"YouTube channel insights","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/analytics/youtube/video-insights":{"get":{"operationId":"getYouTubeVideoInsights","summary":"YouTube video insights","tags":["Analytics"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"startDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"endDate","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"videoIds","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/businesses":{"get":{"operationId":"listAdBusinesses","summary":"List Meta businesses","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/accounts":{"get":{"operationId":"listAdAccounts","summary":"List ad accounts","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."},{"name":"refresh","in":"query","required":false,"schema":{"type":"string","enum":["true"]},"description":"`true` to bypass the cached list."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createAdAccount","summary":"Create an ad account","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"businessId":{"type":"string","pattern":"^\\d+$"},"name":{"type":"string","minLength":1,"maxLength":100},"currency":{"default":"USD","type":"string","enum":["USD","CAD","MXN","BRL","GBP","EUR","AUD","NZD","INR","SGD","AED","JPY"]},"timezone":{"type":"string","enum":["America/Los_Angeles","America/Denver","Pacific/Honolulu","America/Anchorage","America/Phoenix","America/Chicago","America/New_York","America/Toronto","America/Vancouver","America/Mexico_City","America/Sao_Paulo","Europe/London","Europe/Dublin","Europe/Paris","Europe/Berlin","Europe/Madrid","Europe/Amsterdam","Asia/Dubai","Asia/Kolkata","Asia/Singapore","Asia/Tokyo","Australia/Sydney","Pacific/Auckland","UTC"]}},"required":["businessId","name","timezone"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/accounts/{adAccountId}":{"get":{"operationId":"getAdAccount","summary":"Get an ad account","tags":["Ads"],"parameters":[{"name":"adAccountId","in":"path","required":true,"description":"Meta ad account id, `act_` followed by digits.","schema":{"type":"string","pattern":"^act_\\d+$"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateAdAccount","summary":"Update an ad account","tags":["Ads"],"parameters":[{"name":"adAccountId","in":"path","required":true,"description":"Meta ad account id, `act_` followed by digits.","schema":{"type":"string","pattern":"^act_\\d+$"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"spendCap":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":10000000},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/tree":{"get":{"operationId":"getAdTree","summary":"Campaigns, ad sets, and ads for an ad account","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."},{"name":"adAccountId","in":"query","required":true,"schema":{"type":"string","pattern":"^act_\\d+$"}},{"name":"since","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"until","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/insights":{"get":{"operationId":"getAdInsights","summary":"Ad performance insights","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."},{"name":"adAccountId","in":"query","required":true,"schema":{"type":"string","pattern":"^act_\\d+$"}},{"name":"objectId","in":"query","required":false,"schema":{"type":"string"},"description":"A campaign, ad set, or ad id."},{"name":"since","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"until","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/leads":{"get":{"operationId":"listAdLeads","summary":"List leads from a lead form","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."},{"name":"formId","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/campaigns":{"post":{"operationId":"createCampaign","summary":"Boost a Page post as a campaign","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adAccountId":{"type":"string","pattern":"^act_\\d+$"},"pagePostId":{"type":"string","pattern":"^\\d+$"},"dailyBudget":{"type":"number","exclusiveMinimum":0,"maximum":10000},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"campaignName":{"type":"string","minLength":1,"maxLength":200}},"required":["adAccountId","pagePostId","dailyBudget","startDate","endDate","campaignName"],"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/campaigns/{campaignId}":{"delete":{"operationId":"deleteCampaign","summary":"Delete a campaign","tags":["Ads"],"parameters":[{"name":"campaignId","in":"path","required":true,"description":"Meta campaign id.","schema":{"type":"string","pattern":"^\\d+$"}},{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."},{"name":"adAccountId","in":"query","required":true,"schema":{"type":"string","pattern":"^act_\\d+$"}}],"responses":{"204":{"description":"No content"},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ads/status":{"put":{"operationId":"setAdStatus","summary":"Pause or activate a campaign, ad set, or ad","tags":["Ads"],"parameters":[{"name":"accountId","in":"query","required":true,"schema":{"type":"string","format":"uuid"},"description":"The connected account. It names its profile, so `profileId` can be left out."},{"name":"profileId","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"The profile, when no `accountId` is given."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"adAccountId":{"type":"string","pattern":"^act_\\d+$"},"objectId":{"type":"string","pattern":"^\\d+$"},"status":{"type":"string","enum":["ACTIVE","PAUSED"]},"campaignRecordId":{"type":"string","format":"uuid"}},"required":["adAccountId","objectId","status"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/usage/x":{"get":{"operationId":"getXUsage","summary":"X API usage for the organization","description":"X API fees are passed through at X's published rates; this totals the organization's usage.","tags":["Usage"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request, or no profile named","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Profile, account, or object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The connected account cannot do this (expired connection, unsupported platform, or missing permission)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The platform's API failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key from Settings → API keys, sent as `Authorization: Bearer <key>`."}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","examples":["invalid_request"]},"message":{"type":"string"},"details":{}}}}},"AggregateResponse":{"type":"object","required":["status","errors"],"properties":{"status":{"type":"string","enum":["complete","partial"]},"errors":{"type":"array","items":{"type":"object","required":["platform","accountId","code","message"],"properties":{"platform":{"type":"string"},"accountId":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}}}}},"additionalProperties":true}}}}