{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/growomat-com/json-schema/growomat-com-conversion-action-create-schema.json",
  "title": "ConversionActionCreate",
  "description": "What counts as a conversion, and how it is counted and valued.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/growomat-com-api-openapi.json#/components/schemas/ConversionActionCreate",
  "type": "object",
  "required": [
    "name",
    "type",
    "category"
  ],
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Display name, also accepted wherever a conversion action is referenced by name."
    },
    "type": {
      "type": "string",
      "enum": [
        "WEBPAGE",
        "AD_CALL",
        "WEBSITE_CALL",
        "UPLOAD_CLICKS",
        "UPLOAD_CALLS"
      ],
      "description": "Where the conversion is observed. `UPLOAD_CLICKS` and `UPLOAD_CALLS` are the types for conversions you report through this API."
    },
    "category": {
      "type": "string",
      "enum": [
        "PURCHASE",
        "ADD_TO_CART",
        "BEGIN_CHECKOUT",
        "SUBSCRIBE_PAID",
        "SUBMIT_LEAD_FORM",
        "SIGNUP",
        "CONTACT",
        "BOOK_APPOINTMENT",
        "REQUEST_QUOTE",
        "GET_DIRECTIONS",
        "PAGE_VIEW",
        "DOWNLOAD",
        "PHONE_CALL_LEAD",
        "ENGAGEMENT",
        "DEFAULT"
      ],
      "description": "What kind of outcome this is, as the platforms classify it."
    },
    "status": {
      "type": "string",
      "enum": [
        "ENABLED",
        "PAUSED"
      ],
      "default": "ENABLED",
      "description": "A paused action records nothing."
    },
    "countingType": {
      "type": "string",
      "enum": [
        "ONE_PER_CLICK",
        "MANY_PER_CLICK"
      ],
      "default": "ONE_PER_CLICK",
      "description": "`ONE_PER_CLICK` for leads and sign-ups, `MANY_PER_CLICK` for purchases."
    },
    "valueSettings": {
      "$ref": "#/$defs/ConversionActionValueSettings"
    },
    "clickThroughLookbackWindowDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 60,
      "description": "How many days after a click a conversion still counts. Capped at 30 by the platform for all types except calls, where 60 is allowed."
    },
    "viewThroughLookbackWindowDays": {
      "type": "integer",
      "minimum": 1,
      "maximum": 30,
      "description": "How many days after an ad view (without a click) a conversion still counts."
    },
    "attributionModel": {
      "type": "string",
      "enum": [
        "DATA_DRIVEN",
        "LAST_CLICK"
      ],
      "description": "How credit is split across the clicks before a conversion."
    },
    "enhancedConversionsForLeads": {
      "type": "boolean",
      "description": "Enable Enhanced Conversions for Leads, so uploads that carry only a hashed email or phone can still be matched after the click id is gone."
    },
    "leadStage": {
      "type": "string",
      "enum": [
        "signup",
        "trial_started",
        "qualified_lead",
        "paid",
        "expansion"
      ],
      "description": "The funnel stage this action represents. Events reported with this `event` name land here."
    },
    "defaultEventValue": {
      "type": "number",
      "minimum": 0,
      "description": "Value assigned to an event that arrives without one."
    },
    "includeInConversionsMetric": {
      "type": "boolean",
      "description": "Whether the platform counts this action in its headline conversions number and optimises bidding for it."
    }
  },
  "$defs": {
    "ConversionActionValueSettings": {
      "type": "object",
      "description": "How much a conversion of this action is worth.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "noValue",
            "fixedValue",
            "variableValue"
          ],
          "default": "noValue",
          "description": "`noValue`: count only. `fixedValue`: every conversion is worth `defaultValue`. `variableValue`: each upload carries its own value, with `defaultValue` as the fallback."
        },
        "defaultValue": {
          "type": "number",
          "description": "The fixed or fallback value."
        },
        "currencyCode": {
          "type": "string",
          "description": "ISO 4217 currency of `defaultValue`."
        }
      }
    }
  }
}