campaigns

POST /v1/campaigns/segments/preview

How many people this reaches, who they are, and who it leaves out.

所有 campaigns 端点

身份验证

请将 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

请求正文

名称类型必填内容简介
definitionCampaignSegmentNodeA 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_idstring
channelstring
purposestring<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_standingboolean⚖️ 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…
limitinteger
record_approvalbooleanPersist 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_idstringThe approval record's id when `record_approval` was set; `null` otherwise.
totalintegerThe TRUE recipient count — not the length of `sample`. Show this number, and show the skips beside it.
skipped_not_in_good_standinginteger
skipped_no_marketing_consentintegerPeople the soft opt-in does not cover — a trial that never converted, an imported contact — who hold no explicit opt-in.
skipped_unsubscribedinteger
skipped_channel_mutedinteger
skipped_no_destinationintegerAccounts with no member carrying an address on this channel.
skipped_totalinteger
truncatedbooleanTrue when `sample` is shorter than `total`.
evaluated_atstring
scopestring<platform, reseller>
sampleobject[]

此端点可能返回的错误

401 · 403 · 422