ContactCondition
Variants
Set type to one of searchText, archiveStatus, createdAt, firstSeen, lastInteraction, chatCount, customFieldText, customFieldDate, hasAnyTag, hasAnyChannel.
SearchTextCondition
searchTextMatches contacts whose name, email, or phone number contains `text`, ignoring case. Not allowed in saved segments.
- Name
type- Type
- enum
- required
One of: searchText- Name
text- Type
- string
- required
{
"type": "searchText",
"text": "string"
}ArchiveStatusCondition
archiveStatusSelects non-archived (`active`) contacts, `archived` contacts, or `all`. Without this condition, only non-archived contacts match.
- Name
type- Type
- enum
- required
One of: archiveStatus- Name
status- Type
- ArchiveStatus
- required
{
"type": "archiveStatus",
"status": "active"
}CreatedAtCondition
createdAtMatches contacts by creation time. `before` uses `end`, `after` uses `start`, and `between` uses both (`start` inclusive, `end` exclusive). `olderThanDays` and `newerThanDays` use `days`.
- Name
type- Type
- enum
- required
One of: createdAt- Name
operator- Type
- enum
- required
One of: before, after, between, olderThanDays, newerThanDays- Name
start- Type
- string
- Name
end- Type
- string
- Name
days- Type
- integer
{
"type": "createdAt",
"operator": "before",
"start": "string",
"end": "string",
"days": 0
}FirstSeenCondition
firstSeenMatches contacts by the time of their first chat interaction. Operators read `start`, `end`, and `days` as in `createdAt`; `exists` and `notExists` take no values.
- Name
type- Type
- enum
- required
One of: firstSeen- Name
operator- Type
- enum
- required
One of: before, after, between, olderThanDays, newerThanDays, exists, notExists- Name
start- Type
- string
- Name
end- Type
- string
- Name
days- Type
- integer
{
"type": "firstSeen",
"operator": "before",
"start": "string",
"end": "string",
"days": 0
}LastInteractionCondition
lastInteractionMatches contacts by the time of their most recent chat interaction. Operators read `start`, `end`, and `days` as in `createdAt`; `exists` and `notExists` take no values.
- Name
type- Type
- enum
- required
One of: lastInteraction- Name
operator- Type
- enum
- required
One of: before, after, between, olderThanDays, newerThanDays, exists, notExists- Name
start- Type
- string
- Name
end- Type
- string
- Name
days- Type
- integer
{
"type": "lastInteraction",
"operator": "before",
"start": "string",
"end": "string",
"days": 0
}ChatCountCondition
chatCountMatches contacts by their number of chats in `window`. `atLeast` uses `min`, `atMost` uses `max`, and `between` uses both; bounds are inclusive.
- Name
type- Type
- enum
- required
One of: chatCount- Name
operator- Type
- enum
- required
One of: atLeast, atMost, between- Name
min- Type
- integer
- Name
max- Type
- integer
- Name
window- Type
- EngagementWindow
- required
{
"type": "chatCount",
"operator": "atLeast",
"min": 0,
"max": 0,
"window": {
"type": "lifetime",
"days": 0
}
}CustomFieldTextCondition
customFieldTextMatches contacts by the value of a `text` custom field. `equals` and `notEquals` use `value`, and `in` uses `values`. `notEquals` and `in` match only contacts that have a value for the field.
- Name
type- Type
- enum
- required
One of: customFieldText- Name
fieldId- Type
- string
- required
- Name
operator- Type
- enum
- required
One of: equals, notEquals, in, exists, notExists- Name
value- Type
- string
- Name
values- Type
- array<string>
{
"type": "customFieldText",
"fieldId": "string",
"operator": "equals",
"value": "string",
"values": [
"string"
]
}CustomFieldDateCondition
customFieldDateMatches contacts by the value of a `date` custom field. `start` and `end` are `YYYY-MM-DD` dates: `before` uses `end`, `after` uses `start`, and `between` uses both (`start` inclusive, `end` exclusive). `olderThanDays` and `newerThanDays` use `days`.
- Name
type- Type
- enum
- required
One of: customFieldDate- Name
fieldId- Type
- string
- required
- Name
operator- Type
- enum
- required
One of: before, after, between, olderThanDays, newerThanDays, exists, notExists- Name
start- Type
- string
- Name
end- Type
- string
- Name
days- Type
- integer
{
"type": "customFieldDate",
"fieldId": "string",
"operator": "before",
"start": "string",
"end": "string",
"days": 0
}HasAnyTagCondition
hasAnyTagMatches contacts that have at least one of the tags in `tagIds`.
- Name
type- Type
- enum
- required
One of: hasAnyTag- Name
tagIds- Type
- array<string>
- required
{
"type": "hasAnyTag",
"tagIds": [
"string"
]
}HasAnyChannelCondition
hasAnyChannelMatches contacts with a conversation on at least one of the `channels`.
- Name
type- Type
- enum
- required
One of: hasAnyChannel- Name
channels- Type
- array<ContactChannel>
- required
{
"type": "hasAnyChannel",
"channels": [
"whatsapp"
]
}