Create a saved segment
filter is validated by email_core::parse_filter and stored as submitted; it is re-validated and re-compiled to SQL on every preview/count/broadcast-fanout use, never trusted as pre-compiled.
bearerAuthAuthorizationBearer <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
name*stringfilter*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).
Created.
application/json- response
id?stringname?stringfilter?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).
created_at?integerint64updated_at?integerint64curl -X POST "https://example.com/v1/segments" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "filter": { "conditions": [ { "field": "string", "op": "eq" } ] } }'{ "id": "string", "name": "string", "filter": { "match": "all", "conditions": [ { "field": "string", "op": "eq", "value": "string" } ] }, "created_at": 0, "updated_at": 0}