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

# Create Segment

> Create a dynamic or manual contact segment.

Create a segment to group contacts based on filter conditions or manual assignment.

### Body Parameters

<ParamField body="name" type="string" required>
  The name of the segment (e.g. `Active Subscribers`).
</ParamField>

<ParamField body="type" type="string">
  Segment type: `manual` or `dynamic` (default is `manual`).
</ParamField>

<ParamField body="criteria" type="object">
  Filter rules and conditions for dynamic segments (e.g. properties, activity).
</ParamField>

### Response

<ResponseField name="data" type="object">
  <ResponseField name="id" type="string">Unique identifier for the segment.</ResponseField>
  <ResponseField name="name" type="string">Segment name.</ResponseField>
  <ResponseField name="type" type="string">Segment type.</ResponseField>
  <ResponseField name="contactsCount" type="number">Number of contacts currently in segment.</ResponseField>
  <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.mailofly.com/api/v1/segments \
    -H "Authorization: Bearer mf_live_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "High-Value Customers",
      "type": "dynamic",
      "criteria": {
        "field": "plan",
        "operator": "equals",
        "value": "enterprise"
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "id": "seg_123",
      "name": "High-Value Customers",
      "type": "dynamic",
      "contactsCount": 142,
      "createdAt": "2026-09-11T13:40:00Z"
    }
  }
  ```
</ResponseExample>


## Related topics

- [Segments](/audience/segments.md)
- [Why Use Segments?](/guides/sending/why-use-segments.md)
- [Create Campaign](/api/campaigns/create-campaign.md)
- [MCP Tools Reference](/mcp-server/tools.md)
- [Delete Segment](/api/segments/delete-segment.md)
