campaigns

POST /v1/campaigns/segments

Save a new audience segment.

Tutti gli endpoint campaigns

Autenticazione

Invia una chiave API come bearer token. Questo endpoint non specifica un permesso specifico nella specifica, quindi assegna alla tua chiave i permessi minimi necessari e verifica la risposta invece di fare supposizioni.

L'ID della tua organizzazione va qui

Questo endpoint accetta org_id come parametro di query. Omettilo e la chiamata coprirà l'intero sottoalbero del tuo tenant; invialo per limitare la chiamata a una singola organizzazione.

L'identificativo della tua organizzazione si trova nella schermata delle chiavi API nella tua dashboard, accanto alla chiave stessa. È lo stesso identificativo in ogni chiamata che effettui.

Provalo

Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.

curl -X POST https://api.zinndigital.com/v1/campaigns/segments \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "name": <string>, "definition": <CampaignSegmentNode> }'

Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API

Dettagli

The `definition` is a filter tree over the fields `GET /v1/campaigns/segments/fields` lists, and is validated on write — a definition that cannot be compiled cannot be stored, so a saved segment never explodes at send time in front of an operator who has already scheduled it. ⛔ An empty group (`{"op":"and","children":[]}`) is refused rather than treated as "everybody": a half-built segment must not silently mean the entire estate.

Parametri

NomeTipoObbligatorioChe cos'è
org_id (query)stringNoWhich organization's campaigns to work on. Required only when you hold campaign access on more than one; staff always work on the platform scope and may omit it.

Corpo della richiesta

NomeTipoObbligatorioChe cos'è
namestring
descriptionstringNo
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…

Risposta

NomeTipoObbligatorioChe cos'è
idstring
org_idstringThe segment's OWNER, not the orgs it selects.
scopestring<platform, reseller>
namestring
descriptionstringNo
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…
statusstring<active, archived>
created_bystringNo
created_atstringNo
updated_atstringNo

Errori che questo endpoint può restituire

401 · 403 · 422