> ## 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.

# Quick Start — Segments

> Define rules, save the segment, and use it in campaigns or export.

<Tip>
  A **segment** is a dynamic set of contacts that **updates on its own** when tags, topics, or data change.
</Tip>

## In brief

* **Build** rules (`match: all` or `any`).
* **Save** with `POST /v1/segments`.
* **Use** in a campaign or `GET /v1/segments/{id}/contacts`.

Context: [Segments in the Audience](/en/contacts-api/como-funciona/segmentos-na-audiencia). Scopes: [Segment scopes](/en/contacts-api/como-funciona/segmentos-escopos-da-api-key).

## Before you start

| Item                  | Required                   |
| --------------------- | -------------------------- |
| **`segments:create`** | To create                  |
| **`segments:read`**   | To list and export members |

Auth: `Authorization: Bearer sk_live_...`. Base URL: `https://api.notifique.dev`.

***

## 1. In the dashboard

1. **Audience → Segments → New**
2. Name (`VIP Customers`)
3. Add rules (tag, topic, marketing, channel, etc.)
4. Save — the member count updates automatically

***

## 2. Simple segment (API)

Contacts with VIP tag who accept marketing:

```http theme={null}
POST /v1/segments
Content-Type: application/json
Authorization: Bearer sk_live_xxxxx
```

```json theme={null}
{
  "name": "VIP marketing",
  "definition": {
    "version": 1,
    "match": "all",
    "rules": [
      { "type": "tag", "tagId": "clxxTagVip" },
      { "type": "receiveMarketing", "value": true }
    ]
  }
}
```

***

## 3. List segments

```http theme={null}
GET /v1/segments?page=1&limit=50
Authorization: Bearer sk_live_xxxxx
```

***

## 4. Preview members

```http theme={null}
GET /v1/segments/{segmentId}/preview?page=1&limit=100
Authorization: Bearer sk_live_xxxxx
```

Returns a paginated sample of contacts that match the segment (max. 500 per page).

***

## 5. Use in a campaign

In the dashboard, choose the segment as the audience. In the campaign API, use the `segmentId` returned when creating the campaign.

***

## Rule types (`type`)

| `type`             | Use                              |
| ------------------ | -------------------------------- |
| `tag`              | Contact has the tag              |
| `topic`            | Subscribed (or not) to the topic |
| `receiveMarketing` | Accepts marketing                |
| `channel`          | Has channel (email, whatsapp, …) |
| `field`            | Custom field                     |

Details and examples: [Segments in the Audience](/en/contacts-api/como-funciona/segmentos-na-audiencia).

***

## Next steps

* [Campaigns — Quick Start](/en/contacts-api/como-funciona/campanhas-quick-start)
* [Tags — Quick Start](/en/contacts-api/como-funciona/tags-quick-start)
* [Introduction](/en/contacts-api/como-funciona/introducao)
