campaigns
POST /v1/campaigns/segments/preview
How many people this reaches, who they are, and who it leaves out.
身份验证
请将 API 密钥作为 bearer 令牌发送。此端点在规范中未指明具体的权限,因此请为您的密钥赋予所需的最小权限,并通过检查响应来确认,而不是盲目假设。
您的组织 ID 应填在此处
此端点将 org_id 作为查询参数。不填则调用涵盖您的整个租户子树;发送该参数则将调用范围缩小到一个组织。
您的组织ID位于控制面板的API密钥屏幕上,就在密钥本身的旁边。这是您在每次调用时使用的相同ID。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/campaigns/segments/preview \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
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.
参数
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
org_id (query) | string | 否 | — |
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
definition | CampaignSegmentNode | 否 | 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 | 否 | — |
channel | string | 否 | — |
purpose | string<marketing, transactional> | 否 | `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 | 否 | ⚖️ 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 | 否 | — |
record_approval | boolean | 否 | 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… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
snapshot_id | string | 否 | The approval record's id when `record_approval` was set; `null` otherwise. |
total | integer | 是 | The TRUE recipient count — not the length of `sample`. Show this number, and show the skips beside it. |
skipped_not_in_good_standing | integer | 是 | — |
skipped_no_marketing_consent | integer | 是 | 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 | 是 | — |
skipped_channel_muted | integer | 是 | — |
skipped_no_destination | integer | 是 | Accounts with no member carrying an address on this channel. |
skipped_total | integer | 是 | — |
truncated | boolean | 是 | True when `sample` is shorter than `total`. |
evaluated_at | string | 是 | — |
scope | string<platform, reseller> | 是 | — |
sample | object[] | 是 | — |
此端点可能返回的错误
401 · 403 · 422