Mautic Advanced icon

Mautic Advanced

Consume Mautic API with advanced features

Segment → Create

AI-generated

Summary

Create a new Segment in Mautic with a specified name and optional additional properties such as alias, description, publication status, global visibility, and multiple complex filters.

Inputs

  • Authentication — Choose the authentication method to connect to Mautic: Credentials or OAuth2.
  • Name (required) — The name of the new segment to be created.
  • Additional Fields — Optional fields to further define the segment, including alias, description, whether it is published, global, and filters. Filters define conditions for segment membership using fields, objects (contact or company), operators, and glue logic ('and'/'or'). Multiple filters can be added.

Output shape

a single record representing the newly created segment's data including its ID and properties.

The output returns the created segment data from Mautic's API response. If filters are provided, they are serialized into query parameters for Mautic. The operation requires the 'Name' field at minimum. The authentication method selection is required but defaults to credentials. Error handling includes validation and request errors from Mautic API.

Examples

Example 1: Create a segment with required name only

Set Name to 'New Segment' with default authentication and no additional fields.

Example 2: Create a published global segment with an alias and a date filter on contacts

Set Name to 'Active Customers', Additional Fields including Alias, Is Published = true, Is Global = true, and one Filter with Object = Contact, Field = 'last_active', Type = Date, Operator = 'gte', Filter = '2023-01-01'.

Discussion