---
title: "Segments in Adapty Mail"
description: "Create reusable audience slices based on profile and purchase data to target flows and A/B tests."
---

A **segment** is a reusable audience slice. You define it once — in **Segments** — and reference it from flows and A/B tests. Segments are filter definitions, not snapshots: they're evaluated on demand when a flow trigger fires, so membership always reflects the latest profile data.

## Create a segment

1. In Adapty Mail, go to **Segments** and click **+ Create**. The create page opens with the title **New Segment**.
2. Give the segment a **Name** (required) and an optional **Description**.
3. Under **Filters**, click **Add filter** for each [rule](#available-filter-fields) you want. Each filter becomes a collapsible card labeled **Filter 1**, **Filter 2**, and so on.
4. For each filter, pick a field, pick an operator, and enter the comparison value.
5. Save the segment.

:::important
Filters are combined with **AND** — a user must match every filter to be in the segment. OR logic and nested groups aren't supported. Each field can appear only once per segment; to compare the same field across multiple values, split the logic into separate segments.
:::

## Available filter fields

| Group          | Field                     | Type    |
| -------------- | ------------------------- | ------- |
| Profile        | Email                     | String  |
| Profile        | Age                       | Integer |
| Profile        | Country                   | String  |
| Profile        | External profile ID       | String  |
| Profile        | Created at                | Date    |
| Purchase state | Total revenue (USD)       | Decimal |
| Purchase state | Subscription state        | Enum    |
| Purchase state | Subscription purchased at | Date    |
| Purchase state | Subscription expires at   | Date    |
| Purchase state | One-time purchase state   | Enum    |
| Purchase state | One-time purchased at     | Date    |

**Subscription state values**: Never purchased, Subscribed, Auto-renew off, Billing issue, Grace period, Expired, Refunded.

**One-time purchase state values**: Never purchased, Purchased, Refunded.

Operators available per field type:

- **String**: equals, not equals, is set, is not set.
- **Number**: equals, not equals, less than, greater than, less than or equal, greater than or equal, between, is set, is not set.
- **Date**: equals, not equals, before, after, on or before, on or after, between, is set, is not set.

## The All Users system segment

Adapty Mail ships with a built-in **All Users** segment that has no filters — every user in the project qualifies. You can't edit or delete it. When used in a flow, it serves as the catch-all bottom row (see [Flows](mail-flows) for the priority rule).

## Lifecycle

A segment's state is calculated from how it's being used:

- **Draft**: Created, not attached to any flow or A/B test.
- **Live**: Attached to an active flow or A/B test.
- **Inactive**: Was attached, but the A/B test has finished or the flow row was removed.
- **Archived**: Soft-deleted and hidden from the main list.

The Segments page has a state filter in the toolbar so you can narrow the list to any of these states.

## Edit and delete a segment

- **Name and description**: Always editable.
- **Filters on a Draft segment**: Fully editable.
- **Filters on a Live segment**: Locked. Once a segment is referenced by an active flow row or A/B test, the filters become read-only. You can only rename it or update the description. To change targeting, create a new segment and swap the flow row.
- **Delete**: Soft-deletes the segment. Live segments can't be deleted — remove them from the flow (or finish the A/B test) first.

## Limitations

- **No OR logic, no nesting**: Filters combine with AND only.
- **One field per segment**: A segment can't have two filters on the same field (for example, two country checks).
- **No size preview**: The editor doesn't show how many users currently match the filters.
- **Filters locked once live**: Active segments are read-only except for name and description.