> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embedreach.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Segments

> Overview of Segments

# Tenant Segments

## Introduction

Tenant Segments allow you to group users based on specific criteria or conditions. These segments are used to target communications and automations to specific groups of users. Segments are dynamic, meaning users automatically enter or leave segments as they meet or no longer meet the defined conditions.

Please see the API Reference [here](/api-reference/endpoint/get-api-segments-api-segments) for more information.

## Structure

A tenant segment consists of:

* **Status**: Can be either `active` or `deactivated`
* **Business ID**: Links the segment to a specific tenant
* **Name**: A descriptive name for the segment
* **Description**: Detailed description of the segment's purpose
* **Conditions**: Array of conditions that define segment membership. See [Segment Conditions](#segment-conditions) for more information.

## Segment Conditions

### Available Fields

Currently supported fields for conditions include both built-in fields and custom fields:

#### Built-in Fields

These fields are available out of the box for all platforms:

* `user_id`: The unique identifier of the user
* `email`: The user's email address
* `phone`: The user's phone number
* `first_name`: The user's first name
* `last_name`: The user's last name

#### Custom Fields

Custom fields can be exposed through the `fields_to_expose` configuration in your partner resource schema definitions. This allows you to:

* Define custom fields from your data schema
* Specify JSON paths to access nested data structures
* Control field exposure for segments, merge fields, or both
* Add business-specific fields like loyalty points, purchase history, location data, etc.

<Note>
  Custom fields are configured through the `fields_to_expose` property in your partner resource schema definitions. Each field specifies a name, description, JSON path, and exposure settings to control where the field is available.

  For help configuring custom fields, please reach out to [support@embedreach.com](mailto:support@embedreach.com).
</Note>

### Operators

The following operators are available for conditions:

* `equals`: Exact match
* `not_equals`: Inverse match
* `greater_than`: Numeric comparison (>)
* `less_than`: Numeric comparison (\<)

### Condition Structure

Each condition consists of:

```json theme={null}
{
  "field": "user_id",
  "operator": "equals",
  "value": ["123"]
}
```

## Usage in Automations

Segments are primarily used in automations to:

1. **Include Users**: Define the target audience for communications
2. **Exclude Users**: Specify users who should not receive communications

See [Automations](/automations/introduction) for more information on where segments are used.
