Entity · campaign_segments
Campaign Segment Schema
Fields
Campaign Segment Schema
Reusable dynamic audience definition for campaigns. The query tree is translated to a MongoDB aggregation pipeline at evaluation time. See ADR 0040 / segment-evaluator.ts.
name
1–200 characters
description
max 2000 charactersnullable
baseEntity
Schema id of the base entity (e.g. "party", "asset", "contact").
1–64 characters
query
SegmentQuery tree. Either { op: "AND"|"OR"|"NOT", children: [...] } or a Condition node.
mode
Default evaluation mode hint when this segment is used by a campaign (overridable on the campaign).
Values
STATICDYNAMICDefault: "STATIC"
tags
Default: []
lastEvaluatedAt
read-onlynullable
lastEvaluatedCount
≥ 0read-onlynullable
isSystem
System-provided segment templates cannot be deleted.
Default: falseread-only
No fields match the filter.
Standard endpoints
This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:
GET /api/v1/campaign_segments— List, paginated + filterableGET /api/v1/campaign_segments/<id>— Single entityPOST /api/v1/campaign_segments— CreatePATCH /api/v1/campaign_segments/<id>— Partial updateDELETE /api/v1/campaign_segments/<id>— Soft deleteGET /api/v1/campaign_segments/<id>/timeline— Audit + activities