{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adobe/json-schema/adobe-criteria-profile-attribute-schema.json",
  "title": "CriteriaProfileAttribute",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adobe-target-recommendations-openapi.yml#/components/schemas/CriteriaProfileAttribute",
  "allOf": [
    {
      "$ref": "#/$defs/CriteriaMin"
    },
    {
      "type": "object",
      "properties": {
        "aggregation": {
          "type": "string",
          "enum": [
            "NONE",
            "AGGREGATE",
            "ALL_OR_NOTHING"
          ],
          "default": "NONE",
          "description": "Whether recommendations should be shown solely based on the key (`NONE`) or visitor's behavioral history with\nrespect to the key (`AGGREGATE`, `ALL_OR_NOTHING`).\n  - `NONE` implies no aggregation, to only show recommendations for the given key.\n  - `AGGREGATE` begins with recommendations for the given key, top seller in this instance, then continues to next\n    top seller until the design is filled.\n  - `ALL_OR_NOTHING` is similar to aggregation but the aggregation only happens if the given key, most viewed item\n    in this instance, has enough recommendations to fill the design. If the key does not have enough\n    recommendations, next most viewed item is considered sequentially until the design is filled.\n"
        },
        "backupDisabled": {
          "type": "boolean",
          "default": false,
          "description": "Whether backup recommendations are disabled when criteria does not generate enough recommendations."
        },
        "backupInclusionFilteringEnabled": {
          "type": "boolean",
          "default": true,
          "description": "Whether inclusion rules on the criteria should be applied to backup recommendations."
        },
        "configuration": {
          "$ref": "#/$defs/CriteriaProfileAttributeConfiguration"
        },
        "criteriaGroup": {
          "type": "string",
          "enum": [
            "PROFILEATTRIBUTE"
          ],
          "readOnly": true
        },
        "daysCount": {
          "type": "string",
          "enum": [
            "ONE_DAY",
            "TWO_DAYS",
            "ONE_WEEK",
            "TWO_WEEKS",
            "ONE_MONTH",
            "TWO_MONTHS"
          ],
          "description": "Time range of historical visitor behavioral data to consider for generating recommendations."
        },
        "enableCaching": {
          "type": "boolean",
          "default": false,
          "deprecated": true,
          "readOnly": true
        },
        "excludePurchases": {
          "type": "boolean",
          "default": false,
          "description": "Whether items that were previously purchased by the visitor should be excluded from recommendations."
        },
        "minInventory": {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "description": "Minimum number of pieces needed in stock for an item to be considered for recommendaton."
        },
        "partialDesignAllowed": {
          "type": "boolean",
          "default": false,
          "description": "Whether design be shown when the number of recommendations are less than item slots in the design."
        },
        "superSlotCount": {
          "type": "integer",
          "format": "int32",
          "readOnly": true
        },
        "type": {
          "type": "string",
          "enum": [
            "VIEWED_BOUGHT",
            "BOUGHT_CF",
            "VIEWED_CF",
            "SITE_AFFINITY"
          ],
          "description": "Recommendation logic. Values:\n\n  - `VIEWED_BOUGHT`: People who viewed this, bought that.\n  - `BOUGHT_CF`: People who bought this, bought that.\n  - `VIEWED_CF`: People who viewed this, viewed that.\n  - `SITE_AFFINITY`: Considers items based on the certainty of a relationship between items. Confidence setting is\n    used to determine how much data (strong or weak affinity) is required before a recommendation is presented.\n"
        }
      },
      "required": [
        "configuration",
        "daysCount",
        "type"
      ]
    }
  ],
  "$defs": {
    "AlgorithmRankingRule": {
      "type": "object",
      "properties": {
        "matcher": {
          "$ref": "#/$defs/Matcher"
        },
        "weighting": {
          "type": "integer",
          "format": "int32",
          "minimum": 0,
          "maximum": 4
        }
      }
    },
    "CriteriaConfiguration": {
      "type": "object",
      "properties": {
        "inclusionRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InclusionMatcher"
          },
          "maxItems": 1000,
          "description": "Filtering rules to narrow the items to be displayed as recommendations. Inclusion rules are conjunctive and all rules\nmust be met to include an item in a recommendation. [More info](https://marketing.adobe.com/resources/help/en_US/target/recs/t_create_new_algorithm.html).\n"
        },
        "priceRange": {
          "$ref": "#/$defs/CriteriaPriceRange"
        },
        "rankingRules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AlgorithmRankingRule"
          },
          "maxItems": 1000,
          "description": "Rules for attribute weighting. Attribute weighting can be used to \"nudge\" the algorithm so certain items are more\nlikely to be shown. [More info](https://marketing.adobe.com/resources/help/en_US/target/recs/t_create_new_algorithm.html).\n"
        }
      },
      "description": "Object containing inclusion rules, attribute weighting, price filter, and some more configuration options specific to the criteria group."
    },
    "CriteriaMin": {
      "type": "object",
      "properties": {
        "criteriaGroup": {
          "type": "string",
          "readOnly": true
        },
        "criteriaTitle": {
          "type": "string",
          "maxLength": 250,
          "description": "Displayed in the design using variable `$criteria.title`."
        },
        "id": {
          "type": "integer",
          "format": "int64",
          "readOnly": true
        },
        "name": {
          "type": "string",
          "maxLength": 250,
          "description": "Unique name of the criteria."
        },
        "description": {
          "type": "string",
          "maxLength": 1000
        },
        "lastModifiersName": {
          "type": "string",
          "readOnly": true
        },
        "lastModifiersEmail": {
          "type": "string",
          "readOnly": true
        },
        "lastModified": {
          "type": "string",
          "readOnly": true,
          "format": "date-time",
          "description": "The time in UTC when the criteria was last modified."
        }
      },
      "required": [
        "name"
      ]
    },
    "CriteriaPriceRange": {
      "type": "object",
      "properties": {
        "max": {
          "type": "number",
          "format": "double"
        },
        "min": {
          "type": "number",
          "format": "double"
        }
      },
      "description": "Price rule filter for items to be considered in recommendations."
    },
    "CriteriaProfileAttributeConfiguration": {
      "allOf": [
        {
          "$ref": "#/$defs/CriteriaConfiguration"
        },
        {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "pattern": "^(profile\\.|user\\.).+",
              "description": "Profile attribute."
            },
            "confidence": {
              "type": "string",
              "enum": [
                "VERY_WEAK",
                "WEAK",
                "MODERATE",
                "STRONG",
                "VERY_STRONG"
              ],
              "description": "Applicable only when type is `SITE_AFFINITY`. This determines how much data (strong or weak affinity) is required before a recommendation is presented."
            },
            "datasource": {
              "type": "string",
              "description": "Behavioral data source can either be `mboxes` or a valid Analytics report report suite."
            }
          },
          "required": [
            "attribute",
            "datasource"
          ]
        }
      ]
    },
    "InclusionMatcher": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "string",
          "maxLength": 100
        },
        "highRange": {
          "type": "string"
        },
        "lowRange": {
          "type": "string"
        },
        "operation": {
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/SourceAttribute"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 250
          },
          "minItems": 1,
          "maxItems": 1000
        }
      },
      "required": [
        "attribute",
        "operation"
      ]
    },
    "Matcher": {
      "type": "object",
      "properties": {
        "attribute": {
          "type": "string",
          "maxLength": 100
        },
        "operation": {
          "type": "string"
        },
        "source": {
          "$ref": "#/$defs/SourceAttribute"
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 250
          },
          "minItems": 1,
          "maxItems": 1000
        }
      },
      "required": [
        "attribute",
        "operation"
      ]
    },
    "SourceAttribute": {
      "type": "object",
      "properties": {
        "defaultValue": {
          "type": "string"
        },
        "excludeAllWhenEmpty": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ]
    }
  }
}