Adaptive Groups

Learn how to configure Adaptive Groups with the the MTA API to create groups that auto-populate over time.

With Adaptive Groups, you can automatically segment subscribers based on predefined criteria. Once configured these groups will auto-populate with subscribers meeting the defined conditions without the need for manual intervention. This ongoing audience segmentation enables targeted messaging for smarter, data-driven campaigns.

This page explains how to create and configure Adaptive Groups using the Mobile Text Alerts API. Click here for more details about using Adaptive Groups in the platform dashboard.

Manage Adaptive Groups with the API

Adaptive Groups use the same API endpoints as standard groups for all actions but utilize additional request fields for the metadata about the Adaptive Group settings.

Create an Adaptive Group

Adaptive groups are created using the same POST /groups endpoint that is used for standard groups. A group will be stored as an Adaptive Group when the settings field is included as a request field.

settings object definition:

interface IGroupSettings {
match: 'AND' | 'OR';
conditions: IGroupCondition[];
}

match: 'AND' | 'OR' required - This determines which conditions (detailed below) must be met for a subscriber to be added to a group:

  • AND - A subscriber needs to meet all conditions.

  • OR - A subscriber needs to meet any condition.

In the platform dashboard this is seen as "All conditions" (AND) and "Any condition" (OR) when creating/editing an Adaptive Group.

How the match field is selected in the platform dashboard

conditions: IGroupCondition[] required- This contains the rules or conditions of an Adaptive Group.

type IGroupCondition = {
    type: string;
    conditionAttribute: string;
    conditionOperator: IGroupOperator;
    conditionValue: (string | number)[];
};

See below for details on the sub-fields:

  • type:string required - Identifies the data type of the attribute that is being referenced in the rule. For preset attributes the types are as follows:

    • First Name: "string"

    • Last Name: "string"

    • Phone Number: "number"

    • Email: "string"

    • Opt-In Source: "number" - Set of hardcoded values that map to IDs

    • Join Date: "date"

    • Clicked Link: "number"- The numeric ID corresponding to desired short link.

    • Groups: "number" - The numeric ID corresponding to the desired Group.

  • conditionAttribute: string required - This defines the field that will be checked when the Adaptive Group rules are evaluated . The preset attributes are as follows:

    • enum IGroupConditionAttribute { 
          FIRST_NAME = 'firstName', 
          LAST_NAME = 'lastName',
          EMAIL = 'email', 
          PHONE_NUMBER = 'number', 
          JOIN_DATE = 'date', 
          SIGN_UP_METHOD = 'signUpMethod', 
          CLICKED_LINK = 'linkClickTracking', 
          CUSTOM_FIELD = 'custom-' 
      } 

The CUSTOM_FIELD is used to reference Custom Attributes created on your account to store additional data for your subscribers. Use the ID of the custom field to reference the specific field as follows: 'custom-<customFieldID>' .

  • conditionOperator: string enum required - This is the comparison expression that determines how the attribute gets compared to the chosen value. This must be one following enum values:

    • enum IGroupOperator {
          EQUALS = 'equals',
          NOT_EQUALS = 'not equals',
          CONTAINS = 'contains',
          STARTS_WITH = 'starts with',
          ENDS_WITH = 'ends with',
          GREATER_THAN = 'greater than',
          LESS_THAN = 'less than',
          IS_EMPTY = 'is empty',
          IS_NOT_EMPTY = 'is not empty',
          BETWEEN = 'between',
          NOT_BETWEEN = 'not between',
          IS_TRUE = 'is checked',
          IS_FALSE = 'is not checked',
      }
  • conditionValue: (string | number)[] required - This is the value that the subscriber attribute will be compared against. The type of this value must match the type listed in the type field.

Optional Advanced Settings

The settings field can also contain optional fields conditionSubOperator and conditionSubValue . These fields add an additional layer of comparison and complexity recommended only for advanced users.

List of Opt-In Source IDs
OPT_IN_MESSAGE = 1,
SIGN_UP_FORM = 2,
CONTROL_PANEL = 3,
SPREADSHEET_IMPORT = 4,
API = 5,
ACTIVE_DIRECTORY_SYNC = 6,
BLESS_IMPORT = 7,
CONSTANT_CONTACT = 8,
SONLET_SYNC = 9,
THIRD_PARTY_SYNC = 9,
BLESS_REGISTRATION = 10,
MANUAL_ENTRY = 11,
ZIPWHIP_SYNC = 12,
OPT_IN_WEB_BANNER = 13,
ZAPIER_SYNC = 14,
SHOPIFY_SYNC = 15,
HUBSPOT_SYNC = 16,
KEYWORD = 17,
QR_CODE = 18,
WEBINAR_IMPORT = 19

Example settings configuration for an Adaptive Group

Let's create an Adaptive Group with two conditions where if a subscriber meets either condition they will be added to the group.

If a subscriber matches any of these conditions they will be added to the group, so match: "OR".

  • Join Date is between 06/01/2025 to 06/30/2025

    • The following shows how this would be mapped to fields:

      • "type": "date" - The Join Date field uses the type "date" .

      • "conditionAttribute": "date" - The Attribute Name for Join Date is just "date".

      • "conditionOperator": "between" - The comparison being configured is between two dates.

      • "conditionValue": ["2025-06-01 04:00", "2025-06-30 04:00"] - The start and end ranges of the "between" comparison is provided as an array with two dates, represented as strings.

  • Email ends with "@yourorg.com"

    • The following shows how this would be mapped to fields:

      • "type":"string" - The Email field uses the type "string".

      • "conditionAttribute":"email" - The Attribute Name for Email is "email".

      • "conditionOperator":"ends with" - The end of the condition attribute is what is being evaluated so "ends with" is used.

      • "conditionValue":["@yourorg.com"] - The string value that the subscriber email will be compared against to see if it has a match for "ends with" .

Below shows how this is displayed in the platform dashboard:

Example Adaptive Group conditions shown in the platform dashboard

The complete settings configuration for this example:

"settings":
    {"match":"OR",
    "conditions": [
        {"type":"date",
        "conditionAttribute":"date",
        "conditionOperator":"between",
        "conditionValue":["2025-06-01 04:00","2025-06-30 04:00"]},
        
        {"type":"string",
        "conditionAttribute":"email",
        "conditionOperator":"ends with",
        "conditionValue":["@yourorg.com"]}
        ]
    }

See Create Group to learn more about this endpoint.

Update an Adaptive Group

The settings field that contains the conditions for an Adaptive Group can be updated at anytime by calling the PATCH /groups/{groupId}endpoint with the identifying {groupId} of the group to be updated.

List Adaptive Groups

By default, Adaptive Groups are not listed when calling the GET /groups endpoint. To include Adaptive Groups you need to add the optional query parameter: filters[includeAdaptive] .

Example query with Adaptive Groups included:

(note the [] brackets are escaped characters in the cURL request)

curl --location 'https://mobile-text-alerts.com/v3/groups?filters%5BincludeAdaptive%5D=true'\    
  --header 'Authorization: Bearer 3068eebf-7661-5458-830e-65cd055a0b03'

Last updated

Was this helpful?