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

# Update Segment

> Update the name or criteria of an existing segment.

Update segment metadata or dynamic filter rules via the Mailofly API.

### Path Parameters

**id** `string` *required*

The unique identifier of the segment.

### Body Parameters

**name** `string`

The new segment name.

**criteria** `object`

Updated query conditions for dynamic segmenting.

### Response

**data** `object`

**id** `string`

The segment ID.

**name** `string`

Updated segment name.

**type** `string`

Segment type.

```bash cURL theme={null}
curl -X PATCH https://api.mailofly.com/segments/seg_123 \
  -H "Authorization: Bearer mf_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Enterprise Customers (Active)"
  }'
```

```json 200 OK theme={null}
{
  "data": {
    "id": "seg_123",
    "name": "Enterprise Customers (Active)",
    "type": "dynamic"
  }
}
```


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