Save an audience segment
create_contact_segmentSave a contact filter as a named, reusable audience segment. Segments are the audiences campaigns and journeys target. Saving one emails nobody: contacts who already match are added silently and start no journey. Call list_contact_filter_vocabulary first and preview_contact_segment to check the size — a filter naming values the site does not have is refused, and so is one matching nobody unless allow_empty is true (an audience meant to fill up later). No facets = every contact.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name shown to the user, e.g. "Catering enquiries — September" | |
| tags | No | Tags the contact must carry — ALL of them. Values exactly as list_contact_filter_vocabulary returns them, capitals and spaces included | |
| fields | No | Custom field filters: field_key → exact value, e.g. {"budget":"high"}. Keys from list_contact_filter_vocabulary; a select field's value must be one of its options | |
| search | No | Free text matched against email, first name, last name and company | |
| status | No | Pipeline status the contact must have | |
| site_id | Yes | The site, from list_sites | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| allow_empty | No | true only when the user wants an audience that matches nobody today | |
| appointment | No | Appointment state: upcoming (booked, still to come), pending (upcoming, waiting for the owner to confirm), needs_time (asked for an appointment, waiting for the owner to pick a time), had (has had one before) | |
| description | No | Who this audience is for | |
| field_rules | No | Typed custom-field rules, all must match. op "in"/"not_in" take values (e.g. countries ["BR","IN"]); "gt"/"lt" take a numeric value (numeric fields only); "before"/"on_or_after" take value "YYYY-MM-DD"; "is_set"/"is_not_set" take nothing. Prefer this over `fields` for anything but one exact value | |
| acquisition_source | No | Lead source, exactly as list_contact_filter_vocabulary returns it | |
| acquisition_campaign | No | Acquisition campaign, exactly as list_contact_filter_vocabulary returns it |