publ betaReference (MCP guide)
Open publ console

publ Reference

Migration map.

segment_preview

Calculate a time-specific audience count without saving a segment. Requires the reader's access and required channelCode plus conditions. Read-only behavior may use POST transport.

Condition input

All objects are strict. conditions.include is required; conditions.exclude is optional/null. Each present tree contains 1–20 groups, each with 1–25 anyOf conditions. At most 100 conditions are accepted across both trees together. Conditions within anyOf are OR; groups are AND. Exclusion removes the audience matching its combined tree from inclusion. No empty include or implicit all-user default is accepted. Omitted/null exclude removes exclusion when conditions are replaced.

Path Contract
conditions Explicit include and optional exclude trees.
conditions.include Required nonempty group array.
conditions.include[].anyOf Nonempty OR array.
conditions.include[].anyOf[].classificationCode Required observed option value, 1–256 characters.
conditions.include[].anyOf[].value Optional string, at most 10,000 characters; source-specific checks below further restrict it.
conditions.include[].anyOf[].targetEntityIds Optional array, at most 100 unique observed opaque segment-format identifiers.
conditions.exclude Optional/null nonempty group array when present.
conditions.exclude[].anyOf Same group and OR limits.
conditions.exclude[].anyOf[].classificationCode Same observed-code rule.
conditions.exclude[].anyOf[].value Same value rule.
conditions.exclude[].anyOf[].targetEntityIds Same identity/uniqueness rule.

Composition rules

Copy classificationCode from segment_options. The composer parses its source classification structure, resolves the current parent definition and checks exact option membership. Draft/Upcoming/Sunset are rejected; Deprecated adds a warning. Any MUTABLE condition makes the entire composition mutable.

Entity conditions derive a supported target from the definition and require nonempty observed IDs. SINGULAR or explicit useMultiSelect:false requires exactly one. The source read-only resolver is called twice; identities/order/content must agree and exactly cover the requested IDs, with no deleted, duplicate or foreign-channel row. Canonical targetEntityMetas is built from those exact resolved IDs/titles with isDeleted:false after absence/deletion checks. A missing optional resolver flag is not exposed as evidence of broader lifecycle eligibility. Caller-provided labels/metadata are not accepted. Conditions without a selector reject nonempty targetEntityIds. At most one exhaustible coupon/discount condition is allowed across both trees, and it must be alone in its OR group.

Source value type Accepted value behavior
ENUM or NONE Omit value or use empty string; nonempty free values fail. The composer uses the option label, except an ENUM entity condition uses empty string.
TEXT Explicit nonblank string, at most 50 characters; preserved without trimming.
NUMBER Explicit string of 1–3 digits, including leading zeros.
DATE1 Four-digit year, 1901–2050.
DATE2 Padded month 01–12.
DATE3 Padded day 01–31.
DATE6 YYYY-MM-DD with the same component ranges; this implementation does not additionally validate calendar combinations.
PRICE Nonnegative integer string without separators or leading zeros except 0.
DATE4, DATE5, DATE7, DATA, ENTITY_SELECT_MODAL No active source value renderer is mapped; SEGMENT_VALUE_UI_UNSUPPORTED.

The source value slot must match valueType. The composer uses the observed definition name for itemName and the selected option name/description for selectedOptionName/selectedOptionDescription for every supported value type, including NUMBER. Canonical nondeleted entity metadata and explicit conditions form the four-depth source trees. Full-tree equality remains required; arbitrary returned metadata is not ignored and no raw caller tree is trusted.

{"channelCode":"selected-channel-code","conditions":{"include":[{"anyOf":[{"classificationCode":"SGMT_FINALIZED_NONE_ENUM_USER_A001001"}]}]}}
{"channelCode":"selected-channel-code","conditions":{"include":[{"anyOf":[{"classificationCode":"SGMT_FINALIZED_NONE_ENUM_USER_A001001"}]}],"exclude":null}}

The classification in these shape examples comes from source demo fixtures. Replace it with an actually observed option; it is not a recommended all-user selection.

Count and limitations

FINALIZED composition invokes the source count POST after initial guards, then repeats composition and context checks. Success SEGMENT_COUNT contains countResult {total,matched}, nonnegative safe integers with matched <= total, and warnings. writesPerformed:false and verification {confirmed:true,atomicSnapshot:false,memberEligibilityVerified:false} concern that observation.

MUTABLE returns action_required/SEGMENT_COUNT_NOT_SUPPORTED, countResult:null and verification.confirmed:false. No count request is sent in that path, but definition reads, selected entity-resolution POSTs and context checks may already have occurred. Do not turn null into zero.

No save, job, member export, reservation or benefit issuance occurs. Only entity resolution accepts HTTP 200 or 201 with the required data envelope; count still requires 200. These response rules retain channel and credential continuity checks. A count is neither individual entitlement nor future delivery/eligibility.

Current observations use the bounded response and recovery rules. An oversized response is not a successful empty result. If a write was already sent, retain its original task and reconcile; the failed read does not authorize repeating the change.

Inputs

Field Required here Contract
conditions Yes object
conditions.include Yes array; min items 1; max items 20
conditions.include[].anyOf Yes array; min items 1; max items 25
conditions.include[].anyOf[].classificationCode Yes string; min length 1; max length 256
conditions.include[].anyOf[].value No string; max length 10000
conditions.include[].anyOf[].targetEntityIds No array; items: string; pattern ^[A-Za-z0-9_-]{1,128}$; max items 100
conditions.exclude No array; min items 1; max items 20 or null