Create a new segment (static or dynamic).
Dynamic Segments:
- Auto-update based on filter conditions
- Contacts added/removed automatically as they match/unmatch filters
- Refresh on-demand or via cron
Static Segments:
- Manual membership control
- Contacts must be explicitly added/removed
- Useful for one-time campaigns or curated lists
Available Filters:
System Fields:
status- Contact subscription status- Operators:
equals,not_equals - Values:
subscribed,unsubscribed,bounced,complained
- Operators:
source- How contact was added- Operators:
equals,not_equals,contains,not_contains,starts_with,ends_with,is_empty,has_value - Values:
api,import,form,manual, or any custom source
- Operators:
Contact Info Fields:
email,first_name,last_name,phone,city,country- Operators:
equals,not_equals,contains,not_contains,starts_with,not_starts_with,ends_with,not_ends_with,is_empty,has_value - Values: Any text string, comma-separated string, or string array.
- Multi-value examples:
{"field": "email", "operator": "equals", "value": ["a@example.com", "b@example.com"]}{"field": "email", "operator": "contains", "value": "gmail.com, yahoo.com"}
- Operators:
Tag Filters:
tags- Contact has any of these tags- Operators:
in,contains,starts_with - Values: Array of tag names
["tag1", "tag2"]or comma-separated string"tag1, tag2"
- Operators:
tags_has_all- Contact has ALL of these tags- Operator:
has_all - Values: Array of tag names
["tag1", "tag2"]or comma-separated string"tag1, tag2"
- Operator:
tags_not- Contact does NOT have any of these tags- Operator:
not_in - Values: Array of tag names
["tag1", "tag2"]or comma-separated string"tag1, tag2"
- Operator:
Campaign Engagement:
campaign_opened- Campaign open tracking- Operators:
has_opened,has_not_opened,at_least,exactly,more_than,less_than,at_most,never - Value: Campaign ID (UUID) or count number
- Additional filters:
campaign_ids(array),time_period_days,exclude_scanner(boolean)
- Operators:
campaign_clicked- Campaign click tracking- Operators:
has_clicked,has_not_clicked,at_least,exactly,more_than,less_than,at_most,never - Value: Campaign ID (UUID) or count number
- Additional filters:
campaign_ids(array),time_period_days,link_url,exclude_scanner(boolean)
- Operators:
campaign_sent- Campaign delivery tracking- Operators:
has_received,has_not_received,was_sent,was_not_sent - Value: Campaign ID (UUID)
- Additional filters:
campaign_ids(array),time_period_days
- Operators:
Date Filters:
- Built-in date fields:
created_at,updated_at,last_sent_at - Custom date fields:
custom_properties.<property_name>withproperty_type,value_type,data_type, ortypeset todateordatetime - Fixed date operators:
exact_date: one calendar date, value"2026-06-19"before: before a date/datetimeafter: after a date/datetimeon_or_before: on or before a date/datetimeon_or_after: on or after a date/datetimefixed_periodorbetween: inclusive date range, value{ "start": "2026-06-01", "end": "2026-06-19" }
- Dynamic date operators:
todayyesterdayin_last/within_last_days: value{ "amount": 7, "unit": "days" }; unit can bedays,weeks, ormonthsmore_than: value{ "amount": 30, "unit": "days" }days_ago,weeks_ago,months_ago: value is the number of days/weeks/months agobetween_past_dates: value{ "start": "2026-05-01", "end": "2026-05-31" }
- Empty checks:
is_empty,has_value,never
Custom Properties:
custom_properties.<property_name>- Filter by any custom property- Text operators:
equals,not_equals,contains,not_contains,starts_with,not_starts_with,ends_with,not_ends_with,is_empty,has_value,exists,not_exists - Numeric operators:
>,>=,<,<=,= - Values: Any text or number based on property type. Text operators accept a string array or comma-separated string for multiple values.
- Text operators:
Multi-value Text Filters:
- Text/tag filters accept up to 100 values per rule.
- The backend accepts both arrays and comma-separated strings, but new UIs should send arrays.
- For positive operators (
equals,contains,starts_with,ends_with), a contact matches if any supplied value matches. - For negative operators (
not_equals,not_contains,not_starts_with,not_ends_with,not_in), a contact matches only when none of the supplied values match.
Filter Structure:
{
"filters": [
{
"field": "status",
"operator": "equals",
"value": "subscribed"
},
{
"field": "email",
"operator": "not_contains",
"value": ["example.com", "testmail.com"]
},
{
"field": "created_at",
"operator": "in_last",
"value": { "amount": 30, "unit": "days" }
},
{
"field": "custom_properties.company_size",
"operator": ">=",
"value": 100
}
],
"match_type": "all"
}Match Types:
all(AND) - Contact must match ALL filtersany(OR) - Contact must match ANY filter
Security
ApiKeyAuth
Filter rules (required for dynamic segments).
Can use either simple format or filter builder format:
- Simple:
{"status": "subscribed", "source": "form"} - Filter Builder:
{"filters": [...], "match_type": "all"}
Example:
{ "filters": [ { … }, { … } ], "match_type": "all" }
- US Data Centerhttps://api.mailerlogic.net/api/v1/contacts/segments
- EU Data Center (coming soon)https://eu-api.mailerlogic.net/api/v1/contacts/segments
- Dynamic segment with filter builder (recommended)
- Dynamic segment with custom properties
- Static segment example
curl -i -X POST \
https://api.mailerlogic.net/api/v1/contacts/segments \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
"name": "Engaged Newsletter Subscribers",
"description": "Subscribed contacts who opened our welcome campaign",
"is_dynamic": true,
"filter_conditions": {
"filters": [
{
"field": "status",
"operator": "equals",
"value": "subscribed"
},
{
"field": "campaign_opened",
"operator": "has_opened",
"value": "aa53af3b-a5ea-4057-9618-88c5245b842a"
},
{
"field": "tags",
"operator": "in",
"value": [
"newsletter",
"verified"
]
}
],
"match_type": "all"
}
}'