Campaign segments API
Campaign segments (service campaign-segments) are saved contact audience definitions used in campaigns (WhatsApp, email, SMS, etc.). Each segment has a query object built in the segment builder, a channel, and belongs to an organization_id.
Supporting endpoints let you load the field schema for the builder, preview matching contacts, split a large segment into smaller ones, and optionally export contacts to Excel.
Base resource
| Concern | Path |
|---|---|
| CRUD segments | /campaign-segments |
| Split segment | /campaign-segments-split |
| Builder schema | POST /contacts-segments-schema-builder |
| Preview / count run | POST /contacts-segments-run-query |
| SQL preview (admin-style tooling in UI) | POST /contacts-segments-json-to-sql |
| Export contacts | POST /export-data with type: campaign-segment-contacts |
Segment fields (from app usage)
| Field | Type | Description |
|---|---|---|
id | Number | Segment id. |
organization_id | Number | Owning organization. |
name | String | Display name. |
channel | String | e.g. whatsapp, email, sms, automation, instagram, messenger. |
query | Object | JSON rules for the segment builder (patched when the user saves). |
type | String | e.g. existing_contacts (used in campaign audience UI). |
status | String | e.g. active, inactive, draft. |
contact_count / total_persons | Number or string | Count fields as returned by list or audience selectors. |
Related
Report an issue with this documentation
Please log in to report issues with our documentation.