Preview segment
Segment
Preview Segment
Evaluate candidate filter conditions against an audience’s active contacts without saving a segment. Returns the match count, percentage, and a sample of matching contacts.
POST
Preview segment
Use this endpoint to test filter conditions against an audience’s contacts without saving a segment — powers the “Preview Contacts” step of the Create Segment modal.
Endpoint
POST/segment/preview
Content-Type: application/json
Authentication: Required (workspace auth)
Request Body
Filter Condition Operators
operator must be one of:
This flat
{ field, operator, value } format is different from the CONDITIONLIST tree accepted by Create Segment’s filter_conditions. Passing a CONDITIONLIST payload here will not be understood — it is read as { conditions: [...] } and, having no conditions array of its own, is treated as an empty filter (matches everything).Response
Behavior
- Nothing is persisted — this endpoint only evaluates the filter.
- Only active (non-soft-deleted) audience contacts are considered.
mobile_noin the sample is masked when the workspace’s company has phone number masking enabled.
Error Cases
Example cURL
Headers
API token for authentication
Body
application/json
Audience to preview against.
Flat filter conditions. Alias: filter_conditions. Omitted/empty matches every contact of the audience.
all = AND across conditions (default), any = OR across conditions.
Available options:
all, any Max number of sample contacts to return (default 20).

