Rule conditions¶
A rule's conditions decide which customers see its offers, on which channels, at which times, and how often. They test the attributes your agent sends with each request and the customer's past responses to offers. This page describes each kind of condition, where it appears on the rule's offer card, and how it is written in the API. For rules themselves, see Moments, offers, and rules. Every field and operator is in the Rule reference.
Attributes¶
An attribute is a key and value that your agent sends with a request to
describe the customer or the situation, such as plan=prepaid or
checkInDate=2026-11-02. Attributes travel in the attributes object of
the request body, or as query parameters with a leading dot, such as
.plan=prepaid. See Request parameters.
Attributes describe the moment. Use an opaque identifier for the customer, and never send personal data such as names, email addresses, or phone numbers as attribute values.
Audience and exclusions¶
The audience is the group of customers who see the rule's offers. The exclusions are the customers removed from it. A customer sees the rule's offers when the audience matches and the exclusions don't. A rule with no audience reaches everyone, and a rule with no exclusions removes no one.
Each is a condition group. An all group matches when every condition in
it matches, and an any group matches when at least one does. A group can
hold one more level of groups, which expresses "A and (B or C)". A
condition either compares an attribute, such as
{ "attribute": "plan", "op": "equals", "value": "prepaid" }, or counts the
customer's past offer events, such as declines in the last 30 days. See
Conditions for every operator.
Channels, schedule, and frequency¶
The other conditions don't depend on the customer:
| Condition | What it does |
|---|---|
channels |
Limits the rule to the listed channels: rcs, sms, webchat, messenger, or voice. See Channels. |
schedule |
Limits the rule to dates, days of the week, and hours in your org's time zone. See Schedule. |
frequency |
Shows the rule to one customer at most times times in any rolling interval, in milliseconds. See Frequency. |
A rule that lists channels serves only requests whose channel is known.
Your agent sends the channel in the channel parameter, or uses a render
format that names one, such as rcs-google or sms. A request with
neither, such as one in the default format with no channel, never matches
a channel-restricted rule. See Channels.
The time zone is the Time zone setting on your org's Settings page, or UTC when it isn't set.
Set conditions in the console¶
On a rule's offer card, each kind of condition is one field:
| Condition | Card field | Control |
|---|---|---|
| Audience | Who sees it | Conditions on attributes (Attribute) and on past responses (Offer history), combined with all or any, and Group for one more level. |
| Exclusions | Not shown to | The same controls as Who sees it. |
| Channels | Where | RCS, SMS, Web chat, and Voice (beta). None selected means every channel. |
| Frequency | How often | At most N times in a period, for each customer. |
| Schedule | Schedule | Starts and Ends dates, days of the week, and hours From and Until. |
You can also write any of them in your own words, such as
gold-tier guests, but not anyone who declined this in the last month. See
Write a rule in plain language. The field's
sentence reads back what the rule will do either way.
Conditions in the API¶
The Offer Manager API stores each condition as a field of the rule. The Advanced tab of the rule editor shows the same data under What a save sends. The following examples each show one condition. To combine them, put their properties in the same object.
Plan is prepaid:
Plan is prepaid, and either the streak is at least 2 or the customer is a VIP:
{
"audience": {
"all": [
{ "attribute": "plan", "op": "equals", "value": "prepaid" },
{ "any": [
{ "attribute": "streak", "op": "gte", "value": 2 },
{ "attribute": "vip", "op": "true" }
] }
]
}
}
Exclude anyone who declined this offer in the last 30 days:
{ "exclusions": { "any": [ { "event": "declined", "subject": "this_offer", "within_days": 30 } ] } }
A decline is a tap on a reply with the decline
role, or a reported
offer_declined event. A customer who doesn't answer hasn't
declined. See History conditions.
Only on RCS:
Weekdays, 9 AM to 5 PM:
{ "schedule": { "daysOfWeek": ["mon", "tue", "wed", "thu", "fri"], "hours": { "from": 9, "to": 17 } } }
At most twice a week, where 604,800,000 milliseconds is seven days:
All six together:
{
"audience": {
"all": [
{ "attribute": "plan", "op": "equals", "value": "prepaid" },
{ "any": [
{ "attribute": "streak", "op": "gte", "value": 2 },
{ "attribute": "vip", "op": "true" }
] }
]
},
"exclusions": { "any": [ { "event": "declined", "subject": "this_offer", "within_days": 30 } ] },
"channels": ["rcs"],
"schedule": { "daysOfWeek": ["mon", "tue", "wed", "thu", "fri"], "hours": { "from": 9, "to": 17 } },
"frequency": { "times": 2, "interval": 604800000 }
}
Missing attributes¶
An attribute is missing when the request doesn't send it or sends null.
Most conditions don't match a missing attribute, so a customer whose plan
is unknown isn't in an audience of plan equals prepaid. The negative
operators, not_equals, not_in, and not_exists, do match a missing
attribute, so plan not equal to unlimited includes customers whose
plan is unknown.
In exclusions, the same rule means a missing attribute removes no one
unless the exclusion uses a negative operator. An attribute that is present
but can't be read as the condition's type, such as "soon" for a date,
matches only not_exists. See
How attributes are read.
History conditions and frequency caps read the customer's history by the
request's subscriber. A request without a subscriber has no history, so
its history conditions don't match and no frequency cap applies.
Dates¶
A condition whose value is a date, such as
{ "attribute": "checkInDate", "op": "gte", "value": "2026-11-01" },
compares calendar days in your org's time zone and ignores the time of day.
Send date attributes in ISO 8601 format, such as 2027-01-02 or
2027-01-02T13:45:00-04:00. A value with an offset is converted to your
org's time zone first, so for an org in New York,
2027-01-01T23:30:00-07:00 falls on January 2.
Test your conditions¶
A request marked as a test returns the reason each rule was removed, which
shows why a rule did or didn't match. See
Request parameters for the
test parameter, and Decision traces.