{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rawa-ai/json-schema/rawa-ai-ad-intelligence-sync-input-api-schema.json",
  "title": "AdIntelligenceSyncInputAPI",
  "description": "Fetch one advertiser's ads.\n\n``advertiser_id`` is the advertiser's id on ``channel`` (the Meta page\nid for ``meta``, the business id for ``tiktok``, the hash of the paying\nadvertiser's name for ``snapchat``, the Ads Transparency Center ``AR`` id\nfor ``google``, the company page id for ``linkedin``); each channel decides\nwhat one looks like. ``advertiser_name`` is the name as the channel spells it: TikTok\nand Snapchat resolve the advertiser by it.\n\nAn ``organic_*`` channel syncs a company's own social account instead: the\nlowercase handle on Instagram and TikTok, the numeric page id on Facebook, the\ncompany slug on LinkedIn, the ``UC`` channel id on YouTube. ``profile_url`` is\nthe page or company link the account was added by (Facebook and LinkedIn are\nlooked up by it); ``fetch_comments`` reads, stores and labels the posts' comments.\nBoth are ignored for an ad channel.\n\n``budget_usd`` is what the account's daily cycle may spend on vendor calls and on the\ncomment summary step's model calls (the platform's share of what the cycle earned),\nand ``spent_vendor_calls`` the calls the cycle's earlier runs made, by vendor: the\nrun that paid for the day and the retries since. The run spends what is left, newest ads first, and stops when it is gone;\nwith nothing left it makes no vendor call and reports ``budget_spent``.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/rawa-ai-api-openapi.json#/components/schemas/AdIntelligenceSyncInputAPI",
  "properties": {
    "channel": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "meta",
            "tiktok",
            "snapchat",
            "google",
            "linkedin"
          ]
        },
        {
          "type": "string",
          "enum": [
            "organic_instagram",
            "organic_tiktok",
            "organic_facebook",
            "organic_linkedin",
            "organic_youtube"
          ]
        }
      ],
      "title": "Channel"
    },
    "advertiser_id": {
      "type": "string",
      "minLength": 1,
      "title": "Advertiser Id"
    },
    "advertiser_name": {
      "type": "string",
      "minLength": 1,
      "title": "Advertiser Name"
    },
    "refresh_profile": {
      "type": "boolean",
      "title": "Refresh Profile",
      "default": false
    },
    "webhook_url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2083,
          "minLength": 1,
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "title": "Webhook Url"
    },
    "profile_url": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2083,
          "minLength": 1,
          "format": "uri"
        },
        {
          "type": "null"
        }
      ],
      "title": "Profile Url"
    },
    "fetch_comments": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fetch Comments"
    },
    "budget_usd": {
      "type": "number",
      "minimum": 0.0,
      "title": "Budget Usd"
    },
    "spent_vendor_calls": {
      "additionalProperties": {
        "type": "integer",
        "minimum": 0.0
      },
      "type": "object",
      "title": "Spent Vendor Calls"
    }
  },
  "type": "object",
  "required": [
    "channel",
    "advertiser_id",
    "advertiser_name",
    "budget_usd"
  ]
}