Rule Models and Filters

The API supports two rule models: advanced or simple. Use ADVANCED rules when you need nested logic, explicit grouping, or include/exclude branches. Use SIMPLE rules when you want to combine one or more asset selections using a set operation such as UNION or INTERSECT.

Advanced Rules

Use ADVANCED rules when you need nested logic, explicit grouping, or include/exclude branches.

FieldTypeRequiredDescription
typestringYesMust be "advancedRule"
includeSegmentLogic objectYesTree of segment logic describing which members to include
excludeSegmentLogic objectNoTree of segment logic describing which members to exclude. If used, must appear combined last (see Constraints and Validation Rules).

SegmentLogic Object

Used for include/exclude, and recursively nested inside left/right below.

FieldTypeRequiredDescription
typestringYesDiscriminator: "SegmentLogic" in examples (the spec's discriminator mapping uses lowercase "segmentLogic")
logicstringYesAND or OR. Combines left and right.
isGroupbooleanNoMarks this node as a parenthesized rule group. Set to true when this node's own logic (left/right combined via its logic value) should be evaluated as a single grouped unit before being combined with a sibling node one level up: the same role parentheses play in a math expression, e.g. "(A OR B) AND C". Set false (or omit) for a top-level node or one that doesn't need grouping.
leftnodeYesLeft child node: a Segment, Segmentation, or nested SegmentLogic node (see below)
rightnodeNoRight child node, same allowed types as left. Omit for a single-branch (unary) expression.

Node Types for SegmentLogic's Left/Right

A SegmentLogic node's left or right can be one of three node types, distinguished by type. Fields are grouped by node type below. The "Node Type" column repeats for readability: it is not itself a field.

Node TypeFieldTypeRequiredDescription
SegmenttypestringYesDiscriminator: "segment" per the spec's mapping (this node type doesn't appear in any example reviewed)
SegmentidstringYesReferenced segment asset ID
SegmentnamestringYesReferenced segment name
SegmentsizeintegerNoRow count when known. May be absent while computing.
SegmentationtypestringYesDiscriminator: "Segmentation" in examples (the spec's discriminator mapping uses lowercase "segmentation")
SegmentationaudienceIDstringYesCatalog asset ID to segment. The spec spells this audienceID; every real example uses audienceId (lowercase d).
SegmentationaudienceNamestringNoCatalog asset name, when available
Segmentationfiltersfilter nodeNoA single filter or a nested filter-logic tree (see "Filters on Advanced Rules" below). If empty or omitted, all members in the asset match.
SegmentLogic (nested)typestringYesDiscriminator: "SegmentLogic"
SegmentLogic (nested)logicstringYesSame as the top-level SegmentLogic.logic field above
SegmentLogic (nested)isGroupbooleanNoSame grouping role as the top-level SegmentLogic.isGroup field above
SegmentLogic (nested)leftnodeYesSame as above. Nesting can continue up to the maximum rule depth (three levels; see Constraints and Validation Rules).
SegmentLogic (nested)rightnodeNoSame as above

Filters on Advanced Rules

A Segmentation node's filters property can be either a single flat filter condition, or a nested AND/OR tree of filter conditions (the nested tree form is untested). The "Filter Node Type" column repeats for readability: it is not itself a field.

Filter Node TypeFieldTypeRequiredDescription
filter (single condition)typestringYesDiscriminator: "filter"
filter (single condition)fieldstringYesColumn or field on the asset to filter on
filter (single condition)fieldTypestringYesField type: see Filter Types and Operators
filter (single condition)operatorstringYesComparison operator: see Filter Types and Operators
filter (single condition)valuestringYesOperand compared to the field; encoding depends on fieldType and operator
filterLogic (nested tree)typestringYesDiscriminator: "filterLogic" (not seen in any example: this whole nested form is untested)
filterLogic (nested tree)logicstringYesAND or OR. Combines left and right.
filterLogic (nested tree)leftfilter nodeYesLeft child: a filter or nested filterLogic node
filterLogic (nested tree)rightfilter nodeYesRight child, same allowed types as left
filterLogic (nested tree)isGroupbooleanYesSame grouping role as SegmentLogic.isGroup above: marks this filterLogic node as a parenthesized group of filter conditions

Simple Rules

Use SIMPLE rules (the default when ruleType is omitted) when you want to combine one or more asset selections using a set operation such as UNION or INTERSECT.

FieldTypeRequiredDescription
typestringYesMust be "simpleRule"
setOperationstringNoUNION (combine all matching members) or INTERSECT (only members matching every item). No documented default when omitted.
itemsarray of AssetSelectorYesFeed-backed assets to combine, each with its own filter list: see "AssetSelector Object" below

AssetSelector Object

One feed row in a simple rule: which asset to read and how to filter it.

FieldTypeRequiredDescription
assetIDstringYesAsset ID for this feed row
logicalOperatorstringNoAND or OR. Combines this item's filters.
filtersarray of filter conditionsNoPredicates on this asset: see "Filters on Simple Rules" below. If empty or omitted, all members in the referenced asset match.
assetNamestringNoCatalog asset name, when available

Filters on Simple Rules

Each entry in an AssetSelector's filters array:

FieldTypeRequiredDescription
fieldNamestringYesColumn or field on the Catalog asset (table, view, or segment) to filter on
fieldTypestringYesCatalog field type: see Filter Types and Operators
comparisonOperatorstringYesComparison operator: see Filter Types and Operators
fieldValuestringYesOperand compared to the field; encoding depends on fieldType and comparisonOperator

Note: SIMPLE-rule filters use fieldName/fieldType/comparisonOperator/fieldValue; ADVANCED-rule filters use field/fieldType/operator/value. Same concepts, different property names depending on rule type.