Create a segment
POST/api/v1/segments
POST /segments
curl -X POST 'https://www.unitpost.com/api/v1/segments' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'User-Agent: my-app/1.0' \
-H 'Content-Type: application/json' \
-d '{
"name": "Active customers"
}'Response · 201
{
"object": "segment",
"id": "id_123",
"name": "Example",
"description": "string",
"type": "static",
"filter": "string",
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Create a segment — a named group of contacts you can target when sending a campaign. Once created, add contacts with Add a member and target it from Create a campaign. To let recipients opt out of a category of mail instead, see Create a topic. Requires the segments:write capability.
Request body4 fields
| Field | Type | Description |
|---|---|---|
namerequired | string | — |
description | string | — |
type | enumstatic | dynamic | — |
filter | object | — |
Response · 201 fields8 fields
| Field | Type | Description |
|---|---|---|
objectrequired | string | — |
idrequired | string | — |
namerequired | string | — |
descriptionrequired | object | — |
typerequired | enumstatic | dynamic | — |
filterrequired | object | — |
created_atrequired | string | — |
updated_atrequired | string | — |
201401422