{"openapi":"3.1.0","info":{"title":"Cherrie One API","version":"1.0.0","description":"One ads API across Meta, Google, and TikTok. GET /campaigns reads each connected account's campaigns directly from the ad platform. POST /campaigns creates one campaign on one platform. PATCH /campaigns/{id} updates that native campaign. Objective, status, and budget use Cherrie's names and are translated per platform. GET /autopilot-campaigns lists autopilot groups: one daily budget and bid strategy shared by existing native campaigns. POST /autopilot-campaigns creates a group and PATCH /autopilot-campaigns/{id} updates or archives one. Authenticate with a per-brand secret key: `Authorization: Bearer cherrie_sk_…`. Money is in major currency units (dollars, not cents). List endpoints paginate with an opaque `cursor`; partial platform failures are reported in `page.platform_errors` alongside the data that did load."},"servers":[{"url":"/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Accounts","description":"Active ad accounts connected to the brand."},{"name":"Autopilot campaigns","description":"Create, update, archive and read autopilot groups and the native campaigns in each."},{"name":"Manual campaigns","description":"Campaigns on each connected ad account, read live from the platform."},{"name":"Ad groups","description":"Ad groups inside a native campaign. Meta calls them ad sets. X calls them line items."},{"name":"Ads","description":"Ads launched into a Cherrie campaign on one channel, including creative summaries."},{"name":"Ad templates","description":"Create and manage reusable launch templates shared with the library."},{"name":"Other","description":"Search, a date-window summary, Shopify store sales, audiences, pixels, pages, posts, products, and library media."},{"name":"Customers","description":"The brand's Customers directory: profiles, tags, and lifetime value."}],"paths":{"/accounts":{"get":{"summary":"List connected ad accounts","description":"Every active ad account connected to the brand, keyed by platform like the other lists, one row per account id. Deactivated accounts are omitted. A Google manager account is omitted, and customers under it are omitted until that client is active on the brand. `platform` keeps one or more platforms. `include=metrics` adds each account's `metrics` for the date window and ranks each platform by spend; `granularity=day` requests those metrics on its own and adds `metrics.daily`. `include=lifetime_spend` adds all-time spend in major units on those active accounts (Meta amount_spent, Google cost since 2000-01-01, TikTok query_lifetime; X and OpenAI are null) and ranks by it when window metrics were not requested. `store_connected` says whether a Shopify store is linked to the brand (no Shopify call).","tags":["Accounts"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"granularity","in":"query","required":false,"schema":{"default":"total","type":"string","enum":["total","day"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAccountsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/autopilot-campaigns":{"get":{"summary":"List autopilot campaigns","description":"The brand's autopilot groups, newest first. Each one lists `platform_campaigns`: the native campaigns in the group with their `budget_split`, the same ids GET /campaigns and GET /ad-groups use. `platform` keeps campaigns that run on one of those channels. `status=active`, `status=paused` or `status=archived` limits the list; omit it for every status. Pass `campaign_ids` to read specific autopilot campaigns. `include=metrics` adds `metrics` for the date window, rolled up across channels, plus each channel's own `metrics` on its `platform_campaigns` entry, and ranks by spend. `granularity=day` adds `metrics.daily` on that rollup, one entry per date summed across channels. Pages with `limit` and `cursor`.","tags":["Autopilot campaigns"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","tiktok","google"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","archived"]}},{"name":"campaign_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","enum":["total","day"]}},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAutopilotCampaignsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Create an autopilot group","description":"Saves a new autopilot group: one `daily_budget` and bid strategy shared by existing native campaigns. `campaigns` lists them by `campaign_id`, `platform` and `account_id` (as GET /campaigns returns them); a campaign can be in one group only. `min_amount` or `max_amount` (not both) bounds a campaign's daily spend in dollars; omitted means auto. Neither can exceed `daily_budget`, and all `min_amount`s together must add up to `daily_budget` or less. `goal` is `{ type: auto }` or `cpa` / `roas` / `mer` with a target `value` (the bid amount). `status` defaults to `paused`. Nothing changes on the ad platforms; Cherrie ops is notified.","tags":["Autopilot campaigns"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"daily_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"status":{"default":"paused","type":"string","enum":["active","paused"]},"goal":{"default":{"type":"auto","value":null},"type":"object","properties":{"type":{"type":"string","enum":["auto","cpa","roas","mer"]},"value":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["type","value"]},"campaigns":{"minItems":1,"type":"array","items":{"type":"object","properties":{"campaign_id":{"type":"string","minLength":1},"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string","minLength":1},"min_amount":{"type":"number","minimum":0.01},"max_amount":{"type":"number","minimum":0.01}},"required":["campaign_id","platform","account_id"]}}},"required":["name","daily_budget","campaigns"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopilotCampaignResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/autopilot-campaigns/{id}":{"patch":{"summary":"Update an autopilot group","description":"Send only the fields to change: the same fields as create, plus `archived`. `campaigns` replaces the whole member list. Nothing changes on the ad platforms; Cherrie ops is notified. The budget rules are rechecked against the final budget and campaigns. `archived: true` pauses the group and releases its campaigns so they can join another group; `archived: false` restores it paused. An archived group cannot be set active.","tags":["Autopilot campaigns"],"parameters":[{"name":"id","in":"path","required":true,"description":"Autopilot campaign id (uuid) from GET /autopilot-campaigns.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused"]},"daily_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"goal":{"type":"object","properties":{"type":{"type":"string","enum":["auto","cpa","roas","mer"]},"value":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["type","value"]},"campaigns":{"minItems":1,"type":"array","items":{"type":"object","properties":{"campaign_id":{"type":"string","minLength":1},"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string","minLength":1},"min_amount":{"type":"number","minimum":0.01},"max_amount":{"type":"number","minimum":0.01}},"required":["campaign_id","platform","account_id"]}},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopilotCampaignResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/campaigns":{"get":{"summary":"List campaigns","description":"Campaign info and status, grouped by platform, in each platform's own order (Meta pages its listing in Meta's order; other platforms list active campaigns first). Omit `platform` for every connected platform; set it to one or more platforms (`platform=meta,google`) to return only those groups. `status=active` or `status=inactive` limits the campaigns inside those groups. Pass `campaign_ids` to read specific platform campaign ids. `limit` defaults to 25 per platform (without metrics). Meta campaigns include `bid_strategy` (`auto`, `cost_cap`, `bid_cap`, or `roas_goal`), the same values `POST /campaigns` accepts. Other platforms omit it. `created_at` is when the platform created the campaign. Google and OpenAI omit it. `include=metrics` adds each campaign's `metrics` for the date window and ranks every platform by spend together; `limit` then counts all platforms, so a page is the brand's next top spenders. Campaigns that did not deliver follow once every platform's spenders are paged, with zero metrics. `has_activity=true` leaves those out and keeps a campaign that spent nothing but still has results. `granularity=day` adds `metrics.daily`, one entry per day that delivered.","tags":["Manual campaigns"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"campaign_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"granularity","in":"query","required":false,"schema":{"default":"total","type":"string","enum":["total","day"]}},{"name":"has_activity","in":"query","required":false,"description":"With `include=metrics` or `granularity=day`. `true` returns only rows that reported spend, impressions, clicks, or results. A row with results and no spend stays.","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"style":"form","explode":false},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListCampaignsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Create a campaign","description":"Creates one campaign on `account_id`. `platform` is optional and defaults to that account's platform; pass it when the same id is connected on more than one platform. On Meta and TikTok, `objective` is `sales`, `leads`, `traffic`, `awareness`, `engagement`, or `app_installs` (default `sales`). On Google it is the campaign type: `search`, `display`, `demand_gen`, `performance_max`, `shopping`, or `app` (default `search`). Shopping uses the account's linked Merchant Center; send `merchant_id` when several are linked. App requires `app_id`, an Android package name. X does not use it. `status` defaults to `paused`. Send `daily_budget`. Meta and TikTok may send `lifetime_budget` instead, not both. Google takes `daily_budget` only. Meta and TikTok default to a campaign budget; set `budget_level` to `ad_group` and omit both amounts to put the budget on each ad group instead. X always uses the ad group, so omit both. Meta takes `bid_strategy` (`auto`, `cost_cap`, `bid_cap`, or `roas_goal`) on a campaign budget and on an ad-group budget, defaulting to `auto`. `auto` is highest volume or value. `roas_goal` is a minimum return on ad spend, offered on every Meta account. Meta rejects it when the account cannot use it. Meta ad-group budgets also take `budget_sharing` (true or false), defaulting to true. Google `bid_strategy` depends on the type, default first: search and display take `maximize_clicks` (`bid_amount` is the max CPC limit), `maximize_conversions` (`bid_amount` is the target CPA, search only), `maximize_conversion_value` (`roas_goal`, 2.5 = 250%), or `manual_cpc`; Demand Gen takes the three maximize strategies with no amounts; Performance Max takes `maximize_conversions` (target CPA) or `maximize_conversion_value` (`roas_goal`); shopping is `manual_cpc`; app takes no bid fields. Google `countries` (ISO codes) and `locations` (`{ id, exclude }` places from GET /targeting-search?platform=google; `exclude: true` leaves a place out) set where the campaign runs; omitted means every country. Demand Gen rejects both; set them on each ad group. Google `eu_political_ads` defaults to false. TikTok `smart_plus` defaults to true (an Upgraded Smart+ campaign). Set it to false for a regular campaign. Smart+ supports `sales`, `leads`, and `app_installs`.\n\nPlatform-specific fields: `bid_strategy` (meta, google), `budget_sharing` (meta), `special_ad_category` (meta), `special_ad_country` (meta), `eu_political_ads` (google), `merchant_id` (google), `app_id` (google), `countries` (google), `locations` (google), `smart_plus` (tiktok).","tags":["Manual campaigns"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":255},"status":{"default":"paused","type":"string","enum":["active","paused"]},"objective":{"type":"string","enum":["sales","leads","traffic","awareness","engagement","app_installs","search","display","demand_gen","performance_max","shopping","app"]},"budget_level":{"type":"string","enum":["campaign","ad_group"]},"budget_sharing":{"type":"boolean"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal","maximize_clicks","maximize_conversions","maximize_conversion_value","manual_cpc"]},"bid_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"roas_goal":{"type":"number","minimum":0,"exclusiveMinimum":true},"daily_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"lifetime_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"special_ad_category":{"type":"string","enum":["employment","housing","credit","issues_elections_politics","financial_products_services","online_gambling_and_gaming"]},"special_ad_country":{"type":"string","pattern":"^[A-Za-z]{2}$"},"funding_instrument_id":{"type":"string","minLength":1},"eu_political_ads":{"type":"boolean"},"merchant_id":{"type":"string","pattern":"^\\d+$"},"app_id":{"type":"string","minLength":1},"countries":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"locations":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"exclude":{"type":"boolean"}},"required":["id"]}},"smart_plus":{"type":"boolean"}},"required":["account_id","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCampaignResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/campaigns/options":{"get":{"summary":"List campaign options","description":"Every field `POST /campaigns` takes for `platform` (`meta` only so far), in the order to pick them. `key` is the create field and `options` every value it accepts. `recommended` is the value to suggest first. `when` names the field and values that unlock this one (`daily_budget` only with `budget_level: campaign`, `special_ad_country` only with a special ad category). `kind: amount` or `text` means `options` are suggestions and any valid value works. `locked_after_create` marks fields the platform cannot change later. `account_id` choices are the brand's active ad accounts on that platform. No platform call is made.","tags":["Manual campaigns"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["meta"]}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignOptionsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/campaigns/{id}":{"patch":{"summary":"Update a campaign","description":"Renames, pauses, or activates one native campaign, or changes the budget and Meta bid strategy stored on it. `{id}` is the platform campaign id. The account is resolved from that id. Send only the fields to change; at least one of `name`, `status`, `daily_budget`, `lifetime_budget`, `bid_strategy`, or `locations` is required. Google `locations` (not Demand Gen) is the full new list of places, `[{ id, exclude? }]`, and replaces the current ones; `[]` targets every location. GET /campaigns with `campaign_ids` returns a Google campaign's current `locations`. Send `daily_budget` or `lifetime_budget`, the same fields GET returns. A budget is accepted only when GET /campaigns returned that field for this campaign. X budgets that live on ad groups are rejected here. Google `bid_strategy` takes the names its type accepts on POST, with `bid_amount` or `roas_goal`; an amount alone changes the current strategy's amount, and a strategy sent alone clears its amount. Meta `bid_strategy` uses `auto`, `cost_cap`, `bid_cap`, or `roas_goal`. Other platforms reject it. Switching a campaign that already has ad groups to `cost_cap` or `bid_cap` requires `bid_amount` (major units), and to `roas_goal` requires `roas_goal` (decimal, 2.5 = 250%); Meta sets that amount on every ad group in the campaign, and each can be changed afterwards with PATCH /ad-groups/{id}. `status: archived` stops the campaign for good and is sent alone: Meta ARCHIVED, Google REMOVED, TikTok DELETE. None can be undone. X and OpenAI reject it.\n\nPlatform-specific fields: `bid_strategy` (meta, google), `locations` (google). Set when created and cannot be changed: `objective`, `budget_sharing`, `special_ad_category`, `special_ad_country`, `eu_political_ads`, `merchant_id`, `app_id`, `countries`, `smart_plus`.","tags":["Manual campaigns"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native platform campaign id from GET /campaigns. The connected account is resolved from this id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused","archived"]},"daily_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"lifetime_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal","maximize_clicks","maximize_conversions","maximize_conversion_value","manual_cpc"]},"bid_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"roas_goal":{"type":"number","minimum":0,"exclusiveMinimum":true},"locations":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"exclude":{"type":"boolean"}},"required":["id"]}},"objective":{"description":"Not changeable. The goal is set when the campaign is created; sending it is refused."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCampaignResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/campaigns/{id}/duplicate":{"post":{"summary":"Duplicate a campaign","description":"Copies one native campaign, including its ad groups and ads. `{id}` is the platform campaign id. The account is resolved from that id. The copy is paused unless `status` is `active`. `name` renames the copy; omit it and the platform appends \" - Copy\". Meta copies synchronously up to 3 child ads and asynchronously above that. Google, TikTok, X, and OpenAI return unsupported_operation.","tags":["Manual campaigns"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native platform campaign id from GET /campaigns. The connected account is resolved from this id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualCampaignResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-groups":{"get":{"summary":"List ad groups","description":"`campaign_ids` lists those campaigns' ad groups and `ad_group_ids` returns those ad groups (a union), the same way GET /campaigns takes `campaign_ids`. Each is one vendor-filtered read per account, and `account_id` narrows to one account. A Meta ad group includes `customer_type` when it has one (`all`, `new`, or `new_and_engaged`) — the Sales value goal, not the targeting — and `targeting_summary` when its targeting includes or excludes custom audiences. A Meta ad group named in `ad_group_ids` also includes the campaign daily budget, spend limits, schedule, optimization goal, billing event, attribution, promoted object, and targeting. `data` is keyed by platform, like GET /campaigns, in each platform's own order (Meta pages its listing in Meta's order; other platforms list delivering ad groups first). `limit` (default 25) is per platform without metrics, and `page.next_cursor` continues. `include=metrics` adds each ad group's `metrics` for the date window and ranks every platform by spend together; `limit` then counts all platforms, so a page is the brand's next top spenders. Ad groups that did not deliver follow once every platform's spenders are paged, with zero metrics. `has_activity=true` leaves those out and keeps an ad group that spent nothing but still has results. `granularity=day` adds `metrics.daily` (at most 31 days, or any window when `ad_group_ids` names the ad groups). `status` is the ad group's own switch; `effective_status` is whether it is delivering after its campaign and schedule (an active ad group in a paused campaign stays `status: active` and `effective_status` is `Campaign Paused` on Meta and Google, or `Campaign Disabled` on TikTok). Filter either with `active` or `inactive`. Omit the id filters to list every connected account (narrow with `platform`, one or more platforms, or `account_id`; a platform without ad groups is rejected); a failing account is reported in `page.platform_errors`. Meta calls these ad sets. X calls them line items. `bid_strategy` is `auto`, `cost_cap`, `bid_cap`, or `roas_goal`. On Meta it is the parent campaign's strategy and says which cap the ad set takes: `bid_amount` for a cost or bid cap, `roas_goal` for a ROAS goal, neither for `auto`. TikTok and X set it on the ad group (X target cost is `cost_cap`, maximum bid is `bid_cap`). Google omits it. `created_at` is when the platform created the ad group. Google omits it. A field this platform does not store is omitted, not returned as false or null. `smart_plus` is TikTok only. `daily_budget` or `lifetime_budget` is included only when that platform stores the budget on the ad group. X always does. Google never does. Meta and TikTok do only when the campaign does not hold it, so a campaign-budget ad set omits both.","tags":["Ad groups"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"effective_status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"campaign_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"ad_group_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"granularity","in":"query","required":false,"schema":{"default":"total","type":"string","enum":["total","day"]}},{"name":"has_activity","in":"query","required":false,"description":"With `include=metrics` or `granularity=day`. `true` returns only rows that reported spend, impressions, clicks, or results. A row with results and no spend stays.","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"style":"form","explode":false},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAdGroupsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Create an ad group","description":"Creates one ad group in a native campaign. `campaign_id` is enough; the account is the one that owns that campaign. `daily_budget` or `lifetime_budget` is required when the ad group holds it (on Meta or TikTok when the campaign was created with `budget_level=ad_group`). Leave both off when the campaign holds it. On Meta, the campaign's `bid_strategy` decides the ad group: `auto` takes no cap, `cost_cap` and `bid_cap` require `bid_amount`, and `roas_goal` requires `roas_goal` (2.5 means 250%). A Meta ad group cannot pick a different strategy than its campaign. Meta conversion and value ad groups, and TikTok sales ad groups, take `pixel_id` and `event`. Omit `pixel_id` to use the pixel saved on the ad account. `event` defaults to purchase, or lead on a Meta leads campaign. An all-digit `event` is a custom conversion from GET /pixels: Meta sends that id and no pixel, TikTok still sends `pixel_id`. Google does not take a pixel event on the ad group. Google `cpc_bid` (max CPC, major units) is required on shopping and accepted only when the campaign bids `manual_cpc`. Google Demand Gen ad groups take `countries` (ISO codes; omitted means all) and `locations` (`{ id, exclude }` places from GET /targeting-search?platform=google). Meta Sales ad sets can set `customer_type`: `all` (every customer), `new` (exclude `existing_customer_ids`), or `new_and_engaged` (also exclude `engaged_audience_ids`). Meta only: `targeting` (Meta's targeting object; omitted means US, 18+) and `attribution_spec` (attribution windows). Under a Meta campaign that holds a daily budget, `min_spend` or `min_spend_percent` sets a daily spend floor and `max_spend` or `max_spend_percent` a daily cap (dollars, or a percent of the campaign budget); an ad set that holds its own budget rejects them. TikTok only: `location_ids` from GET /targeting-search (`platform=tiktok`, `type=location`); omitted means the United States. Under a TikTok Smart+ sales campaign this creates a Smart+ ad group (automatic targeting inside `location_ids`, conversion optimization on the pixel, which is required); Smart+ lead and app ad groups are rejected.\n\nPlatform-specific fields: `cpc_bid` (google), `pixel_id` (meta, tiktok), `event` (meta, tiktok), `bid_amount` (meta, tiktok), `roas_goal` (meta, tiktok), `min_spend` (meta), `min_spend_percent` (meta), `max_spend` (meta), `max_spend_percent` (meta), `targeting` (meta), `attribution_spec` (meta), `customer_type` (meta), `start_time` (meta, tiktok), `end_time` (meta, tiktok), `location_ids` (tiktok), `keywords` (google), `countries` (google), `locations` (google).","tags":["Ad groups"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"campaign_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"default":"paused","type":"string","enum":["active","paused"]},"daily_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"lifetime_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"bid_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"roas_goal":{"type":"number","minimum":0,"exclusiveMinimum":true},"cpc_bid":{"type":"number","minimum":0,"exclusiveMinimum":true},"countries":{"minItems":1,"maxItems":250,"type":"array","items":{"type":"string","pattern":"^[A-Za-z]{2}$"}},"locations":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^\\d+$"},"exclude":{"type":"boolean"}},"required":["id"]}},"pixel_id":{"type":"string","minLength":1},"event":{"type":"string","minLength":1},"start_time":{"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)))$"},"end_time":{"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)))$"},"customer_type":{"type":"object","properties":{"type":{"type":"string","enum":["all","new","new_and_engaged"]},"existing_customer_ids":{"type":"array","items":{"type":"string","minLength":1}},"engaged_audience_ids":{"type":"array","items":{"type":"string","minLength":1}}},"required":["type"]},"min_spend":{"type":"number","minimum":0,"exclusiveMinimum":true},"min_spend_percent":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100},"max_spend":{"type":"number","minimum":0,"exclusiveMinimum":true},"max_spend_percent":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":100},"targeting":{"type":"object","properties":{"age_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_range":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2},"genders":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"location_types":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"excluded_geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}}},"additionalProperties":{}},"locales":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"flexible_spec":{"type":"array","items":{"type":"object","properties":{"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"behaviors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}}},"additionalProperties":{}}},"custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"targeting_automation":{"type":"object","properties":{"advantage_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"individual_setting":{"type":"object","properties":{"age":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"gender":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}}},"additionalProperties":{}},"targeting_relaxation_types":{"type":"object","properties":{"custom_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"lookalike":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}},"publisher_platforms":{"type":"array","items":{"type":"string"}},"device_platforms":{"type":"array","items":{"type":"string"}},"facebook_positions":{"type":"array","items":{"type":"string"}},"instagram_positions":{"type":"array","items":{"type":"string"}},"messenger_positions":{"type":"array","items":{"type":"string"}},"audience_network_positions":{"type":"array","items":{"type":"string"}},"brand_safety_content_filter_levels":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"attribution_spec":{"minItems":1,"type":"array","items":{"type":"object","properties":{"event_type":{"type":"string","enum":["CLICK_THROUGH","VIEW_THROUGH","ENGAGED_VIDEO_VIEW"]},"window_days":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":9007199254740991}},"required":["event_type","window_days"]}},"location_ids":{"minItems":1,"maxItems":3000,"type":"array","items":{"type":"string","pattern":"^\\d+$"}},"keywords":{"minItems":1,"maxItems":200,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":80},"match_type":{"default":"broad","type":"string","enum":["broad","phrase","exact"]}},"required":["text"],"additionalProperties":false}]}}},"required":["campaign_id","name"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdGroupResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-groups/{id}":{"patch":{"summary":"Update an ad group","description":"Meta: name, status (`active`, `paused`, or `archived`), the stored budget, bid_amount on a cost or bid cap, roas_goal on a ROAS campaign (2.5 is sent as roas_average_floor 25000), min_spend or min_spend_percent and max_spend or max_spend_percent when the campaign holds the daily budget (`null` clears; a cleared cap uses Meta's sentinel), start_time and end_time (`null` end_time makes it ongoing; start_time only before the ad set starts), targeting (a full replacement, so send placements again), and `customer_type` on a Sales ad set (`all`, `new` with `existing_customer_ids`, or `new_and_engaged` with both audience lists). Amounts are major units. Google: name, status, cpc_bid (only under a manual CPC or shopping campaign), and `keywords` on a search ad group (the full new list, at least one; keywords already there are kept as they are, and GET /ad-groups with `ad_group_ids` returns the current ones). TikTok: name, status, the stored budget (at least 20), and start_time and end_time (UTC; `null` end_time runs from the start with no end, not allowed on a lifetime budget; start_time only before the ad group starts). A budget the campaign holds is rejected. Spend limits and targeting are Meta only. `status: archived` is sent alone and cannot be undone: Meta ARCHIVED, Google REMOVED, TikTok DELETE. X and OpenAI reject it.\n\nPlatform-specific fields: `cpc_bid` (google), `bid_amount` (meta), `roas_goal` (meta), `min_spend` (meta), `min_spend_percent` (meta), `max_spend` (meta), `max_spend_percent` (meta), `targeting` (meta), `customer_type` (meta), `start_time` (meta, tiktok), `end_time` (meta, tiktok), `keywords` (google). Set when created and cannot be changed: `pixel_id`, `event`, `attribution_spec`, `location_ids`, `countries`, `locations`.","tags":["Ad groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native ad group id. Meta calls this an ad set. The connected account is resolved from this id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused","archived"]},"daily_budget":{"type":"number","minimum":0},"lifetime_budget":{"type":"number","minimum":0,"exclusiveMinimum":true},"bid_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"roas_goal":{"type":"number","minimum":0,"exclusiveMinimum":true},"cpc_bid":{"type":"number","minimum":0,"exclusiveMinimum":true},"min_spend":{"nullable":true,"type":"number","minimum":0},"min_spend_percent":{"nullable":true,"type":"number","minimum":0,"maximum":100},"max_spend":{"nullable":true,"type":"number","minimum":0},"max_spend_percent":{"nullable":true,"type":"number","minimum":0,"maximum":100},"start_time":{"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)))$"},"end_time":{"nullable":true,"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)))$"},"targeting":{"type":"object","properties":{"age_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_range":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2},"genders":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"location_types":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"excluded_geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}}},"additionalProperties":{}},"locales":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"flexible_spec":{"type":"array","items":{"type":"object","properties":{"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"behaviors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}}},"additionalProperties":{}}},"custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"]}},"targeting_automation":{"type":"object","properties":{"advantage_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"individual_setting":{"type":"object","properties":{"age":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"gender":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}}},"additionalProperties":{}},"targeting_relaxation_types":{"type":"object","properties":{"custom_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"lookalike":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}},"publisher_platforms":{"type":"array","items":{"type":"string"}},"device_platforms":{"type":"array","items":{"type":"string"}},"facebook_positions":{"type":"array","items":{"type":"string"}},"instagram_positions":{"type":"array","items":{"type":"string"}},"messenger_positions":{"type":"array","items":{"type":"string"}},"audience_network_positions":{"type":"array","items":{"type":"string"}},"brand_safety_content_filter_levels":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"customer_type":{"type":"object","properties":{"type":{"type":"string","enum":["all","new","new_and_engaged"]},"existing_customer_ids":{"type":"array","items":{"type":"string","minLength":1}},"engaged_audience_ids":{"type":"array","items":{"type":"string","minLength":1}}},"required":["type"]},"keywords":{"minItems":1,"maxItems":200,"type":"array","items":{"anyOf":[{"type":"string","minLength":1,"maxLength":80},{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":80},"match_type":{"default":"broad","type":"string","enum":["broad","phrase","exact"]}},"required":["text"],"additionalProperties":false}]}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdGroupResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-groups/{id}/duplicate":{"post":{"summary":"Duplicate an ad group","description":"Copies one ad group and its ads. `{id}` is the native ad group id. The account is resolved from that id. The copy is paused unless `status` is `active`. `name` renames the copy. `campaign_id` places it in another campaign on the same account; omit it to keep the original campaign. `include_ads: false` copies the ad group without its ads. Google, TikTok, X, and OpenAI return unsupported_operation.","tags":["Ad groups"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native ad group id. Meta calls this an ad set. The connected account is resolved from this id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused"]},"campaign_id":{"type":"string","minLength":1},"include_ads":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdGroupResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-templates":{"get":{"summary":"List launch templates","description":"Templates shared with the library. `data` is keyed by platform, like GET /campaigns, and `limit` is per platform. Each template includes only that platform's fields. Pass `ids` to read specific templates (repeat the parameter or comma-separate). Filter by platform or archived state.","tags":["Ad templates"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"archived","in":"query","required":false,"schema":{"default":"active","type":"string","enum":["active","archived","all"]}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAdTemplatesResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Create a launch template","description":"Create a library template for Meta, Google Performance Max, TikTok, or X. The first live template per platform becomes the default unless is_default is false.","tags":["Ad templates"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"platform":{"type":"string","enum":["meta"]},"fb_page_id":{"type":"string","minLength":1},"ig_id":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"headlines":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}},"primary_text":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}}},"required":["name","url","platform","fb_page_id","ig_id","description","headlines","primary_text"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"platform":{"type":"string","enum":["google"]},"headlines":{"default":[],"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"long_headlines":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":90}},"descriptions":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":90}},"business_name":{"type":"string","minLength":1,"maxLength":25},"sitelinks":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","minLength":1}},"required":["text","url"],"additionalProperties":false}}},"required":["name","platform"],"additionalProperties":false},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"platform":{"type":"string","enum":["tiktok"]},"primary_text":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name","url","platform","primary_text"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdTemplateResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-templates/{id}":{"patch":{"summary":"Update a launch template","description":"Edit fields, switch the live default with is_default, or archive/restore with archived. Platform is immutable.","tags":["Ad templates"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"archived":{"type":"boolean"},"fb_page_id":{"type":"string","minLength":1},"ig_id":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"headlines":{"type":"array","items":{"type":"string","minLength":1}},"primary_text":{"type":"array","items":{"type":"string","minLength":1}},"long_headlines":{"type":"array","items":{"type":"string","minLength":1}},"descriptions":{"type":"array","items":{"type":"string","minLength":1}},"business_name":{"type":"string","minLength":1},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1},"url":{"type":"string","minLength":1}},"required":["text","url"],"additionalProperties":false}}},"additionalProperties":false}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdTemplateResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"summary":"Archive a launch template","description":"Soft archive, matching the library. Restore with PATCH archived:false.","tags":["Ad templates"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdTemplateResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ad-templates/{id}/duplicate":{"post":{"summary":"Duplicate a launch template","description":"Copies one library template into a new live template with the same platform fields. `{id}` is the template uuid. `name` renames the copy; omit it and the name is the original plus \" - copy\", matching the library. The copy becomes the platform default only when that platform has no live default.","tags":["Ad templates"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400}},"additionalProperties":false}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdTemplateResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ads":{"get":{"summary":"List ads","description":"`campaign_ids` (native, or Cherrie uuids covering every channel the campaign runs on) and `ad_group_ids` list their ads, and `ad_ids` returns those ads; together they are a union. Each level is one vendor-filtered read per account; `platform` and `account_id` narrow which accounts are asked. No id filters lists every connected account. `status` is the ad's own switch; `effective_status` is whether it is delivering after its campaign and ad group (an active ad in a paused campaign stays `status: active` and reports the raw reason, e.g. Meta `CAMPAIGN_PAUSED`). Filter either with `active` or `inactive`, like GET /ad-groups. `data` is keyed by platform. `limit` is per platform without metrics. `created_at` is when the platform created the ad. Google omits it. Meta and Google ads include `schedule` (`start_time` and `end_time`, ISO 8601) when the ad has its own window; a null side follows the parent, and the key is omitted when the ad follows the ad set (Meta) or campaign (Google). `include=metrics,creative` adds metrics and creative summaries (thumbnail, media type, copy, and a preview where the platform has one). `creative.id` is Meta's creative id; other platforms omit it. Meta sends `creative.type` (`single_video`, and so on) and omits `media_type`. The creative fields run `type`, `landing_url`, copy, `post_urls`, then the id and files. `include=previews` adds the creative plus every Meta placement embed on up to 25 ads. With metrics, every platform is ranked by spend together and `limit` counts all platforms, so a page is the brand's next top spenders; ads that did not deliver follow once every platform's spenders are paged, with zero metrics. `has_activity=true` leaves those out and keeps an ad that spent nothing but still has results. `granularity=day` adds `metrics.daily` (at most 31 days, or any window when `ad_ids` names the ads).","tags":["Ads"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"effective_status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"campaign_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"ad_group_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"ad_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"granularity","in":"query","required":false,"schema":{"default":"total","type":"string","enum":["total","day"]}},{"name":"has_activity","in":"query","required":false,"description":"With `include=metrics` or `granularity=day`. `true` returns only rows that reported spend, impressions, clicks, or results. A row with results and no spend stays.","schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]},"style":"form","explode":false},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAdsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Launch an ad","description":"Send template_id for a saved template, or template with the same fields as POST /ad-templates to create one and launch with it. Explicit settings override the template. TikTok Spark posts and Smart+ library videos (`platform_settings.library_video_ids`, which show `creative.body` or else the ad name) can omit it. Google templates publish full Performance Max asset groups. The call waits and returns the created ad, or an error if the platform rejects it. Meta takes ad_group_id (an existing ad set), creative.square_url or creative.story_url (or both) — or creative.type `carousel` with 2–10 creative.cards, or `dynamic` / `dynamic_carousel` with a creative.product_set_id (GET /product-sets) and no files — and an optional schedule (start_time and end_time, ISO 8601 with offset; an omitted side follows the ad set). Google takes the same schedule on an ad group ad (an omitted side follows the campaign; not on keywords, product groups, or Performance Max). Other platforms pass ad_group_id for an existing ad group, or campaign_id (a Cherrie campaign) to use that campaign's default ad group.","tags":["Ads"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"fb_page_id":{"type":"string","minLength":1},"ig_id":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"headlines":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}},"primary_text":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}}},"required":["name","url","fb_page_id","ig_id","description","headlines","primary_text"],"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"default":"paused","type":"string","enum":["active","paused"]},"campaign_id":{"type":"string","minLength":1},"ad_group_id":{"type":"string","minLength":1},"account_id":{"type":"string","minLength":1},"template_copy_index":{"type":"integer","minimum":0,"maximum":4},"creative":{"type":"object","additionalProperties":{}},"platform_settings":{"type":"object","additionalProperties":{}},"schedule":{"type":"object","properties":{"start_time":{"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)))$"},"end_time":{"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)))$"}}}},"required":["platform","name"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["google"]},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"headlines":{"default":[],"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"long_headlines":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":90}},"descriptions":{"default":[],"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":90}},"business_name":{"type":"string","minLength":1,"maxLength":25},"sitelinks":{"default":[],"maxItems":8,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":25},"url":{"type":"string","minLength":1}},"required":["text","url"],"additionalProperties":false}}},"required":["name"],"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"default":"paused","type":"string","enum":["active","paused"]},"campaign_id":{"type":"string","minLength":1},"ad_group_id":{"type":"string","minLength":1},"account_id":{"type":"string","minLength":1},"template_copy_index":{"type":"integer","minimum":0,"maximum":4},"creative":{"type":"object","additionalProperties":{}},"platform_settings":{"type":"object","additionalProperties":{}},"schedule":{"not":{}}},"required":["platform","name"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok"]},"template_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"template":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":400},"url":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000},"is_default":{"type":"boolean"},"primary_text":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["name","url","primary_text"],"additionalProperties":false},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"default":"paused","type":"string","enum":["active","paused"]},"campaign_id":{"type":"string","minLength":1},"ad_group_id":{"type":"string","minLength":1},"account_id":{"type":"string","minLength":1},"template_copy_index":{"type":"integer","minimum":0,"maximum":4},"creative":{"type":"object","additionalProperties":{}},"platform_settings":{"type":"object","additionalProperties":{}}},"required":["platform","name"],"additionalProperties":false}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ads/{id}":{"patch":{"summary":"Update an ad","description":"Meta: name, status (`active`, `paused`, `archived`, or `delete`), and schedule. `archived` sets ARCHIVED and `delete` sets DELETED. start_time cannot change after the ad has started. Single image and video ads also take `creative` changes (copy, link, page, `square_url`/`story_url`), which move the ad onto a new creative built from the live one. Google: status (`active`, `paused`, `archived`, or `delete`); `archived` and `delete` both set REMOVED, and app ads cannot be paused. Search, display, and Demand Gen ads also take `creative.headlines`, `creative.descriptions` (each replaces the list), `creative.landing_url`, and `creative.url_params` (the final URL suffix); search ads also `creative.path1`/`creative.path2` (display paths). Google rejects `schedule` and renames. Keywords, product groups, and Performance Max asset groups take status only. TikTok: name, status (`active`, `paused`, `archived`, or `delete`), and on Smart+ ads `creative.landing_url`, `creative.call_to_action`, and `creative.bodies` (ad texts) edited in place, plus platform_settings.tiktok_item_ids, library_video_ids (library media ids, posted as the ad's identity), and/or spark_code to append creatives, remove_tiktok_item_ids to take posts out, and rebuild_if_locked for ads TikTok refuses to edit. `archived` and `delete` both set operation_status DELETE. `archived` is sent alone, and neither can be undone. X and OpenAI cannot update an ad.\n\nPlatform-specific fields: `name` (meta, tiktok), `schedule` (meta), `platform_settings` (tiktok), `creative` (meta, google, tiktok).","tags":["Ads"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native platform ad id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string","minLength":1},"campaign_id":{"type":"string"},"ad_group_id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused","archived","delete"]},"schedule":{"type":"object","properties":{"start_time":{"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)))$"},"end_time":{"nullable":true,"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)))$"}}},"platform_settings":{"type":"object","properties":{"tiktok_item_ids":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"library_video_ids":{"minItems":1,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"remove_tiktok_item_ids":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"spark_code":{"type":"string","minLength":1},"identity_id":{"type":"string"},"identity_type":{"type":"string"},"identity_authorized_bc_id":{"type":"string"},"rebuild_if_locked":{"type":"boolean"}}},"creative":{"type":"object","properties":{"bodies":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}},"headlines":{"minItems":1,"maxItems":15,"type":"array","items":{"type":"string","minLength":1}},"descriptions":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1}},"description":{"type":"string"},"landing_url":{"type":"string","format":"uri"},"call_to_action":{"type":"string","minLength":1},"url_params":{"type":"string"},"path1":{"type":"string","maxLength":15},"path2":{"type":"string","maxLength":15},"page_id":{"type":"string","minLength":1},"instagram_id":{"type":"string","minLength":1},"square_url":{"type":"string","format":"uri"},"story_url":{"type":"string","format":"uri"},"cards":{"minItems":2,"maxItems":10,"type":"array","items":{"type":"object","properties":{"headline":{"type":"string"},"description":{"type":"string"},"landing_url":{"type":"string","format":"uri"}}}}}}},"required":["platform","account_id"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/ads/{id}/duplicate":{"post":{"summary":"Duplicate an ad","description":"Reuses one ad's creative in a required destination ad set on the same account. `{id}` is the native ad id. `name`, `status`, and `schedule` live on the ad and are set inline (paused unless `status` is `active`; an omitted schedule side follows the ad set). Any `creative` or `platform_settings` key builds a new creative from the source plus the overrides — blank fields are inherited, so a lone `headline` keeps everything else. Without overrides both ads share the same creative and post. When a reuse is refused, the `/copies` clone runs instead and the response carries `fallback: \"copies\"`. Google, TikTok, X, and OpenAI return unsupported_operation.","tags":["Ads"],"parameters":[{"name":"id","in":"path","required":true,"description":"Native platform ad id.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ad_group_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":400},"status":{"type":"string","enum":["active","paused"]},"schedule":{"type":"object","properties":{"start_time":{"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)))$"},"end_time":{"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)))$"}}},"creative":{"type":"object","properties":{"headline":{"type":"string","maxLength":400},"body":{"type":"string","maxLength":2000},"landing_url":{"type":"string","format":"uri"},"call_to_action":{"type":"string"},"square_url":{"type":"string","format":"uri"},"story_url":{"type":"string","format":"uri"},"wide_url":{"type":"string","format":"uri"},"description":{"type":"string"},"headlines":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":400}},"bodies":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}}}},"platform_settings":{"type":"object","properties":{"page_id":{"type":"string","minLength":1},"instagram_id":{"type":"string","minLength":1},"url_params":{"type":"string","maxLength":2000}}}},"required":["ad_group_id"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateAdResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/search":{"get":{"summary":"Search campaigns, ad groups, and ads","description":"Name or id search across every connected account. Repeat `q` for each chip: `campaign:summer`, `ad_group:retarget` (`adset:` is the same), or `ad:ugc`. A chip that is only digits looks up that id. Anything else is a case-insensitive name substring. `match` (default `or`) unions or intersects chips on the same level. Chips on different levels always keep the deeper rows that sit inside the shallower matches, even when `match` is `or`. The deepest chip is the result (`page.level`): campaign chips return campaigns and leave ad groups and ads empty; an ad group chip returns those ad groups plus a campaign card per parent; an ad chip returns those ads plus parent ad groups and campaigns. Parent spend, impressions, and clicks are the sum of the matched children. No match is empty lists and `matched_count` 0 — the unfiltered account is not returned. `platform` and `account_id` narrow which accounts are searched. Dates are the metrics window (`preset`, or `from` and `to`, default `last_7d`). Each chip stops at 2000 rows. A failing account is listed in `page.platform_errors`.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":true,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"match","in":"query","required":false,"schema":{"default":"or","type":"string","enum":["or","and"]}},{"name":"campaign_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"ad_group_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/summary":{"get":{"summary":"Get summary","description":"One read of a date window (default `last_7d`). `store`: the connected Shopify store's totals, daily rows, first-half vs. second-half trend, and best and worst days, under Shopify's own names. Omitted when no store is connected, and so is `store_connected`. `channels`: spend, impressions, clicks, CTR, CPC, CPM, conversions, conversion value, and ROAS for every connected ad platform and added together, each platform's spend share and trend, and daily total spend, clicks, and CPC plus spend per platform (with or without a store). Conversions are Meta purchases and the account's primary conversions on Google and TikTok. With both and a store connected, `blended` has MER (store total sales ÷ ad spend), its trend, daily MER, best and worst MER days, and how closely daily spend moves with daily sales; each platform also gets `store_sales_correlation` and `claimed_revenue_percent`. `weekday_vs_weekend` and seven-day `weeks` cover whichever sections were read. `sections=store` or `sections=channels` reads only that part and skips the other's vendor calls. Days are the brand timezone, else the shop's. Ad accounts that fail to report are listed in `page.platform_errors`.","tags":["Other"],"parameters":[{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"sections","in":"query","required":false,"description":"`store`, `channels`, or both (default). Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["store","channels"]}},{"type":"string"}]},"style":"form","explode":false}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/shopify":{"get":{"summary":"Get Shopify sales","description":"The connected Shopify store's sales report for a date window (default `last_7d`). Read through Admin GraphQL `shopifyqlQuery` on the `sales` report, not the Orders API. `by=store` (default) is the window totals under the same names as GET /summary's store section. `by=product` is the top products by net sales, and `by=product_type` is the top product types; `limit` (default 10, max 100) is how many, and the remainder is left out. Pass `product_id` or `product_type` to read those rows instead of the top list. `granularity=day` adds `daily` on each named row, zero-filled for every calendar day, plus the window totals. Each row has `net_sales`, `gross_sales`, `total_sales`, `orders`, `net_items_sold`, and `average_order_value` (total sales ÷ orders). Days are the brand timezone, else the shop's. No store connected is not an error: `store_connected` is false and the asked-for breakdown is null or empty.","tags":["Other"],"parameters":[{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"by","in":"query","required":false,"description":"`store` (default) is the window totals. `product` is top products by net sales. `product_type` is top product types by net sales.","schema":{"default":"store","type":"string","enum":["store","product","product_type"]}},{"name":"limit","in":"query","required":false,"description":"How many products or product types to return. Ignored when `by` is `store` or when specific ids are named.","schema":{"default":10,"type":"integer","minimum":1,"maximum":100}},{"name":"granularity","in":"query","required":false,"description":"`day` adds `daily` on each named product or product type. Requires `product_id` or `product_type`.","schema":{"default":"total","type":"string","enum":["total","day"]}},{"name":"product_id","in":"query","required":false,"description":"With `by=product`. Repeat or comma-separate Shopify product ids. Names those products instead of the top list.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"product_type","in":"query","required":false,"description":"With `by=product_type`. Repeat or comma-separate product type names. Names those types instead of the top list.","schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShopifyResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audiences":{"get":{"summary":"List audiences","description":"Audiences an account can target or exclude. Omit `platform` for Meta custom audiences, Google user lists, TikTok custom audiences, and X custom audiences. Each row has `id`, `name`, and the vendor kind (`type`) plus an approximate `size` and `description` when the platform sends them. `id` is what Meta `customer_type` sends as `existing_customer_ids` or `engaged_audience_ids`. `account_id` keeps one ad account. `limit` is per platform. OpenAI has no audiences.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAudiencesResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/pixels":{"get":{"summary":"List pixels","description":"Pixels on Meta and TikTok, and the Google tag (`AW-{conversion_tracking_id}`), for every connected account. `data` is keyed by platform. Omit `platform` for all three. `limit` is per platform. Each pixel includes its events. `pixel_id` is what POST /ad-groups sends on Meta and TikTok, and an event `id` is what it sends as `event`. Google's tag is listed so a caller can see it; the ad group does not send it. X and OpenAI are not accepted. A failing account is listed in `page.platform_errors`.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPixelsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/targeting-search":{"get":{"summary":"Search targeting","description":"Meta detailed targeting (`type=interest`), languages (`type=locale`), and geo locations (`type=location`) for one ad account. An interest `id` goes in `targeting.interests[].id` (or `flexible_spec`); a locale `id` goes in `targeting.locales` as a number; a location `id` is its key under `targeting.geo_locations` (include) or `targeting.excluded_geo_locations` (exclude) for its `location_type` (country codes go in `countries`). Location rows also carry `country_code`, `country_name`, and for cities and zips `region` and `region_id`. TikTok (`platform=tiktok`) takes `type=location` only: countries, states/provinces, cities, and DMAs (`geo_market`), whose `id` goes in POST /ad-groups `location_ids`. Zip codes are not returned for TikTok. Google (`platform=google`) takes `type=location` only: countries, states, cities, postal codes, and metros (`geo_market`), whose `id` goes in Google `locations` on POST /campaigns, or on POST /ad-groups for Demand Gen.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["meta","tiktok","google"]}},{"name":"account_id","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"type","in":"query","required":true,"schema":{"type":"string","enum":["interest","locale","location"]}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetingSearchResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/pages":{"get":{"summary":"List pages","description":"Who an ad can post as. `data` is keyed by platform and `limit` is per platform. Omit `platform` for Meta, TikTok, and X. Meta: Facebook pages and Instagram accounts saved on the brand (`type` `facebook_page` or `instagram`). TikTok: the advertiser's identities as separate `owned` and `creators` arrays (`owned` is `TT_USER`, `BC_AUTH_TT`, and `CUSTOMIZED_USER`; `creators` is `AUTH_CODE`), each alphabetical — follow `page.next_cursor` for the next vendor page. `limit` applies to each TikTok array. `identity_type` keeps `TT_USER`, `BC_AUTH_TT`, `AUTH_CODE`, or `CUSTOMIZED_USER` by only filling that array. Rows do not include an ad account id or a Business Center id. `account_id` on the query keeps one TikTok or X account. Google and OpenAI are not accepted.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"identity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPagesResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/posts":{"get":{"summary":"List promotable posts","description":"Organic posts one identity can promote (TikTok Spark Ads), newest first, paged with `cursor`. Pass the chosen ids as `tiktok_item_ids` on `POST /ads`.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["tiktok"]}},{"name":"account_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"identity_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPostsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/product-sets":{"get":{"summary":"List Meta product sets","description":"Catalog product sets one Meta ad account already runs catalog ads from, found from its ads' creatives (ad tokens usually cannot read catalogs directly). Each set has its name, `product_count`, and up to 5 `sample_products` for previewing catalog ad text. A set `id` is the creative's `product_set_id`. Sorted by name. Meta only.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":true,"schema":{"type":"string","enum":["meta"]}},{"name":"account_id","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProductSetsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/products":{"get":{"summary":"List Shopping products","description":"Google only. Merchant Center products on one Google Ads account, read through Google Ads, so no Merchant Center access is needed. Each row has the feed title, brand, image, price, availability, whether Google can serve it (`status`) and any feed `issues`. `campaign_id` scopes the list and the status to one Shopping or Performance Max campaign. `include=metrics` adds each product's spend, clicks, conversions and revenue for the date window (zero when it did not deliver), ranks by spend, and adds products that delivered but have left the feed with `status: unknown`. Days are the account's timezone. Pages with `limit` and `cursor`.","tags":["Other"],"parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"campaign_id","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d+$"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"preset","in":"query","required":false,"schema":{"type":"string","enum":["today","yesterday","last_3d","last_7d","last_14d","last_28d","last_30d","last_90d","this_week_mon_today","last_week_mon_sun","this_month","last_month","this_quarter","last_quarter","this_year","last_year"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProductsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/products/{id}":{"patch":{"summary":"Edit a Shopping product","description":"Changes how one product looks in Google Shopping ads: `title`, `description`, the main image (`image_url`, or `media_id` for a Cherrie library image), and `additional_image_urls` (up to 10). Needs Google Merchant Center connected on the Connectors page. The edit goes into Cherrie's own supplemental feed, which outranks the brand's other feeds, so a Shopify or other feed sync does not undo it; fields you do not send keep their current value. `null` removes Cherrie's override for that field so the feed value shows again. When the product is in more than one feed (several countries or languages), send `feed_label` and `content_language`. Google reprocesses and may re-review the product, so the response says `accepted`; it can take a few hours to show in ads.","tags":["Other"],"parameters":[{"name":"id","in":"path","required":true,"description":"Merchant Center offer id (`item_id` from GET /products or GET /merchant-center/products). Matched case-insensitively.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"nullable":true,"type":"string","minLength":1,"maxLength":150},"description":{"nullable":true,"type":"string","minLength":1,"maxLength":5000},"image_url":{"nullable":true,"type":"string","format":"uri"},"media_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"additional_image_urls":{"nullable":true,"maxItems":10,"type":"array","items":{"type":"string","format":"uri"}},"feed_label":{"type":"string","minLength":1,"maxLength":20},"content_language":{"type":"string","pattern":"^[a-z]{2}$"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductEditResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/products/{id}/overrides":{"delete":{"summary":"Undo a Shopping product edit","description":"Removes every field Cherrie set on the product with PATCH /products/{id}, so it shows its feed values again. `reverted` is false when Cherrie had no edit on it. Send `feed_label` and `content_language` when the product is in more than one feed.","tags":["Other"],"parameters":[{"name":"id","in":"path","required":true,"description":"Merchant Center offer id (`item_id` from GET /products or GET /merchant-center/products). Matched case-insensitively.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feed_label":{"type":"string","minLength":1,"maxLength":20},"content_language":{"type":"string","pattern":"^[a-z]{2}$"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductRevertResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/merchant-center/products":{"get":{"summary":"List Merchant Center products","description":"Products in the brand's connected Google Merchant Center, after every feed and Cherrie edit is applied: title, description, images, `status` across destinations (`approved`, `limited`, `disapproved`, `pending`), and product `issues`. Needs Merchant Center connected on the Connectors page; GET /products reads the same feed through a Google Ads account instead. `search` matches title or item id. Sorted by title. Pages with `limit` and `cursor`.","tags":["Other"],"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMerchantProductsResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/merchant-center/issues":{"get":{"summary":"List Merchant Center account issues","description":"Problems with the whole Merchant Center account, such as a suspension, an unverified website, or missing shipping or return policies, most severe first. Each has Google's `title`, `detail`, and a `documentation_url` for fixing it. Product-level problems are on GET /merchant-center/products.","tags":["Other"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMerchantIssuesResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/customers":{"get":{"summary":"List or count customers","description":"The Customers page directory, newest first, unless `group_by` or `ids` is set. Each person has name, email, phone, company, address, tags, custom fields, and lifetime value in dollars. `ids` (repeat or comma-separate, up to 25, the same shape as `ids` on GET /campaigns) returns those people the way the individual customer page does: the same profile, plus `overview` (first seen, sessions, activity counts, and the activity chart), and a page of `events`, `messages`, and `memories`, newest first. `limit` and `cursor` page those three feeds. Ids that are not on this brand are left out. `group_by=city` (or `state`, `postal_code`, `country`, `company`) counts that field in the database instead of listing people. Do not pass `ids` and `group_by` together. Capitalization is folded, so Austin, AUSTIN, and austin are one bucket, labeled with the spelling most of those customers use. A timezone saved in city, such as Europe/London, is not a city and is left out of a city count. `data` is then `{ value, count }` ranked highest first. `page.total` is the filtered customer count when listing, the number of distinct values when grouping, and how many requested ids were found when `ids` is set. Grouped responses also include `page.customers` (how many customers matched) and `page.blank` (matched customers who left the field empty, or whose city is a timezone; they are not a bucket). `search`, `tags` (`__no_tags__` for none), `tag_mode`, `company`, `city`, `state`, `country`, and `postal_code` narrow the directory and the count. Location filters are case-insensitive contains (`city=los` matches Los Angeles). Pages with `limit` and `cursor`.","tags":["Customers"],"parameters":[{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["city","state","postal_code","country","company"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"tag_mode","in":"query","required":false,"schema":{"default":"is_any","type":"string","enum":["is_any","is_all","is_not_any","is_not_all"]}},{"name":"company","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"style":"form","explode":false},{"name":"city","in":"query","required":false,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"country","in":"query","required":false,"schema":{"type":"string"}},{"name":"postal_code","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomersResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Create customers","description":"Creates one customer, or a JSON array of up to 500. Fields are the same ones GET /customers returns. `name`, `id`, `lifetime_value`, `created_at`, and `updated_at` are filled in by the server and ignored if you send them. `tags` are tag definition ids, or the `{ id, name }` objects from GET; names are ignored. Tags you send are added to the brand's default new-customer tags. A matching email, phone, Instagram username, or LinkedIn URL updates that existing person instead of inserting a second one. One object returns `{ data: person }`. An array returns `{ data: [person, ...] }` in the same order, with `page.total`.","tags":["Customers"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"description":"Job title.","nullable":true,"type":"string"},"company":{"nullable":true,"type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Tag definition id."},"name":{"description":"Ignored on write. GET fills this from the brand's tag list.","type":"string"}},"required":["id"]}]}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"}}},{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"description":"Job title.","nullable":true,"type":"string"},"company":{"nullable":true,"type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Tag definition id."},"name":{"description":"Ignored on write. GET fills this from the brand's tag list.","type":"string"}},"required":["id"]}]}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"}}}}]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreateResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"summary":"Update customers","description":"Changes up to 500 customers in one call. Each item is `{ id, ...fields }`. `id` is from GET /customers. Send only the fields to change. `tags`, when sent, replaces that customer's tags. The response is `{ data: [person, ...] }` in the same order as the request, the same person objects GET lists, with `page.total`. One customer can also be changed with PATCH /customers/{id}.","tags":["Customers"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"description":"Job title.","nullable":true,"type":"string"},"company":{"nullable":true,"type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Tag definition id."},"name":{"description":"Ignored on write. GET fills this from the brand's tag list.","type":"string"}},"required":["id"]}]}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Customer id from GET /customers."}},"required":["id"]}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/customers/{id}":{"patch":{"summary":"Update a customer","description":"Changes one customer from GET /customers. Send only the fields to change. The field names are the same as a directory row. `tags`, when sent, replaces that customer's tags (a string id, or `{ id }` from GET). `custom_fields`, when sent, replaces the bag. `name`, `lifetime_value`, `created_at`, and `updated_at` are ignored. The response is that person.","tags":["Customers"],"parameters":[{"name":"id","in":"path","required":true,"description":"Customer id from GET /customers.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"description":"Job title.","nullable":true,"type":"string"},"company":{"nullable":true,"type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"anyOf":[{"type":"string","minLength":1},{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"Tag definition id."},"name":{"description":"Ignored on write. GET fills this from the brand's tag list.","type":"string"}},"required":["id"]}]}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/media":{"get":{"summary":"List library media","description":"Files in the brand's Cherrie library, newest first. Each file is listed once. `accounts` is the connected ad accounts. The id field is the one that platform accepts, null until the background copy or the first launch stores it: Meta `image_hash` or `video_id`, TikTok `image_id` or `video_id`, Google `asset_id`, X `media_key`. The file's `type` picks which field is present. Omit `platform` for every connected account; set it to one or more (`platform=meta,tiktok`) to keep only those accounts. `account_id` keeps one ad account. `limit` is the number of files. `id` is the library id (`creative.media_id` on POST /ads). `url` and `source_url` are also accepted as creative URLs.","tags":["Other"],"parameters":[{"name":"platform","in":"query","required":false,"description":"One or more platforms. Repeat the parameter or comma-separate the values.","schema":{"anyOf":[{"type":"array","items":{"type":"string","enum":["meta","google","tiktok"]}},{"type":"string"}]},"style":"form","explode":false},{"name":"account_id","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["image","video"]}},{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":500}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMediaResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"summary":"Add library media","description":"Copies an image or video from a public https `source_url` into the brand library, the same place a dashboard upload goes. `data` is a list of the stored files, returned without waiting on the ad platforms. Then copies each file onto each connected ad account and stores the platform id, which GET /media returns on that account as `image_hash`, `video_id`, `image_id`, `asset_id`, or `media_key`. Sending the same `source_url` again returns the existing files and fills any missing platform ids. A TikTok, Instagram, or Facebook post link is downloaded from the post: a video or photo post becomes one file; a carousel becomes one file per slide, in order. Every slide is stored or none is. A private, deleted, or unsupported post link is a `validation_error`.","tags":["Other"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source_url":{"type":"string","format":"uri"},"name":{"type":"string","minLength":1,"maxLength":100}},"required":["source_url"]}}}},"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryMediaResponse"}}}},"400":{"description":"Query or body failed validation. Codes: validation_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key / session. Codes: unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Caller is not a member of the brand. Codes: forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Entity or ad account not found. Codes: not_found, not_connected.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Too many requests. Codes: rate_limited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Unexpected server failure. Codes: internal_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"501":{"description":"The platform does not support this operation yet. Codes: unsupported_operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The ad platform returned an error. Codes: platform_error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Per-brand secret key issued from the Connectors page (`cherrie_sk_…`)."}},"schemas":{"ListAccountsResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"name":{"nullable":true,"type":"string"},"currency":{"nullable":true,"type":"string"},"timezone":{"nullable":true,"type":"string"},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"lifetime_spend":{"nullable":true,"type":"number"}},"required":["id","platform","name","currency","timezone"],"additionalProperties":false}}},"store_connected":{"type":"boolean"},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","store_connected","page"],"additionalProperties":false},"ListCampaignsResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"objective":{"type":"string"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal","maximize_clicks","maximize_conversions","maximize_conversion_value","manual_cpc"]},"bid_amount":{"type":"number"},"roas_goal":{"type":"number"},"created_at":{"type":"string"},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location_type":{"type":"string","enum":["country","region","city","zip","geo_market"]},"country_code":{"type":"string"},"country_name":{"type":"string"},"region":{"type":"string"},"exclude":{"type":"boolean"}},"required":["id","name"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","name","status"],"additionalProperties":false}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ManualCampaignResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"objective":{"type":"string"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal","maximize_clicks","maximize_conversions","maximize_conversion_value","manual_cpc"]},"bid_amount":{"type":"number"},"roas_goal":{"type":"number"},"created_at":{"type":"string"},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location_type":{"type":"string","enum":["country","region","city","zip","geo_market"]},"country_code":{"type":"string"},"country_name":{"type":"string"},"region":{"type":"string"},"exclude":{"type":"boolean"}},"required":["id","name"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","name","status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"CampaignOptionsResponse":{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]},"fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["choice","amount","text"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"object","properties":{"value":{"anyOf":[{"type":"string"},{"type":"number"}]},"label":{"type":"string"},"description":{"type":"string"}},"required":["value","label"],"additionalProperties":false}},"recommended":{"anyOf":[{"type":"string"},{"type":"number"}]},"when":{"type":"object","properties":{"field":{"type":"string"},"in":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}},"required":["field","in"],"additionalProperties":false},"locked_after_create":{"type":"boolean"},"description":{"type":"string"}},"required":["key","label","kind","required","options"],"additionalProperties":false}}},"required":["platform","fields"],"additionalProperties":false},"ListAutopilotCampaignsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"daily_budget":{"type":"number"},"currency":{"nullable":true,"type":"string"},"platforms":{"type":"array","items":{"type":"string","enum":["meta","tiktok","google"]}},"goal":{"type":"object","properties":{"type":{"type":"string","enum":["auto","cpa","roas","mer"]},"value":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["type","value"],"additionalProperties":false},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform_campaigns":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"budget_split":{"anyOf":[{"type":"string","enum":["auto"]},{"type":"object","properties":{"min_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"max_amount":{"type":"number","minimum":0,"exclusiveMinimum":true}},"additionalProperties":false}]},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"budget":{"nullable":true,"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string","enum":["daily","lifetime"]}},"required":["amount","type"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","ad_group_id","budget_split"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["id","name","status","daily_budget","currency","platforms","goal","archived_at","created_at","updated_at","platform_campaigns"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"AutopilotCampaignResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused"]},"daily_budget":{"type":"number"},"currency":{"nullable":true,"type":"string"},"platforms":{"type":"array","items":{"type":"string","enum":["meta","tiktok","google"]}},"goal":{"type":"object","properties":{"type":{"type":"string","enum":["auto","cpa","roas","mer"]},"value":{"nullable":true,"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["type","value"],"additionalProperties":false},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform_campaigns":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"budget_split":{"anyOf":[{"type":"string","enum":["auto"]},{"type":"object","properties":{"min_amount":{"type":"number","minimum":0,"exclusiveMinimum":true},"max_amount":{"type":"number","minimum":0,"exclusiveMinimum":true}},"additionalProperties":false}]},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"budget":{"nullable":true,"type":"object","properties":{"amount":{"type":"number"},"type":{"type":"string","enum":["daily","lifetime"]}},"required":["amount","type"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","ad_group_id","budget_split"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["id","name","status","daily_budget","currency","platforms","goal","archived_at","created_at","updated_at","platform_campaigns"],"additionalProperties":false},"page":{"type":"object","properties":{"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}}},"required":["platform_errors"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"ListAdGroupsResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"ad_group_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"type":"string"},"smart_plus":{"type":"boolean"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal"]},"bid_amount":{"type":"string"},"roas_goal":{"type":"number"},"cpc_bid":{"type":"number"},"ad_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"start_time":{"nullable":true,"type":"string"},"end_time":{"nullable":true,"type":"string"},"campaign_daily_budget":{"type":"number","minimum":0},"min_spend":{"nullable":true,"type":"number","minimum":0},"min_spend_percent":{"nullable":true,"type":"number","minimum":0,"maximum":100},"max_spend":{"nullable":true,"type":"number","minimum":0},"max_spend_percent":{"nullable":true,"type":"number","minimum":0,"maximum":100},"customer_type":{"type":"object","properties":{"type":{"type":"string","enum":["all","new","new_and_engaged"]},"existing_customer_ids":{"type":"array","items":{"type":"string","minLength":1}},"engaged_audience_ids":{"type":"array","items":{"type":"string","minLength":1}}},"required":["type"],"additionalProperties":false},"targeting_summary":{"type":"object","properties":{"included_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"advantage_audience":{"nullable":true,"type":"boolean"}},"required":["included_custom_audiences","excluded_custom_audiences"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"optimization_goal":{"nullable":true,"type":"string"},"billing_event":{"nullable":true,"type":"string"},"attribution_spec":{},"is_incremental_attribution_enabled":{"nullable":true,"type":"boolean"},"promoted_object":{},"targeting":{"nullable":true,"type":"object","properties":{"age_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"age_range":{"type":"array","items":{"anyOf":[{"type":"number"},{"type":"number"}]},"minItems":2,"maxItems":2},"genders":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"location_types":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"excluded_geo_locations":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"string"}},"cities":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"regions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"geo_markets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key"],"additionalProperties":{}}},"zips":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"}},"required":["key"],"additionalProperties":{}}}},"additionalProperties":{}},"locales":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"flexible_spec":{"type":"array","items":{"type":"object","properties":{"interests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"behaviors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"additionalProperties":{}}},"custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"targeting_automation":{"type":"object","properties":{"advantage_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"individual_setting":{"type":"object","properties":{"age":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"gender":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}}},"additionalProperties":{}},"targeting_relaxation_types":{"type":"object","properties":{"custom_audience":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]},"lookalike":{"anyOf":[{"type":"number","enum":[0]},{"type":"number","enum":[1]}]}},"additionalProperties":{}},"publisher_platforms":{"type":"array","items":{"type":"string"}},"device_platforms":{"type":"array","items":{"type":"string"}},"facebook_positions":{"type":"array","items":{"type":"string"}},"instagram_positions":{"type":"array","items":{"type":"string"}},"messenger_positions":{"type":"array","items":{"type":"string"}},"audience_network_positions":{"type":"array","items":{"type":"string"}},"brand_safety_content_filter_levels":{"type":"array","items":{"type":"string"}}},"additionalProperties":{}},"keywords":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"match_type":{"type":"string","enum":["broad","phrase","exact"]}},"required":["text","match_type"],"additionalProperties":false}}},"required":["platform","account_id","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"AdGroupResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"ad_group_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"type":"string"},"smart_plus":{"type":"boolean"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal"]},"bid_amount":{"type":"string"},"roas_goal":{"type":"number"},"cpc_bid":{"type":"number"},"ad_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"start_time":{"type":"string"},"end_time":{"type":"string"},"campaign_daily_budget":{"type":"number"},"min_spend":{"type":"number"},"min_spend_percent":{"type":"number"},"max_spend":{"type":"number"},"max_spend_percent":{"type":"number"},"customer_type":{"type":"object","properties":{"type":{"type":"string","enum":["all","new","new_and_engaged"]},"existing_customer_ids":{"type":"array","items":{"type":"string","minLength":1}},"engaged_audience_ids":{"type":"array","items":{"type":"string","minLength":1}}},"required":["type"],"additionalProperties":false},"targeting_summary":{"type":"object","properties":{"included_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"advantage_audience":{"nullable":true,"type":"boolean"}},"required":["included_custom_audiences","excluded_custom_audiences"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"ListAdsResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"cherrie_campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"ad_group_name":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["single_image","single_video","multi_image","multi_video","carousel","dynamic","dynamic_carousel"]},"landing_url":{"nullable":true,"type":"string"},"headline":{"nullable":true,"type":"string"},"body":{"nullable":true,"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"bodies":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"call_to_action":{"type":"string"},"call_to_action_id":{"type":"string"},"url_params":{"type":"string"},"path1":{"type":"string"},"path2":{"type":"string"},"page_id":{"type":"string"},"instagram_id":{"type":"string"},"product_set_id":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video"]},"headline":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"landing_url":{"nullable":true,"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"}},"required":["type","headline","description","landing_url","thumbnail_url"],"additionalProperties":false}},"post_urls":{"type":"object","properties":{"facebook":{"type":"string"},"instagram":{"type":"string"},"shareable":{"type":"string"}},"additionalProperties":false},"id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","carousel","catalog","text","unknown"]},"placement_previews":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"}},"required":["format","label","url"],"additionalProperties":false}},"square":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"story":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"wide":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]}},"required":["landing_url"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"creative_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creatives":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tiktok_item_id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","unknown"]},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["thumbnail_url","preview_url","media_type"],"additionalProperties":false}},"campaign_type":{"type":"string"},"targeting":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["keyword"]},"text":{"type":"string"},"match_type":{"type":"string","enum":["exact","phrase","broad"]}},"required":["type","text","match_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["product_group"]},"label":{"type":"string"},"item_id":{"nullable":true,"type":"string"}},"required":["type","label","item_id"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"start_time":{"nullable":true,"type":"string"},"end_time":{"nullable":true,"type":"string"}},"required":["start_time","end_time"],"additionalProperties":false}},"required":["id","account_id","platform","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"AdTemplateResponse":{"type":"object","properties":{"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["meta"]},"fb_page_id":{"type":"string"},"ig_id":{"type":"string"},"description":{"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"primary_text":{"type":"array","items":{"type":"string"}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","fb_page_id","ig_id","description","headlines","primary_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["google"]},"headlines":{"type":"array","items":{"type":"string"}},"long_headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"business_name":{"nullable":true,"type":"string"},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}},"required":["text","url"],"additionalProperties":false}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","headlines","long_headlines","descriptions","business_name","sitelinks"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["tiktok"]},"primary_text":{"type":"array","items":{"type":"string"}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","primary_text"],"additionalProperties":false}]}},"required":["data"],"additionalProperties":false},"ListAdTemplatesResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["meta"]},"fb_page_id":{"type":"string"},"ig_id":{"type":"string"},"description":{"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"primary_text":{"type":"array","items":{"type":"string"}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","fb_page_id","ig_id","description","headlines","primary_text"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["google"]},"headlines":{"type":"array","items":{"type":"string"}},"long_headlines":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"business_name":{"nullable":true,"type":"string"},"sitelinks":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}},"required":["text","url"],"additionalProperties":false}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","headlines","long_headlines","descriptions","business_name","sitelinks"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brand_id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"url_params":{"nullable":true,"type":"string"},"is_default":{"type":"boolean"},"archived_at":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"platform":{"type":"string","enum":["tiktok"]},"primary_text":{"type":"array","items":{"type":"string"}}},"required":["id","brand_id","name","url","url_params","is_default","archived_at","created_at","updated_at","platform","primary_text"],"additionalProperties":false}]}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"AdResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"cherrie_campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"ad_group_name":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["single_image","single_video","multi_image","multi_video","carousel","dynamic","dynamic_carousel"]},"landing_url":{"nullable":true,"type":"string"},"headline":{"nullable":true,"type":"string"},"body":{"nullable":true,"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"bodies":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"call_to_action":{"type":"string"},"call_to_action_id":{"type":"string"},"url_params":{"type":"string"},"path1":{"type":"string"},"path2":{"type":"string"},"page_id":{"type":"string"},"instagram_id":{"type":"string"},"product_set_id":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video"]},"headline":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"landing_url":{"nullable":true,"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"}},"required":["type","headline","description","landing_url","thumbnail_url"],"additionalProperties":false}},"post_urls":{"type":"object","properties":{"facebook":{"type":"string"},"instagram":{"type":"string"},"shareable":{"type":"string"}},"additionalProperties":false},"id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","carousel","catalog","text","unknown"]},"placement_previews":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"}},"required":["format","label","url"],"additionalProperties":false}},"square":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"story":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"wide":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]}},"required":["landing_url"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"creative_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creatives":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tiktok_item_id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","unknown"]},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["thumbnail_url","preview_url","media_type"],"additionalProperties":false}},"campaign_type":{"type":"string"},"targeting":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["keyword"]},"text":{"type":"string"},"match_type":{"type":"string","enum":["exact","phrase","broad"]}},"required":["type","text","match_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["product_group"]},"label":{"type":"string"},"item_id":{"nullable":true,"type":"string"}},"required":["type","label","item_id"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"start_time":{"nullable":true,"type":"string"},"end_time":{"nullable":true,"type":"string"}},"required":["start_time","end_time"],"additionalProperties":false}},"required":["id","account_id","platform","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"DuplicateAdResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"cherrie_campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"ad_group_name":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["single_image","single_video","multi_image","multi_video","carousel","dynamic","dynamic_carousel"]},"landing_url":{"nullable":true,"type":"string"},"headline":{"nullable":true,"type":"string"},"body":{"nullable":true,"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"bodies":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"call_to_action":{"type":"string"},"call_to_action_id":{"type":"string"},"url_params":{"type":"string"},"path1":{"type":"string"},"path2":{"type":"string"},"page_id":{"type":"string"},"instagram_id":{"type":"string"},"product_set_id":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video"]},"headline":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"landing_url":{"nullable":true,"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"}},"required":["type","headline","description","landing_url","thumbnail_url"],"additionalProperties":false}},"post_urls":{"type":"object","properties":{"facebook":{"type":"string"},"instagram":{"type":"string"},"shareable":{"type":"string"}},"additionalProperties":false},"id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","carousel","catalog","text","unknown"]},"placement_previews":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"}},"required":["format","label","url"],"additionalProperties":false}},"square":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"story":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"wide":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]}},"required":["landing_url"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"creative_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creatives":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tiktok_item_id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","unknown"]},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["thumbnail_url","preview_url","media_type"],"additionalProperties":false}},"campaign_type":{"type":"string"},"targeting":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["keyword"]},"text":{"type":"string"},"match_type":{"type":"string","enum":["exact","phrase","broad"]}},"required":["type","text","match_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["product_group"]},"label":{"type":"string"},"item_id":{"nullable":true,"type":"string"}},"required":["type","label","item_id"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"start_time":{"nullable":true,"type":"string"},"end_time":{"nullable":true,"type":"string"}},"required":["start_time","end_time"],"additionalProperties":false}},"required":["id","account_id","platform","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false},"fallback":{"type":"string","enum":["copies"]}},"required":["data"],"additionalProperties":false},"SearchResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"objective":{"type":"string"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal","maximize_clicks","maximize_conversions","maximize_conversion_value","manual_cpc"]},"bid_amount":{"type":"number"},"roas_goal":{"type":"number"},"created_at":{"type":"string"},"locations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"location_type":{"type":"string","enum":["country","region","city","zip","geo_market"]},"country_code":{"type":"string"},"country_name":{"type":"string"},"region":{"type":"string"},"exclude":{"type":"boolean"}},"required":["id","name"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","name","status"],"additionalProperties":false}},"ad_groups":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"ad_group_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"type":"string"},"smart_plus":{"type":"boolean"},"daily_budget":{"type":"number"},"lifetime_budget":{"type":"number"},"bid_strategy":{"type":"string","enum":["auto","cost_cap","bid_cap","roas_goal"]},"bid_amount":{"type":"string"},"roas_goal":{"type":"number"},"cpc_bid":{"type":"number"},"ad_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"created_at":{"type":"string"},"start_time":{"type":"string"},"end_time":{"type":"string"},"campaign_daily_budget":{"type":"number"},"min_spend":{"type":"number"},"min_spend_percent":{"type":"number"},"max_spend":{"type":"number"},"max_spend_percent":{"type":"number"},"customer_type":{"type":"object","properties":{"type":{"type":"string","enum":["all","new","new_and_engaged"]},"existing_customer_ids":{"type":"array","items":{"type":"string","minLength":1}},"engaged_audience_ids":{"type":"array","items":{"type":"string","minLength":1}}},"required":["type"],"additionalProperties":false},"targeting_summary":{"type":"object","properties":{"included_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"excluded_custom_audiences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id"],"additionalProperties":false}},"advantage_audience":{"nullable":true,"type":"boolean"}},"required":["included_custom_audiences","excluded_custom_audiences"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["platform","account_id","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}},"ads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"campaign_id":{"type":"string"},"campaign_name":{"type":"string"},"cherrie_campaign_id":{"type":"string"},"ad_group_id":{"nullable":true,"type":"string"},"ad_group_name":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","deleted","archived","pending","unknown"]},"effective_status":{"nullable":true,"type":"string"},"created_at":{"type":"string"},"creative":{"type":"object","properties":{"type":{"type":"string","enum":["single_image","single_video","multi_image","multi_video","carousel","dynamic","dynamic_carousel"]},"landing_url":{"nullable":true,"type":"string"},"headline":{"nullable":true,"type":"string"},"body":{"nullable":true,"type":"string"},"headlines":{"type":"array","items":{"type":"string"}},"bodies":{"type":"array","items":{"type":"string"}},"descriptions":{"type":"array","items":{"type":"string"}},"call_to_action":{"type":"string"},"call_to_action_id":{"type":"string"},"url_params":{"type":"string"},"path1":{"type":"string"},"path2":{"type":"string"},"page_id":{"type":"string"},"instagram_id":{"type":"string"},"product_set_id":{"type":"string"},"cards":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["image","video"]},"headline":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"landing_url":{"nullable":true,"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"}},"required":["type","headline","description","landing_url","thumbnail_url"],"additionalProperties":false}},"post_urls":{"type":"object","properties":{"facebook":{"type":"string"},"instagram":{"type":"string"},"shareable":{"type":"string"}},"additionalProperties":false},"id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","carousel","catalog","text","unknown"]},"placement_previews":{"type":"array","items":{"type":"object","properties":{"format":{"type":"string"},"label":{"type":"string"},"url":{"type":"string"}},"required":["format","label","url"],"additionalProperties":false}},"square":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"story":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]},"wide":{"anyOf":[{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false},{"type":"object","properties":{"hash":{"type":"string"}},"required":["hash"],"additionalProperties":false},{"type":"object","properties":{"video_id":{"type":"string"},"thumbnail_url":{"type":"string"}},"required":["video_id"],"additionalProperties":false}]}},"required":["landing_url"],"additionalProperties":false},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false},"creative_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creatives":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tiktok_item_id":{"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"media_type":{"type":"string","enum":["image","video","unknown"]},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["spend","impressions","reach","clicks","results","date"],"additionalProperties":false}}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["thumbnail_url","preview_url","media_type"],"additionalProperties":false}},"campaign_type":{"type":"string"},"targeting":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["keyword"]},"text":{"type":"string"},"match_type":{"type":"string","enum":["exact","phrase","broad"]}},"required":["type","text","match_type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["product_group"]},"label":{"type":"string"},"item_id":{"nullable":true,"type":"string"}},"required":["type","label","item_id"],"additionalProperties":false}]},"schedule":{"type":"object","properties":{"start_time":{"nullable":true,"type":"string"},"end_time":{"nullable":true,"type":"string"}},"required":["start_time","end_time"],"additionalProperties":false}},"required":["id","account_id","platform","campaign_id","ad_group_id","name","status","effective_status"],"additionalProperties":false}}},"required":["campaigns","ad_groups","ads"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"level":{"type":"string","enum":["campaign","ad_group","ad"]},"matched_count":{"type":"integer","minimum":0,"maximum":9007199254740991},"match":{"type":"string","enum":["or","and"]}},"required":["platform_errors","next_cursor","level","matched_count","match"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"SummaryResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"store_connected":{"type":"boolean"},"store":{"nullable":true,"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"totals":{"type":"object","properties":{"total_sales":{"type":"number"},"gross_sales":{"type":"number"},"net_sales":{"type":"number"},"orders":{"type":"number"},"average_order_value":{"nullable":true,"type":"number"},"sales_breakdown":{"type":"object","properties":{"discounts":{"type":"number"},"returns":{"type":"number"},"shipping_charges":{"type":"number"},"duties":{"type":"number"},"additional_fees":{"type":"number"},"taxes":{"type":"number"}},"required":["discounts","returns","shipping_charges","duties","additional_fees","taxes"],"additionalProperties":false}},"required":["total_sales","gross_sales","net_sales","orders","average_order_value","sales_breakdown"],"additionalProperties":false},"trend":{"type":"object","properties":{"total_sales":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false},"orders":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false},"average_order_value":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false}},"required":["total_sales","orders","average_order_value"],"additionalProperties":false},"best_day":{"nullable":true,"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false},"worst_day":{"nullable":true,"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","properties":{"total_sales":{"type":"number"},"gross_sales":{"type":"number"},"net_sales":{"type":"number"},"orders":{"type":"number"},"average_order_value":{"nullable":true,"type":"number"},"sales_breakdown":{"type":"object","properties":{"discounts":{"type":"number"},"returns":{"type":"number"},"shipping_charges":{"type":"number"},"duties":{"type":"number"},"additional_fees":{"type":"number"},"taxes":{"type":"number"}},"required":["discounts","returns","shipping_charges","duties","additional_fees","taxes"],"additionalProperties":false},"date":{"type":"string"}},"required":["total_sales","gross_sales","net_sales","orders","average_order_value","sales_breakdown","date"],"additionalProperties":false}}},"required":["currency","totals","trend","best_day","worst_day","daily"],"additionalProperties":false},"channels":{"type":"object","properties":{"totals":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"ctr":{"nullable":true,"type":"number"},"cpc":{"nullable":true,"type":"number"},"cpm":{"nullable":true,"type":"number"},"conversions":{"type":"number"},"conversion_value":{"type":"number"},"roas":{"nullable":true,"type":"number"},"cost_per_conversion":{"nullable":true,"type":"number"}},"required":["spend","impressions","clicks","ctr","cpc","cpm","conversions","conversion_value","roas","cost_per_conversion"],"additionalProperties":false},"platforms":{"type":"object","additionalProperties":{"type":"object","properties":{"spend":{"type":"number"},"impressions":{"type":"number"},"clicks":{"type":"number"},"ctr":{"nullable":true,"type":"number"},"cpc":{"nullable":true,"type":"number"},"cpm":{"nullable":true,"type":"number"},"conversions":{"type":"number"},"conversion_value":{"type":"number"},"roas":{"nullable":true,"type":"number"},"cost_per_conversion":{"nullable":true,"type":"number"},"currency":{"nullable":true,"type":"string"},"spend_share_percent":{"nullable":true,"type":"number"},"trend":{"type":"object","properties":{"spend":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false},"conversions":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false},"roas":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false}},"required":["spend","conversions","roas"],"additionalProperties":false},"store_sales_correlation":{"nullable":true,"type":"number"},"claimed_revenue_percent":{"nullable":true,"type":"number"}},"required":["spend","impressions","clicks","ctr","cpc","cpm","conversions","conversion_value","roas","cost_per_conversion","currency","spend_share_percent","trend"],"additionalProperties":false}},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"total":{"type":"number"},"clicks":{"type":"number"},"cpc":{"nullable":true,"type":"number"},"meta":{"type":"number"},"google":{"type":"number"},"tiktok":{"type":"number"}},"required":["date","total","clicks","cpc","meta","google","tiktok","x","openai"],"additionalProperties":false}}},"required":["totals","platforms","daily"],"additionalProperties":false},"blended":{"type":"object","properties":{"mer":{"nullable":true,"type":"number"},"net_sales_mer":{"nullable":true,"type":"number"},"trend":{"type":"object","properties":{"mer":{"type":"object","properties":{"first_half":{"nullable":true,"type":"number"},"second_half":{"nullable":true,"type":"number"},"change_percent":{"nullable":true,"type":"number"}},"required":["first_half","second_half","change_percent"],"additionalProperties":false}},"required":["mer"],"additionalProperties":false},"best_mer_day":{"nullable":true,"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false},"worst_mer_day":{"nullable":true,"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number"}},"required":["date","value"],"additionalProperties":false},"spend_sales_correlation":{"nullable":true,"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"mer":{"nullable":true,"type":"number"}},"required":["date","mer"],"additionalProperties":false}}},"required":["mer","net_sales_mer","trend","best_mer_day","worst_mer_day","spend_sales_correlation","daily"],"additionalProperties":false},"weekday_vs_weekend":{"type":"object","properties":{"weekday":{"type":"object","additionalProperties":{"nullable":true,"type":"number"}},"weekend":{"type":"object","additionalProperties":{"nullable":true,"type":"number"}}},"required":["weekday","weekend"],"additionalProperties":false},"weeks":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"spend":{"type":"number"},"total_sales":{"type":"number"},"orders":{"type":"number"},"mer":{"nullable":true,"type":"number"}},"required":["from","to"],"additionalProperties":false}}},"required":["weekday_vs_weekend","weeks"],"additionalProperties":false},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ShopifyResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"store_connected":{"type":"boolean"},"name":{"nullable":true,"type":"string"},"currency":{"nullable":true,"type":"string"},"by":{"type":"string","enum":["store","product","product_type"]},"store":{"nullable":true,"type":"object","properties":{"total_sales":{"type":"number"},"gross_sales":{"type":"number"},"net_sales":{"type":"number"},"orders":{"type":"number"},"average_order_value":{"nullable":true,"type":"number"},"sales_breakdown":{"type":"object","properties":{"discounts":{"type":"number"},"returns":{"type":"number"},"shipping_charges":{"type":"number"},"duties":{"type":"number"},"additional_fees":{"type":"number"},"taxes":{"type":"number"}},"required":["discounts","returns","shipping_charges","duties","additional_fees","taxes"],"additionalProperties":false}},"required":["total_sales","gross_sales","net_sales","orders","average_order_value","sales_breakdown"],"additionalProperties":false},"products":{"type":"array","items":{"type":"object","properties":{"net_sales":{"type":"number"},"gross_sales":{"type":"number"},"total_sales":{"type":"number"},"orders":{"type":"number"},"net_items_sold":{"type":"number"},"average_order_value":{"nullable":true,"type":"number"},"product_id":{"nullable":true,"type":"string"},"title":{"nullable":true,"type":"string"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"net_sales":{"type":"number"},"gross_sales":{"type":"number"},"total_sales":{"type":"number"},"orders":{"type":"number"},"net_items_sold":{"type":"number"}},"required":["date","net_sales","gross_sales","total_sales","orders","net_items_sold"],"additionalProperties":false}}},"required":["net_sales","gross_sales","total_sales","orders","net_items_sold","average_order_value","product_id","title"],"additionalProperties":false}},"product_types":{"type":"array","items":{"type":"object","properties":{"net_sales":{"type":"number"},"gross_sales":{"type":"number"},"total_sales":{"type":"number"},"orders":{"type":"number"},"net_items_sold":{"type":"number"},"average_order_value":{"nullable":true,"type":"number"},"product_type":{"nullable":true,"type":"string"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"net_sales":{"type":"number"},"gross_sales":{"type":"number"},"total_sales":{"type":"number"},"orders":{"type":"number"},"net_items_sold":{"type":"number"}},"required":["date","net_sales","gross_sales","total_sales","orders","net_items_sold"],"additionalProperties":false}}},"required":["net_sales","gross_sales","total_sales","orders","net_items_sold","average_order_value","product_type"],"additionalProperties":false}}},"required":["store_connected","name","currency","by"],"additionalProperties":false},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListAudiencesResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"string"}},"required":["id","platform","account_id","name"],"additionalProperties":false}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListPixelsResponse":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"pixel_id":{"type":"string"},"name":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"last_fired_time":{"type":"string"}},"required":["id","name","type"],"additionalProperties":false}}},"required":["platform","account_id","pixel_id","name","events"],"additionalProperties":false}}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"TargetingSearchResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"audience_size_lower_bound":{"type":"number"},"audience_size_upper_bound":{"type":"number"},"path":{"type":"array","items":{"type":"string"}},"location_type":{"type":"string","enum":["country","region","city","zip","geo_market"]},"country_code":{"type":"string"},"country_name":{"type":"string"},"region":{"type":"string"},"region_id":{"type":"string"}},"required":["id","name"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"ListProductSetsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"product_count":{"type":"number"},"sample_products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image_url":{"type":"string"},"url":{"type":"string"},"price":{"type":"string"},"description":{"type":"string"}},"required":["id"],"additionalProperties":false}}},"required":["id","name","sample_products"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"ListPagesResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"meta":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"type":{"type":"string"},"display_name":{"nullable":true,"type":"string"},"avatar_url":{"nullable":true,"type":"string"},"followers":{"nullable":true,"type":"number"}},"required":["id","platform","type","display_name","avatar_url"],"additionalProperties":false}},"tiktok":{"type":"object","properties":{"owned":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"type":{"type":"string"},"display_name":{"nullable":true,"type":"string"},"avatar_url":{"nullable":true,"type":"string"},"followers":{"nullable":true,"type":"number"}},"required":["id","platform","type","display_name","avatar_url"],"additionalProperties":false}},"creators":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"type":{"type":"string"},"display_name":{"nullable":true,"type":"string"},"avatar_url":{"nullable":true,"type":"string"},"followers":{"nullable":true,"type":"number"}},"required":["id","platform","type","display_name","avatar_url"],"additionalProperties":false}}},"required":["owned","creators"],"additionalProperties":false},"x":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"type":{"type":"string"},"display_name":{"nullable":true,"type":"string"},"avatar_url":{"nullable":true,"type":"string"},"followers":{"nullable":true,"type":"number"}},"required":["id","platform","type","display_name","avatar_url"],"additionalProperties":false}}},"additionalProperties":false},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListPostsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"identity_id":{"type":"string"},"type":{"type":"string","enum":["video","carousel"]},"caption":{"nullable":true,"type":"string"},"thumbnail_url":{"nullable":true,"type":"string"},"preview_url":{"nullable":true,"type":"string"},"duration_seconds":{"nullable":true,"type":"number"},"created_at":{"nullable":true,"type":"string"}},"required":["id","platform","account_id","identity_id","type","caption","thumbnail_url","preview_url","duration_seconds","created_at"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false},"searched":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListProductsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"type":"string"},"merchant_id":{"nullable":true,"type":"string"},"campaign_id":{"nullable":true,"type":"string"},"title":{"nullable":true,"type":"string"},"brand":{"nullable":true,"type":"string"},"image_url":{"nullable":true,"type":"string"},"price":{"nullable":true,"type":"object","properties":{"amount":{"type":"number"},"currency":{"nullable":true,"type":"string"}},"required":["amount","currency"],"additionalProperties":false},"availability":{"type":"string","enum":["in_stock","out_of_stock","preorder","unknown"]},"status":{"type":"string","enum":["eligible","eligible_limited","not_eligible","unknown"]},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["error","warning","unknown"]},"description":{"nullable":true,"type":"string"},"attribute":{"nullable":true,"type":"string"}},"required":["severity","description","attribute"],"additionalProperties":false}},"metrics":{"type":"object","properties":{"currency":{"nullable":true,"type":"string"},"spend":{"type":"number"},"impressions":{"type":"number"},"reach":{"nullable":true,"type":"number"},"clicks":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"value":{"type":"number"},"attribution":{"type":"object","properties":{"1d_click":{"type":"number"},"7d_click":{"type":"number"},"1d_view":{"type":"number"},"incrementality":{"type":"number"}},"additionalProperties":false}},"required":["type","count"],"additionalProperties":false}},"conversion_count":{"type":"number"},"video_plays":{"type":"number"},"thruplays":{"type":"number"}},"required":["currency","spend","impressions","reach","clicks","results"],"additionalProperties":false}},"required":["item_id","platform","account_id","merchant_id","campaign_id","title","brand","image_url","price","availability","status","issues"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ProductEditResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"item_id":{"type":"string"},"feed_label":{"type":"string"},"content_language":{"type":"string"},"status":{"type":"string","enum":["accepted"]},"fields":{"type":"array","items":{"type":"string","enum":["title","description","image_url","additional_image_urls"]}}},"required":["item_id","feed_label","content_language","status","fields"],"additionalProperties":false},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"ProductRevertResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"item_id":{"type":"string"},"feed_label":{"type":"string"},"content_language":{"type":"string"},"reverted":{"type":"boolean"}},"required":["item_id","feed_label","content_language","reverted"],"additionalProperties":false},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"ListMerchantProductsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string"},"feed_label":{"type":"string"},"content_language":{"type":"string"},"title":{"nullable":true,"type":"string"},"description":{"nullable":true,"type":"string"},"image_url":{"nullable":true,"type":"string"},"additional_image_urls":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["approved","limited","disapproved","pending","unknown"]},"issues":{"type":"array","items":{"type":"object","properties":{"severity":{"type":"string","enum":["error","warning","info"]},"description":{"nullable":true,"type":"string"},"attribute":{"nullable":true,"type":"string"}},"required":["severity","description","attribute"],"additionalProperties":false}}},"required":["item_id","feed_label","content_language","title","description","image_url","additional_image_urls","status","issues"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListMerchantIssuesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"severity":{"type":"string","enum":["critical","error","suggestion","unknown"]},"detail":{"nullable":true,"type":"string"},"documentation_url":{"nullable":true,"type":"string"}},"required":["title","severity","detail","documentation_url"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"CustomersResponse":{"anyOf":[{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overview":{"type":"object","properties":{"first_seen_at":{"nullable":true,"type":"string"},"session_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activity_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"website_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"messages_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"memories_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day_counts":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["day","count"],"additionalProperties":false}}},"required":["first_seen_at","session_count","activity_count","website_count","messages_count","memories_count","day_counts"],"additionalProperties":false},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_name":{"type":"string"},"label":{"type":"string"},"summary":{"type":"string"},"pathname":{"nullable":true,"type":"string"},"session_id":{"nullable":true,"type":"string"},"value":{"nullable":true,"type":"number"},"currency":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"occurred_at":{"type":"string"}},"required":["id","event_name","label","summary","pathname","session_id","value","currency","country","occurred_at"],"additionalProperties":false}},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string","enum":["email","imessage","social"]},"direction":{"type":"string","enum":["inbound","outbound"]},"body":{"type":"string"},"subject":{"nullable":true,"type":"string"},"occurred_at":{"type":"string"}},"required":["id","channel","direction","body","subject","occurred_at"],"additionalProperties":false}},"memories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"occurred_at":{"type":"string"}},"required":["id","body","occurred_at"],"additionalProperties":false}}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at","overview","events","messages","memories"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["platform_errors","next_cursor","total"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},{"type":"object","properties":{"group_by":{"type":"string","enum":["city","state","postal_code","country","company"]},"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value","count"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"customers":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["platform_errors","next_cursor","total","customers","blank"],"additionalProperties":false}},"required":["group_by","data","page"],"additionalProperties":false},{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["platform_errors","next_cursor","total"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false}]},"CustomerResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},"CustomerCreateResponse":{"anyOf":[{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at"],"additionalProperties":false}},"required":["data"],"additionalProperties":false},{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["platform_errors","next_cursor","total"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false}]},"CustomerListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Customer id."},"name":{"type":"string","description":"The name the Customers table shows."},"first_name":{"nullable":true,"type":"string"},"last_name":{"nullable":true,"type":"string"},"email":{"nullable":true,"type":"string"},"phone":{"nullable":true,"type":"string"},"title":{"nullable":true,"description":"Job title.","type":"string"},"company":{"nullable":true,"description":"Company name.","type":"string"},"company_url":{"nullable":true,"type":"string"},"instagram_username":{"nullable":true,"type":"string"},"linkedin_url":{"nullable":true,"type":"string"},"address_line1":{"nullable":true,"type":"string"},"address_line2":{"nullable":true,"type":"string"},"city":{"nullable":true,"type":"string"},"state":{"nullable":true,"type":"string"},"postal_code":{"nullable":true,"type":"string"},"country":{"nullable":true,"type":"string"},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Tag definition id."},"name":{"type":"string","description":"Tag name shown on the Customers page."}},"required":["id","name"],"additionalProperties":false}},"custom_fields":{"type":"object","additionalProperties":{"type":"string"}},"marketing_opt_in":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","first_name","last_name","email","phone","title","company","company_url","instagram_username","linkedin_url","address_line1","address_line2","city","state","postal_code","country","tags","custom_fields","marketing_opt_in","lifetime_value","created_at","updated_at"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["platform_errors","next_cursor","total"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"ListMediaResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"source_url":{"nullable":true,"type":"string"},"type":{"type":"string","enum":["image","video"]},"file_name":{"type":"string"},"created_at":{"type":"string"},"accounts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]},"account_id":{"type":"string"},"image_hash":{"nullable":true,"type":"string"}},"required":["platform","account_id","image_hash"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["meta"]},"account_id":{"type":"string"},"video_id":{"nullable":true,"type":"string"}},"required":["platform","account_id","video_id"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok"]},"account_id":{"type":"string"},"image_id":{"nullable":true,"type":"string"}},"required":["platform","account_id","image_id"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["tiktok"]},"account_id":{"type":"string"},"video_id":{"nullable":true,"type":"string"}},"required":["platform","account_id","video_id"],"additionalProperties":false},{"type":"object","properties":{"platform":{"type":"string","enum":["google"]},"account_id":{"type":"string"},"asset_id":{"nullable":true,"type":"string"}},"required":["platform","account_id","asset_id"],"additionalProperties":false}]}}},"required":["id","url","source_url","type","file_name","created_at","accounts"],"additionalProperties":false}},"page":{"type":"object","properties":{"duration_ms":{"type":"number"},"meta_duration_ms":{"type":"number"},"google_duration_ms":{"type":"number"},"tiktok_duration_ms":{"type":"number"},"x_duration_ms":{"type":"number"},"openai_duration_ms":{"type":"number"},"date_range":{"type":"object","properties":{"since":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"timezone":{"type":"string"}},"required":["since","until"],"additionalProperties":false},"platform_errors":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string","enum":["meta","google","tiktok"]},"account_id":{"nullable":true,"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"retry_after_seconds":{"type":"number"}},"required":["platform","account_id","code","message"],"additionalProperties":false}},"next_cursor":{"nullable":true,"type":"string"}},"required":["platform_errors","next_cursor"],"additionalProperties":false}},"required":["data","page"],"additionalProperties":false},"LibraryMediaResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"source_url":{"nullable":true,"type":"string"},"type":{"type":"string","enum":["image","video"]},"file_name":{"type":"string"},"created_at":{"type":"string"}},"required":["id","url","source_url","type","file_name","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false},"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","forbidden","validation_error","not_found","not_connected","unsupported_operation","platform_error","rate_limited","internal_error"]},"message":{"type":"string"},"platform":{"type":"string","enum":["meta","google","tiktok"]},"details":{}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false}}}}