{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/metricool/json-schema/metricool-campaign-creation-state-schema.json",
  "title": "CampaignCreationState",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/metricool-ads-previews-api-service-api-openapi.yml#/components/schemas/CampaignCreationState",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "targetUrl": {
      "type": "string"
    },
    "startDate": {
      "$ref": "#/$defs/DateTimeInfo"
    },
    "endDate": {
      "$ref": "#/$defs/DateTimeInfo"
    },
    "currency": {
      "type": "string"
    },
    "budget": {
      "type": "number"
    },
    "budgetType": {
      "type": "string"
    },
    "bidStrategy": {
      "type": "string"
    },
    "targetCPA": {
      "type": "number"
    },
    "maxCPC": {
      "type": "number"
    },
    "providers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AdPlatformInfo"
      }
    },
    "segmentation": {
      "$ref": "#/$defs/Segmentation"
    },
    "ads": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Ad"
      }
    },
    "verifier": {
      "type": "string"
    },
    "txCode": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "googleAdsData": {
      "$ref": "#/$defs/GoogleAdsData"
    }
  },
  "$defs": {
    "Ad": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "businessName": {
          "type": "string"
        },
        "website": {
          "type": "string"
        },
        "titles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "descriptions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "logoUrl": {
          "type": "string"
        },
        "mediaItems": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MediaItem"
          }
        }
      }
    },
    "AdPlatformInfo": {
      "required": [
        "platformId"
      ],
      "type": "object",
      "properties": {
        "platformId": {
          "type": "string"
        },
        "objective": {
          "type": "string"
        },
        "displaySites": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "interests": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dsaPayor": {
          "type": "string"
        },
        "dsaBeneficiary": {
          "type": "string"
        },
        "pixel": {
          "type": "string"
        },
        "customEvent": {
          "type": "string"
        }
      }
    },
    "DateTimeInfo": {
      "required": [
        "dateTime"
      ],
      "type": "object",
      "properties": {
        "dateTime": {
          "type": "string",
          "description": "Local Date-time represented with a certain timezone "
        },
        "timezone": {
          "type": "string",
          "description": "Timezone applied to the datetime"
        }
      }
    },
    "GoogleAdsData": {
      "type": "object",
      "properties": {
        "username": {
          "type": "string"
        },
        "providerUserId": {
          "type": "string"
        },
        "picture": {
          "type": "string"
        }
      }
    },
    "Location": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "MediaItem": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "width": {
          "type": "string"
        },
        "height": {
          "type": "string"
        }
      }
    },
    "Segmentation": {
      "type": "object",
      "properties": {
        "ageRanges": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "gender": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "locations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Location"
          }
        }
      }
    }
  }
}