Segments
Preview segment rules
POST/v1/segments/preview
Requires an API key with the segments:read scope. About keys and scopes
Evaluates a rule tree that has not been saved and returns who it would match. Use this to check a segment definition before creating it.
Request body
rulesobjectrequiredThe unsaved rule tree to evaluate.
One of 2 shapes
- Match all
1 child attribute
allobject[]requiredEvery rule or nested group must match.
at least 1 item · at most 20 items
- Match any
1 child attribute
anyobject[]requiredAt least one rule or nested group must match.
at least 1 item · at most 20 items
Returns
Returns 200 OK with a AudienceCount in data. Otherwise returns an error; Errors lists every code and which to retry.
countintegerrequiredContacts the rules match, counted up to 10000.
min 0 · max 9007199254740991
countExactbooleanrequiredFalse when
countis the cap and more contacts match.