campaigns

POST /v1/campaigns/segments

Save a new audience segment.

Alle campaigns-eindpunten

Authenticatie

Stuur een API-sleutel mee als bearer token. Dit eindpunt vermeldt geen specifieke toestemming in de specificatie, dus geef uw sleutel de minimale rechten die nodig zijn en controleer het antwoord in plaats van zomaar wat aan te nemen.

Waar je organisatie-id komt te staan

Dit eindpunt accepteert org_id als queryparameter. Laat deze achterwege en de aanroep destilleert je gehele tenant-substructie; stuur deze mee om de aanroep te beperken tot één organisatie.

Uw organisatie-id staat op het scherm met API-sleutels in uw dashboard, naast de sleutel zelf. Dit is in elke aanroep die u doet dezelfde id.

Probeer het

Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw 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> }'

Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console

Details

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.

Parameters

NaamTypeVerplichtWat dit is
org_id (query)stringNeeWhich 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.

Aanvraaglichaam

NaamTypeVerplichtWat dit is
namestringJa
descriptionstringNee
definitionCampaignSegmentNodeJaA 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…

Reactie

NaamTypeVerplichtWat dit is
idstringJa
org_idstringJaThe segment's OWNER, not the orgs it selects.
scopestring<platform, reseller>Ja
namestringJa
descriptionstringNee
definitionCampaignSegmentNodeJaA 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>Ja
created_bystringNee
created_atstringNee
updated_atstringNee

Fouten die dit eindpunt kan retourneren

401 · 403 · 422