Segments API
Create dynamic contact segments for campaign targeting.
Endpoints
List Segments
http
GET /api/v1/contacts/segmentsCreate Segment
http
POST /api/v1/contacts/segmentsjson
{
"name": "VIP Customers",
"description": "High-value customers",
"filters": {
"rules": [
{ "field": "leadScore", "operator": "greaterThan", "value": 80 },
{ "field": "tags", "operator": "contains", "value": "vip" }
],
"logic": "AND"
},
"isDynamic": true
}Get Segment Contacts
http
GET /api/v1/contacts/segments/:id/contactsFilter Operators
| Operator | Description |
|---|---|
| equals | Equal to |
| notEquals | Not equal to |
| contains | Contains |
| greaterThan | Greater than |
| lessThan | Less than |
| between | Between two values |
| isEmpty | Is empty |
| isNotEmpty | Is not empty |
Supported Fields
| Field | Type |
|---|---|
| name | string |
| string | |
| phone | string |
| tags | string |
| source | string |
| leadScore | number |
| lastMessageAt | date |
| createdAt | date |
