campaigns
POST /v1/campaigns/segments/preview
How many people this reaches, who they are, and who it leaves out.
Authentication
Send an API key as a bearer token. This endpoint does not state a specific permission in the specification, so give your key the least it needs and check the response rather than assuming.
Where your organisation id goes
This endpoint takes org_id as a query parameter. Leave it out and the call covers your whole tenancy subtree; send it to narrow the call to one organisation.
Your organisation id is on the API keys screen in your dashboard, beside the key itself. It is the same id in every call you make.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X POST https://api.zinndigital.com/v1/campaigns/segments/preview \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Pass either a `definition` (to preview an unsaved segment as you build it) or a `segment_id` — exactly one. ⛔ `total` is the TRUE recipient count and `sample` is a bounded illustration of it. They are different numbers and `truncated` says when: an operator who reads the sample size as the audience size sends thousands of emails believing they sent twenty. Every response carries all five skip counters whether or not any is non-zero, because a counter that disappears when it is zero is indistinguishable from a fence that never ran. `skipped_no_marketing_consent` will be large today: marketing is soft opt-in for people who are or were customers, and anyone else needs an explicit opt-in.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
org_id (query) | string | No | — |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
definition | CampaignSegmentNode | No | A filter tree. Two node shapes and no third: a GROUP (`op` with `children`) or a CONDITION (`field`/`operator`/`value`). `not` takes exactly one child — an n-ary `not` reads as… |
segment_id | string | No | — |
channel | string | No | — |
purpose | string<marketing, transactional> | No | `marketing` applies the consent fence and the suppression list; `transactional` applies neither — a service notice is not silenced by "stop sending me offers". |
include_not_in_good_standing | boolean | No | ⚖️ Owner ruling 2026-08-26. Suspended and unpaid accounts are excluded by DEFAULT, because a send costs money (CLAUDE.md §2.46). Set this to reach them anyway — which is what a… |
limit | integer | No | — |
record_approval | boolean | No | Persist this resolution as an immutable **approval record** — what the operator saw and agreed to, stamped at the moment they agreed. Returns its id as `snapshot_id`. ⛔ Requires… |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
snapshot_id | string | No | The approval record's id when `record_approval` was set; `null` otherwise. |
total | integer | Yes | The TRUE recipient count — not the length of `sample`. Show this number, and show the skips beside it. |
skipped_not_in_good_standing | integer | Yes | — |
skipped_no_marketing_consent | integer | Yes | People the soft opt-in does not cover — a trial that never converted, an imported contact — who hold no explicit opt-in. |
skipped_unsubscribed | integer | Yes | — |
skipped_channel_muted | integer | Yes | — |
skipped_no_destination | integer | Yes | Accounts with no member carrying an address on this channel. |
skipped_total | integer | Yes | — |
truncated | boolean | Yes | True when `sample` is shorter than `total`. |
evaluated_at | string | Yes | — |
scope | string<platform, reseller> | Yes | — |
sample | object[] | Yes | — |
Errors this endpoint can return
401 · 403 · 422