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

# Audience segments

> Saved filters with tags, platform fields, properties, topics, and marketing.

<Tip>
  A **segment** is a **saved question** ("who is in?"). A **tag** sticks to the file; a **segment** combines rules with AND/OR. Always **Preview** before large campaigns.
</Tip>

## What is a segment?

A **dynamic audience** defined by JSON rules (`version: 1`). When you run a campaign, the system **reapplies** the same rules.

Analogy: a **tag** is a label on the folder. A **segment** is the saved search.

## Segment × tag × topic × campaign

|             | **Segment**     | **Tag**             | **Topic**                 | **Campaign**      |
| ----------- | --------------- | ------------------- | ------------------------- | ----------------- |
| Role        | Defines **who** | Marks contact       | Theme consent             | **Sends** message |
| Persistence | Saved rules     | On contact file     | Per-theme subscription    | Execution (Run)   |
| API         | `segments:*`    | `tags:*` / `tagIds` | `topics:*` / `topic` rule | `campaigns:*`     |

## Format (version 1)

```json theme={null}
{
  "version": 1,
  "match": "all",
  "rules": []
}
```

| Field   | Values               | Meaning                                              |
| ------- | -------------------- | ---------------------------------------------------- |
| `match` | `"all"` or `"any"`   | **all** = AND. **any** = OR                          |
| `rules` | array (up to **32**) | Empty list = **all** contacts, careful in campaigns! |

## Rule types (5)

| `type`             | Filters                                  |
| ------------------ | ---------------------------------------- |
| `tag`              | Contact has tag                          |
| `property`         | **Custom** field                         |
| `contactField`     | **Platform** field (name, phone, email…) |
| `topic`            | Subscribed to **topic**                  |
| `receiveMarketing` | General marketing opt-in                 |

### Quick examples

**Tag + marketing:**

```json theme={null}
{
  "version": 1,
  "match": "all",
  "rules": [
    { "type": "tag", "tagId": "YOUR_VIP_TAG_UUID" },
    { "type": "receiveMarketing", "value": true }
  ]
}
```

Full operators per field type: **API reference** (Segments group).

<Note>
  No `type: "channel"` rule. For phone use `hasPhone` or `phone`. For Telegram use `hasTelegram` or `telegramPeer`.
</Note>

## Preview and campaigns

**Preview** (`segments:read`), paginated sample (max **500** per page).

In **campaigns**, pick the segment as audience. On **Run**, rules execute again.

## Next steps

* [Dashboard campaigns](/en/contacts-api/como-funciona/campanhas-no-painel)
* [Communication topics](/en/contacts-api/como-funciona/topicos-de-comunicacao)
* [Introduction](/en/contacts-api/como-funciona/introducao)
