API Reference
Your guide to getting things done
Search our documentation articles

Your complete guide to mastering Moosend. Search to get started.

Introduction to segmentation

Article: 000054559
Updated: September 11, 2025

Introduction to segmentation

Abstract

Provides a basic description of segmentation and the query or expression used in Moosend API calls.

You can add segments to your email lists to send targeted email marketing campaigns. You can define a specific audience subset in your email lists using a segmentation query or expression to match the subscribers based on content engagement, location, language, and so on. You can have a single segmentation query or an expression consisting of multiple queries in complex or nested combinations.

A segmentation query or criterion consists of the following parts:

  • Field - the criterion used to filter the email list. See list of segmentation fields.

  • Comparer - the operator that defines how to compare a Field with its Value. Each field supports specific comparers based on the data type. See list of comparers.

  • Additional parameters:

    • MatchType - defines how to combine a group of queries or criteria. It specifies how subscribers are returned by your segment based on matching criteria. Possible values are:

      • All - returns subscribers that match all the given criteria.

      • Any - returns subscribers that match any of the given criteria.

    • FetchType -defines how many criteria-matching subscribers are contained in your segment. Possible values are:

      • All - returns all criteria-matching subscribers.

      • Top - returns only a maximum number of subscribers defined in FetchValue.

      • TopPercent - returns only a percentage of subscribers defined in FetchValue.

    • FetchValue - specifies the maximum number for FetchType:Top or percentage for FetchType:TopPercent of members to be contained in the created segment.

List of segmentation fields

Abstract

Lists the segmentation fields that are used in Moosend API segmentation expressions.

Segmentation queries or expressions can contain any combination of the Fields described in the following tables. You can use either the field name or the corresponding code in your JSON request body. Some fields accept these additional parameters:

  • Date Constrain - constrains the results based on a related date field.

  • OtherMailingListId - runs the query on another email list on members that are contained in both the current and the other email list.

  • CustomFieldId or CustomFieldName - used only with CustomField and specifies the custom field definition by the ID or the name for which the query applies. The custom field definition can be either one of the current email lists or the email list specified by the OtherMailingListId parameter.

Member fields

Code

Data type

Date constrain

OtherMailingListId

DateAdded

1

dateTime

Yes

DateUpdated

16

dateTime

Yes

RecipientName

2

string

Yes

RecipientEmail

3

string

SubscribeMethod

14

enum

Yes (SubscribedOn)

Yes

CustomField

99

string, decimal, dateTime, Boolean

Yes

MailingList

17

guid

Campaign fields

Code

Data type

Date constrain

OtherMailingListId

CampaignsOpened

4

integer

Yes (DeliveredOn)

Yes

LinksClicked

5

integer

Yes (DeliveredOn)

Yes

CampaignName

6

string

Yes (DeliveredOn)

Yes

CampaignTitle

20

string

Yes (Timestamp)

Yes

LinkURL

7

guid

Yes (DeliveredOn)

Yes

CampaignSent

15

guid

Yes (Timestamp)

Yes

OpenedAnyCampaign

24

Boolean

Yes (Timestamp)

Yes

CampaignID

19

guid

Yes (Timestamp)

Yes

SpecificCampaignClicked

26

string

Yes (Timestamp)

Yes

CampaignIdNotOpened

27

string

Yes

User agent fields

Code

Data type

Date constrain

OtherMailingListId

Platform

8

enum (Desktop = 1, Mobile = 2, Other = 3)

OperatingSystem

9

string

EmailClient

10

string

WebBrowser

11

string

MobileBrowser

12

string

Website fields

Code

Data type

Date constrain

OtherMailingListId

AddedAnythingToCart

21

Boolean + extra (CampaignId, ProductCode, WebsiteId, Times)

Yes (Timestamp)

Yes

ViewedProduct

22

Boolean + extra (CampaignId, ProductCode, WebsiteId, Times)

Yes (Timestamp)

Yes

PurchasedProduct

23

Boolean + extra (CampaignId, ProductCode, WebsiteId, Times)

Yes (Timestamp)

Yes

List of comparers

Abstract

Lists the comparers or operators that are used in Moosend API segmentation queries.

Query comparers or operators differ according to the data type of the field. The following table lists the supported operators for each data type. You can use either the name or the code in your JSON request body.

IsEmpty* and IsNotEmpty* are available when the field is nullable.

Operator

Code

String

Integer

Decimal

DateTime

Enum

Guid

Boolean

Is

0

+

+

+

+

+

+

IsNot

1

+

+

+

+

+

+

Contains

2

+

DoesNotContain

3

+

StartsWith

4

+

DoesNotStartWith

5

+

EndsWith

6

+

DoesNotEndWith

7

+

IsGreaterThan

8

+

+

IsGreaterThanOrEqualTo

9

+

+

IsLessThan

10

+

+

IsLessThanOrEqualTo

11

+

+

IsBefore

12

+

IsAfter

13

+

IsEmpty*

14

+

+

+

+

+

+

+

IsNotEmpty*

15

+

+

+

+

+

+

+

IsTrue

16

+

IsFalse

17

+

IsBetween

24

+

+

+

IsNotBetween

25

+

+

+

List of date functions

Abstract

Lists the date functions that are used in Moosend API segmentation fields.

The following table describes the DateFunction values that you can use with fields that have a DateTime data type. You can query based on a property of the date instead of the date itself. The calculation depends on the TimeZoneUsed parameter. Possible time zone values are Local or Utc. When Local is used, the user’s time zone offset is considered.

Function name

Code

Description

Year

1

The four-digit year part of the date.

Month

2

The month part of the date from 1 to 12.

Day

3

The day part of the date from 1 to 31.

WeekDay

4

The day of the week from 1 to 7. For example, 1 for Sunday, 2 for Monday, and so on.

DaysPassed

5

The number of days that have passed until now.

HoursPassed

6

The number of hours that have passed until now.

MinutesPassed

7

The number of minutes that have passed until now.

List of date constrain parameters

Abstract

Lists the date parameters that are used to constrain results of a Moosend API response based on the elapsed time or date span.

You can constrain the results of a Moosend API response based on the elapsed time or date span using the following parameters:

  • LastXMinutes - constrains the results by the time that has elapsed.

  • DateFrom and DateTo - constrain the results based on a specific date span.



Moosend Logo

Copyright © 2026 · All Rights Reserved · Moosend · Privacy Policy