Skip to main content
Email marketing segments use a JSON object called filter_rules. You can create segments in the dashboard under Marketing -> Email -> Audience -> Segments or through POST /dev/v1/email-marketing/segments.
All top-level rules are combined with AND. Empty JSON ({}) means all eligible subscribed contacts.
For keys that accept an array, entries inside that array are combined as OR. For example, "country": ["DE", "AT"] means Germany or Austria.

Product purchase

Use product filters when you want customers who bought a specific product. Product filters match paid invoices with status COMPLETED, PARTIAL_REFUND, or REFUNDED. Developer invoices are excluded.
Multiple products:
Nested form:
Supported product keys:

Spending

Spending filters use the customer profile total_spent field. Customers who spent at least 100:
Customers who spent at most 500:
Range:
CamelCase is also supported:

Order count

Order count filters use the customer profile order_count field.
CamelCase is also supported:

Country

Country filters use ISO 3166-1 alpha-2 country codes from the customer profile.
Multiple countries:
country_code is also supported:
country_code can also be an array.

Tags

Match one tag:
Match any tag:
Require all tags:
Segments can narrow contacts to a specific marketing consent basis. Campaign sends only include eligible subscribed contacts.
consent is also supported:
Both consent_basis and consent can also be arrays:

Source

Use source when you need contacts created through a specific path.
Multiple sources:
Examples of common sources include customer_portal, dev-api, manual, backfill:paid_invoice, and automation sources like automation:post_purchase.

Last activity

Last activity filters use the email contact updated_at timestamp.
CamelCase is also supported:

Combined examples

Customers from Germany who bought a product and spent at least 100:
VIP customers in DACH countries who ordered at least twice:
Recent paid-invoice contacts for one product:

Data source notes

  • Product filters use paid invoice line items.
  • Spending, order count, and country filters use customer profile fields.
  • Tags, consent basis, source, and last activity use email audience contact fields.
  • Contacts must still be subscribed, send-eligible, and linked to a known customer or paid buyer.