Campaign Schema
Fields
Campaign Schema
Generic campaign (newsletter, sales outreach, tech rollout, …). Produces a dynamic work list of campaign_items from a segment query. See ADR 0040.
name
description
type
NEWSLETTERSALES_OUTREACHACCOUNT_REVIEWTECH_ROLLOUTRETENTIONUPSELLSURVEYCOMPLIANCEGENERICstatus
DRAFTREADYRUNNINGPAUSEDENDED_PENDING_TASKSCOMPLETEDARCHIVEDFAILEDownerId
assignedTeamId
memberIds
Ad-hoc team members of this campaign (internal user UUIDs). Independent of assignedTeamId, used for collaboration, task filtering and assignee strategies like RANDOM_MEMBER.
baseEntity
Schema id of the target entity (e.g. "party", "asset", "contact", "newsletter_subscriber").
segmentId
Reference to a reusable campaign_segment.
segmentQuery
Inline SegmentQuery tree. Used when no campaign_segment is referenced. See segment-evaluator.ts.
segmentMode
STATICDYNAMIC_PERIODICDYNAMIC_EVENTsegmentRefreshIntervalMin
Re-evaluation interval for DYNAMIC_PERIODIC mode (minutes).
onLeaveSegment
What happens to items whose target entity no longer matches the segment after refresh.
KEEPSKIPrecipientResolver
strategy
BY_FUNCTION_ROLEBY_RELATIONSHIP_FLAGEXPLICIT_CONTACTSALL_CONTACTSroles
FunctionRole slugs, evaluated in priority order.
sendToAllMatching
onePerPerson
Address each person once per campaign even if they are a contact of several matching organisations. Missing = one entry per organisation and person.
fallbackStrategy
PRIMARY_CONTACTCOMPANY_EMAILSKIPWARNrequireOptIn
optInCategories
emailField
workEmailprivateEmailanyAvailableexplicitContactIds
actions
id
type
SEND_EMAILSEND_EMAIL_SEQUENCESEND_NEWSLETTERCREATE_TASKCREATE_TICKETCREATE_OPPORTUNITYSTART_WORKFLOWWEBHOOKtrigger
ON_ITEM_CREATEDON_DEMANDDELAYEDCONDITIONALdelayHours
conditionsMode
ANDORnextIds
config
Type-specific config (subject/htmlContent for SEND_EMAIL, title/dueInDays for CREATE_TASK, etc.).
enabled
scheduledStartAt
autoStart
autoStartBy
autoStartBlocked
Set by the worker when a scheduled start was blocked by the start gate: { at, lastCheckedAt, reason, checks[] }.
lastTestSends
Per SEND_EMAIL action id: { at, to } of the last successful test e-mail (preflight check test_send).
scheduledEndAt
startedAt
completedAt
pausedAt
dailySendLimit
frequencyCapMinHours
approvalRequired
approvedBy
approvedAt
mandatoryVisibility
If true, user campaign-mute settings are ignored in /tasks (e.g. for compliance campaigns).
config
Type-specific config. For NEWSLETTER: { subject, htmlContent, tiptapContent, abTest, fromName, fromEmail, replyTo, emailAccountId, listIds, excludeListIds }. Campaign-wide delivery settings: utm ({ enabled, source, medium, campaign }), newSubscribersOnly/newSubscribersSince, trackingEnabled (boolean, default off: open pixel + click-redirect links are only added to campaign mails when literally true — consent under § 25 Abs. 1 TDDDG; UTM parameters are still applied without tracking).
stats
itemsTotal
itemsPending
itemsInProgress
itemsDone
itemsSkipped
itemsFailed
emailsSent
emailsDelivered
emailsOpened
emailsClicked
emailsBounced
emailsUnsubscribed
emailsComplained
tasksCreated
ticketsCreated
opportunitiesCreated
recipientsEmailed
uniqueOpensInclMachine
rateBase
rateBasis
deliveredsent_minus_bouncesopenRate
clickRate
lastAggregatedAt
lastSegmentEvaluatedAt
tags
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/campaigns— List, paginated + filterableGET /api/v1/campaigns/<id>— Single entityPOST /api/v1/campaigns— CreatePATCH /api/v1/campaigns/<id>— Partial updateDELETE /api/v1/campaigns/<id>— Soft deleteGET /api/v1/campaigns/<id>/timeline— Audit + activities