---
title: "Add Segment"
method: POST
path: "/segments"
tags: ["Segments"]
---

# Add Segment

`POST /segments`

Add a new segment, based on specified RULE. Required Access Level: ModifyContacts

## Request body

- SegmentPayload
  - `Name` string, string, required — Segment name
  - `Rule` string, string, required — SQL-like rule to determine which Contacts belong to this Segment. Help for building a segment rule can be found here: https://help.elasticemail.com/en/articles/5162182-segment-rules

## Response `201`

Created

- Segment — Dynamic collection of Contacts, managed by SQL-like rule.
  - `Name` string, string — Segment name
  - `Rule` string, string — SQL-like rule to determine which Contacts belong to this Segment.

---

[API](https://skmtc.net/elasticemail/apis/megamail-api.md) · [All operations](https://skmtc.net/elasticemail/apis/megamail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elasticemail/megamail-api/versions/1a0ebb83f676/schema)
