Developers
Audience segments: match all or any
Target a survey at the people who match a set of conditions, combined with AND (match all) or OR (match any).
Overview
A segment belongs to one survey and is a list of conditions about a person you identified with FeedPulse.identify(). Attach a segment to a trigger rule and the survey is only shown to people who match. Segments are available on the Pro plan; create and edit them under Segments in the dashboard.
Fields and operators
A condition is a field, an operator and a value (always text; numbers are compared as numbers when both sides are numeric).
property.<key>or just<key>: an attribute you pass toidentify, such asplanorcountry.score: the person's latest real response score.channel: the channel of that response.responses: how many real responses the person has given.email: their email.
Operators: eq, neq, gt, lt, gte, lte, contains and in (a comma-separated list). Text comparisons ignore case. A condition on a field the person does not have is false, and an unknown operator or a non-numeric value for gt/lt/gte/lte never matches, so a mistake hides the survey rather than showing it to everyone.
Match all or any
Match all (AND) requires every condition. Match any (OR) requires at least one. Segments created before this option existed are match-all and keep working unchanged. A segment with no conditions matches everyone.
Groups
A group is a small set of conditions with its own match mode, and the top level treats each group as one item. That lets you mix both: country is US AND (plan is pro OR plan is enterprise) is a match-all segment with the country condition and one match-any group. Groups do not nest (one level). A group needs at least one condition.
Limits
- Up to 20 conditions in total, counting the top level and all groups.
- Up to 5 groups.
- The builder shows a plain-English summary of the segment as you edit it, and the saved segment shows ANY or ALL and its groups.
- An empty group is rejected when you save. A stored segment that is malformed matches nobody.
Examples
Pro or Enterprise customers with fewer than 3 responses
match: all
plan in pro,enterprise
responses lt 3Low last score, or no responses yet (any of these)
match: any
score lte 6
responses eq 0US AND (pro OR enterprise)
match: all
country eq US
group (match: any)
plan eq pro
plan eq enterpriseAPI and MCP
POST /api/v1/segments, PATCH /api/v1/segments/{id} and the MCP create_segment / update_segment tools accept conditions in either shape: the plain array (match all) or an object with match, conditions and optional groups. Reads return conditions as stored plus match, groups and a text summary. Writing needs the write scope; see the REST API docs.
POST /api/v1/segments
{
"surveyId": "<survey id>",
"name": "US, pro or enterprise",
"conditions": {
"match": "all",
"conditions": [{ "field": "country", "operator": "eq", "value": "US" }],
"groups": [{
"match": "any",
"conditions": [
{ "field": "plan", "operator": "eq", "value": "pro" },
{ "field": "plan", "operator": "eq", "value": "enterprise" }
]
}]
}
}Start your 7-day free trial
7-day free trial. No credit card required. 14-day refund on your first payment.
Start 7-day free trialNo credit card required. Cancel anytime.