> ## Documentation Index
> Fetch the complete documentation index at: /docs/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 via the Mailofly API.

### Body Parameters

**name** `string` *required*

The name of the segment (e.g. `Active Subscribers`).

**type** `string`

Segment type: `manual` or `dynamic` (default is `manual`).

**criteria** `object`

Filter rules and conditions for dynamic segments (e.g. properties, activity).

### Response

**data** `object`

**id** `string`

Unique identifier for the segment.

**name** `string`

Segment name.

**type** `string`

Segment type.

**contactsCount** `number`

Number of contacts currently in segment.

**createdAt** `string`

ISO 8601 timestamp.

```bash cURL theme={null}
curl -X POST https://api.mailofly.com/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"
    }
  }'
```

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.