Autenticación
Envía una clave de API como token de portador. Este endpoint no especifica un permiso concreto en la especificación, así que otorga a tu clave los mínimos privilegios necesarios y comprueba la respuesta en lugar de dar por sentado.
Donde va el ID de tu organización
Este endpoint acepta org_id como parámetro de consulta. Omítelo y la llamada abarcará todo tu subárbol de inquilinos; envíalo para acotar la llamada a una sola organización.
El id de tu organización se encuentra en la pantalla de claves de API en tu panel de control, junto a la propia clave. Es el mismo id en cada llamada que realices.
Pruébalo
Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.
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> }'¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API
Detalles
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.
Parámetros
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
org_id (query) | string | No | Which 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. |
Cuerpo de la solicitud
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
name | string | Sí | — |
description | string | No | — |
definition | CampaignSegmentNode | Sí | 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… |
Respuesta
| Nombre | Tipo | Obligatorio | ¿Qué es esto? |
|---|---|---|---|
id | string | Sí | — |
org_id | string | Sí | The segment's OWNER, not the orgs it selects. |
scope | string<platform, reseller> | Sí | — |
name | string | Sí | — |
description | string | No | — |
definition | CampaignSegmentNode | Sí | 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… |
status | string<active, archived> | Sí | — |
created_by | string | No | — |
created_at | string | No | — |
updated_at | string | No | — |
Errores que este endpoint puede devolver
401 · 403 · 422