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

ConcernPath
CRUD segments/campaign-segments
Split segment/campaign-segments-split
Builder schemaPOST /contacts-segments-schema-builder
Preview / count runPOST /contacts-segments-run-query
SQL preview (admin-style tooling in UI)POST /contacts-segments-json-to-sql
Export contactsPOST /export-data with type: campaign-segment-contacts

Segment fields (from app usage)

FieldTypeDescription
idNumberSegment id.
organization_idNumberOwning organization.
nameStringDisplay name.
channelStringe.g. whatsapp, email, sms, automation, instagram, messenger.
queryObjectJSON rules for the segment builder (patched when the user saves).
typeStringe.g. existing_contacts (used in campaign audience UI).
statusStringe.g. active, inactive, draft.
contact_count / total_personsNumber or stringCount fields as returned by list or audience selectors.

Related

Report an issue with this documentation

Please log in to report issues with our documentation.