30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

MailerPress Pro Create Segment

mailerpress-pro/create-segment creates a new segment from a name and a conditions payload.

The payload shape is exact.

At a glance

Abilitymailerpress-pro/create-segment
ToolsetMailerPress Pro — toolset/mailerpress-pro
GroupMailerPress Pro › Segments
RequiresAcrossAI Pro, plus MailerPress with its Pro add-on active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Pro 0.9.16 and later

The conditions object

Conditions are an object, not an array: {operator: "AND"|"OR", conditions: [ {type, operator, value}, … ]}. MailerPress’s runtime evaluator rejects any other shape with invalid_conditions, so the wrapper is not optional formatting.

The outer operator is how the conditions combine: AND means all of them, OR means any. There is one level — conditions do not nest into sub-groups — so a rule that genuinely needs “A and (B or C)” has to be expressed as two segments or restructured.

The valid type and operator values per condition are site-specific and come from mailerpress-pro/list-segment-condition-metadata. Authoring a segment without reading them is guessing at a vocabulary.

A segment with no matching contacts is created happily. That is correct — the conditions may simply not match anybody yet — and it means a typo in a value produces a working empty segment rather than an error.

So check the membership afterwards with mailerpress-pro/get-segments-for-contact. An unexpected zero is usually a value problem rather than an audience problem.

Not idempotent — two calls make two segments, and names are not unique.

Input

NameTypeRequiredWhat it is
namestringYesThe segment name. Used to address it elsewhere.
conditionsobjectYesAn object of shape {operator, conditions: [...]}. Any other shape is refused.

What comes back

NameTypeWhat it is
segmentobjectThe created segment.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Create a segment for customers who have not opened anything in 90 days.

It resolves to one call:

{
  "ability": "mailerpress-pro/create-segment",
  "parameters": {
    "name": "Lapsed customers",
    "conditions": {
      "operator": "AND",
      "conditions": [
        { "type": "last_open", "operator": "before", "value": "-90 days" }
      ]
    }
  }
}

Worth knowing

  • The conditions object wrapper is required, not stylistic.
  • One level of grouping only — no nested sub-groups.
  • An empty segment is created without complaint. Check the membership.
  • Names are not unique. Not idempotent.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading