API referenceSegments
Preview an ad-hoc filter without saving it
POST
Compiles filter and returns its live count plus a first page of matching contacts — powers a live segment builder while the user is still editing.
bearerAuthheader
AuthorizationBearer <token>API key sent as Authorization: Bearer <key>. Looked up by SHA-256
hash (email_core::sha256_hex) against api_keys.hash; revoked
keys and keys belonging to a suspended tenant are rejected. See the
top-level Authentication section for permission levels.
application/json- body
filter*email_core::segment::SegmentFilter, validated by parse_filter and compiled to a parameterized SQL predicate by compile_filter. At most 25 conditions; all conditions are ANDed (there is no OR).
limit?integerRange
1 <= value <= 100Default
25Live count + page of matches.
application/json- response
count?integerdata?array<>curl -X POST "https://example.com/v1/segments/preview" \ -H "Content-Type: application/json" \ -d '{ "filter": { "conditions": [ { "field": "string", "op": "eq" } ] } }'{ "count": 0, "data": [ { "id": "string", "email": "user@example.com", "status": "subscribed", "attributes": {}, "source": "string", "created_at": 0, "updated_at": 0 } ]}