Create an audience segment
POST /audiences/{audienceUuid}/list_segments
Deprecated
/audiences/{audienceUuid}/list_segmentsDeprecated: old segment that lives inside one audience; Customer App does not show it and no new work should use it. Creates a saved segment: a filter with up to five conditions on member data (country, custom fields, campaign activity, groups, purchases...). Members who match are computed and kept up to date by themselves.
When to use: When the user wants to target or act on a slice of an audience defined by rules, for example everyone in Spain who opened the last campaign. First read the available fields with list_audience_condition_fields.
When not to use: To create a segment that Customer App shows and campaigns can use, use create_contact_segment (its fields come from list_contact_filter_fields). For a label you assign by hand, create a group with create_audience_group. For a one-off rule that adds people to a group, use async_task_group_add_from_conditions, which needs no saved segment.
Side effects: The member count (subscriber_count) is calculated in the background, so it can be empty right after creating the segment. Each condition has a field (IRI of a condition field from list_audience_condition_fields), an operator (one of the operators that field lists) and a value whose type depends on the field: text, integer, decimal, boolean, date string (2026-01-15) or an array for multi-select fields. A segment has 1 to 5 conditions.
Permissions: Requires the manager role or higher, or the marketing.audiences.write capability.
Value for the X-Auth-Token header parameter.
In: header
Path Parameters
UUID of the audience to create the segment in. If the account has several audiences, confirm with the user which one. Get it from list_audiences.
The new ListSegment resource
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/audiences/0df14405-90ff-4287-b3e4-ef088901ee6f/list_segments" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "description": "string", "operator_match": "all", "custom": true, "conditions": [ { "field": "/entity/1", "operator": "string", "value": null } ] }'{ "id": 0, "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "description": "string", "operator_match": "all", "subscriber_count": 0, "custom": true, "conditions": [ { "field": "/entity/1", "operator": "string", "operator_to_string": "string", "value": null, "value_to_string": "string" } ], "audience": "/entity/1", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}