filter object you send to POST /segments (create a group) and POST /segments/preview (count who a rule would match without saving it).
How a rule is built
The three lists combine like this: a contact is in the group when it matches
conditions (joined by operator), and matches every condition in requiredConditions, and matches none of the conditions in excludeConditions. A list that is empty or left out is skipped. With only excludeConditions, the group is everyone except the contacts those conditions match.
- Each list holds at most 20 conditions. A longer list is a
400 VALIDATION_ERROR. - A rule needs at least one condition across the three lists. A rule with none is refused with
422 EMPTY_FILTER. - Unknown keys are refused, in the rule and in every condition (
400 VALIDATION_ERROR, with the path of the bad key in the message). Send only the keys this page lists for the condition’s type. - A condition is an object whose
fieldnames its type. Every type is listed below, each with its own keys. - A few condition shapes are refused in some lists (see “Conditions refused in some lists” below). They get
422 CONDITION_NOT_SUPPORTED. - Unsubscribed contacts are never members of a group, whatever the rule says.
- Time windows (
withinDays,valuein days and the like) count back from the moment the rule is evaluated, so the same rule matches different contacts as time passes. - Where a condition has a “never happened” form (
not_viewed,not_clicked,not_enrolled), it also matches contacts who have no record at all. Each section below says so where it matters.
Ids in conditions
Some conditions point at one of your documents, products, folders, broadcasts or groups by id. Every id is checked against your own account. An id that is not in your account gets422 REFERENCE_NOT_FOUND, with details.path (where in the rule) and details.kind (document, product, tier, cta, folder, broadcast or step). A tag condition that names a tag you do not have gets 422 TAG_NOT_FOUND with details.tag. A group_membership condition that names a group you do not have gets 422 GROUP_REFERENCE_NOT_FOUND with details.groupIds. An id that is not a UUID is a 400 VALIDATION_ERROR.
Where an id is optional, leaving it out widens the condition to “anywhere in your account” (for example,
document_view without documentId means any of your documents). Each section says what the id-free form means.
Condition types
tag
Contacts who carry (or do not carry) one of your tags, matched by the tag’s exact name.
document_view
Contacts who viewed (or never viewed) your documents, with optional limits on which document, how recently, how often and how far they read.
- With a window (
withinDays, orviewedFromandviewedTo), a contact counts as having viewed when their most recent view falls inside it.minCountandminScrollPctare lifetime figures: only the window is about recency, so “3 views within 30 days” means 3 views in total and the latest one in the last 30 days. - A visit to a folder or course that contains the document counts as viewing it.
minScrollPctcounts only direct views of a document, not folder visits. withinDayscannot be combined withviewedFrom/viewedTo.viewedFromandviewedTogo together, andviewedFrommust be on or beforeviewedTo.minCountandminScrollPctare meant forviewed. Withnot_viewedthey are accepted and flip: the contact has no view that reached that count or depth.
consent
Contacts by whether they have agreed to marketing messages from you.
cta_click
Contacts who clicked (or never clicked) a call-to-action button on your documents.
- Scope is the id you give:
ctaIdis that button,documentIdis any button on that document, neither is any button on any of your documents. - Give
ctaIdordocumentId, not both.
email_open
Contacts who opened (or did not open) your broadcast and automation emails. Transactional email such as receipts never counts.
- Scope is the id you give: a broadcast, an automation step, or neither (any broadcast or automation email).
sent_not_openedrequiresbroadcastIdorstepId.sinceSentDaysworks only withsent_not_opened; without it, an email still waiting to go out counts as sent, and with it only emails already sent that many days ago do.minCountcannot be combined withbroadcastIdorstepId.
email_link_click
Contacts who clicked (or did not click) a link in your broadcast and automation emails. Only links to your content count: the unsubscribe link does not.
- Scope is the id you give: a broadcast, an automation step, or neither (any broadcast or automation email).
- Give
broadcastIdorstepId, not both.
has_phone
Contacts by whether you have a phone number for them.
form_submission
Contacts who submitted (or never submitted) any of your forms. There is no way to pick one form.
payment_status
Contacts by the payment status recorded for them when a payment is paid, fails or is refunded.
first_seen
Contacts by how long ago they first appeared (their first view, visit or submission).
last_active
Contacts by how recently they last viewed or visited something of yours. Only document and folder visits count; opening or clicking an email does not.
group_membership
Contacts who are (or are not) in another group of yours.
tier_access
Contacts who have (or lack) current access through a purchase of one of your products.
- Scope is the one id you give. With none of
productId,tierId,documentIdandsaleStatus, the condition covers any product of yours. - Give at most one of
productId,tierId,documentIdandsaleStatus. expiringWithinDaysis required withexpiring_within_daysand must be left out otherwise.
days_since_purchase
Contacts by how long ago they paid for a product.
- A contact who never paid matches neither operator.
- Scope is the one id you give. With none of
productId,tierId,documentIdandsaleStatus, any product of yours counts. Give at most one of the four. - A fully refunded order does not count as paid.
repeat_bounce
Contacts whose email address keeps failing.
course_last_access
Contacts by how recently they visited one folder or course.
kakao_reachable
Contacts you can send a Kakao message to.
course_progress
Contacts by how much of one folder or course they have completed.
location
Contacts by the country, and optionally the city, recorded from their visits.
checkout_abandoned
Contacts who started checking out for one product and did not finish. There is no opposite operator.
Conditions refused in some lists
Some condition shapes are refused with422 CONDITION_NOT_SUPPORTED: details.path points at the condition, details.operator names its operator, and details.invertTo, when there is one, is the operator to put in requiredConditions for the same result. Everything not listed here works in every list.
Every other condition, and these with the other operators or scopes, works in every list.
Not supported yet
Thecustom_field condition is not accepted. A rule that contains it is refused with 422 CONDITION_NOT_SUPPORTED, with details.field naming the condition type and details.path pointing at it.