API · v1 · stabiel
CODEMETA OSDeveloper Center
NL
Console openen
Entity · campaigns

Campaign Schema

Schema-ID
campaign
Collection
campaigns
Permissions
  • Lezencampaign_view
  • Aanmakencampaign_create
  • Wijzigencampaign_edit
  • Verwijderencampaign_delete

Velden

Campaign Schema

campaigns4 permissions

Generic campaign (newsletter, sales outreach, tech rollout, …). Produces a dynamic work list of campaign_items from a segment query. See ADR 0040.

namestringvereist
1–200 tekens
descriptionstringoptioneel
max. 2000 tekensnullable
typestringvereist
NEWSLETTERSALES_OUTREACHACCOUNT_REVIEWTECH_ROLLOUTRETENTIONUPSELLSURVEYCOMPLIANCEGENERIC
statusstringvereist
DRAFTREADYRUNNINGPAUSEDENDED_PENDING_TASKSCOMPLETEDARCHIVEDFAILED
Default: "DRAFT"
ownerIduuidoptioneel
nullable
assignedTeamIduuidoptioneel
nullable
memberIdsuuid[]optioneel

Ad-hoc team members of this campaign (internal user UUIDs). Independent of assignedTeamId, used for collaboration, task filtering and assignee strategies like RANDOM_MEMBER.

Default: []nullable
baseEntitystringvereist

Schema id of the target entity (e.g. "party", "asset", "contact", "newsletter_subscriber").

1–64 tekens
segmentIduuidoptioneel

Reference to a reusable campaign_segment.

nullable
segmentQueryobjectoptioneel

Inline SegmentQuery tree. Used when no campaign_segment is referenced. See segment-evaluator.ts.

nullable
segmentModestringoptioneel
STATICDYNAMIC_PERIODICDYNAMIC_EVENT
Default: "STATIC"
segmentRefreshIntervalMinintegeroptioneel

Re-evaluation interval for DYNAMIC_PERIODIC mode (minutes).

5 – 1440nullable
onLeaveSegmentstringoptioneel

What happens to items whose target entity no longer matches the segment after refresh.

KEEPSKIP
Default: "KEEP"
recipientResolverobjectoptioneel
nullable
strategystringoptioneel
BY_FUNCTION_ROLEBY_RELATIONSHIP_FLAGEXPLICIT_CONTACTSALL_CONTACTS
rolesstring[]optioneel

FunctionRole slugs, evaluated in priority order.

Default: []
sendToAllMatchingbooleanoptioneel
Default: false
onePerPersonbooleanoptioneel

Address each person once per campaign even if they are a contact of several matching organisations. Missing = one entry per organisation and person.

fallbackStrategystringoptioneel
PRIMARY_CONTACTCOMPANY_EMAILSKIPWARN
Default: "SKIP"
requireOptInbooleanoptioneel
Default: false
optInCategoriesstring[]optioneel
nullable
emailFieldstringoptioneel
workEmailprivateEmailanyAvailable
Default: "anyAvailable"
explicitContactIdsuuid[]optioneel
nullable
actionsobject[]vereist
Default: []
idstringvereist
1–64 tekens
typestringvereist
SEND_EMAILSEND_EMAIL_SEQUENCESEND_NEWSLETTERCREATE_TASKCREATE_TICKETCREATE_OPPORTUNITYSTART_WORKFLOWWEBHOOK
triggerstringvereist
ON_ITEM_CREATEDON_DEMANDDELAYEDCONDITIONAL
delayHoursintegeroptioneel
0 – 2160nullable
conditionsobject[]optioneel
Default: []
fieldstringvereist
1–200 tekens
opstringvereist
containsexactregexeqneqgtegtlteltexistsany
valuestring | number | booleanoptioneel
nullable
valueTypestringoptioneel
stringnumberversionbooleandate
conditionsModestringoptioneel
ANDOR
Default: "AND"
nextIdsstring[]optioneel
max. 20 itemsDefault: []
configobjectoptioneel

Type-specific config (subject/htmlContent for SEND_EMAIL, title/dueInDays for CREATE_TASK, etc.).

enabledbooleanoptioneel
Default: true
scheduledStartAtdatetimeoptioneel
nullable
autoStartbooleanoptioneel
Default: falseread-only
autoStartBystringoptioneel
max. 64 tekensread-onlynullable
autoStartBlockedobjectoptioneel

Set by the worker when a scheduled start was blocked by the start gate: { at, lastCheckedAt, reason, checks[] }.

read-onlynullable
lastTestSendsobjectoptioneel

Per SEND_EMAIL action id: { at, to } of the last successful test e-mail (preflight check test_send).

read-onlynullable
scheduledEndAtdatetimeoptioneel
nullable
startedAtdatetimeoptioneel
read-onlynullable
completedAtdatetimeoptioneel
read-onlynullable
pausedAtdatetimeoptioneel
read-onlynullable
dailySendLimitintegeroptioneel
≥ 1nullable
frequencyCapMinHoursintegeroptioneel
≥ 0nullable
approvalRequiredbooleanoptioneel
Default: false
approvedByuuidoptioneel
read-onlynullable
approvedAtdatetimeoptioneel
read-onlynullable
mandatoryVisibilitybooleanoptioneel

If true, user campaign-mute settings are ignored in /tasks (e.g. for compliance campaigns).

Default: false
configobjectoptioneel

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).

nullable
statsobjectoptioneel
read-onlynullable
itemsTotalintegeroptioneel
≥ 0Default: 0
itemsPendingintegeroptioneel
≥ 0Default: 0
itemsInProgressintegeroptioneel
≥ 0Default: 0
itemsDoneintegeroptioneel
≥ 0Default: 0
itemsSkippedintegeroptioneel
≥ 0Default: 0
itemsFailedintegeroptioneel
≥ 0Default: 0
emailsSentintegeroptioneel
≥ 0Default: 0
emailsDeliveredintegeroptioneel
≥ 0Default: 0
emailsOpenedintegeroptioneel
≥ 0Default: 0
emailsClickedintegeroptioneel
≥ 0Default: 0
emailsBouncedintegeroptioneel
≥ 0Default: 0
emailsUnsubscribedintegeroptioneel
≥ 0Default: 0
emailsComplainedintegeroptioneel
≥ 0Default: 0
tasksCreatedintegeroptioneel
≥ 0Default: 0
ticketsCreatedintegeroptioneel
≥ 0Default: 0
opportunitiesCreatedintegeroptioneel
≥ 0Default: 0
recipientsEmailedintegeroptioneel
≥ 0Default: 0
uniqueOpensInclMachineintegeroptioneel
≥ 0Default: 0
rateBaseintegeroptioneel
≥ 0Default: 0
rateBasisstringoptioneel
deliveredsent_minus_bounces
openRatenumberoptioneel
≥ 0nullable
clickRatenumberoptioneel
≥ 0nullable
lastAggregatedAtdatetimeoptioneel
nullable
lastSegmentEvaluatedAtdatetimeoptioneel
read-onlynullable
tagsstring[]optioneel
Default: []

Standaard-endpoints

Deze resource volgt het generieke CRUD-contract van het platform. Lees de conventies voor paginering, idempotentie, optimistic locking en audit. De belangrijkste endpoints:

  • GET /api/v1/campaigns — Lijst, gepagineerd + filterbaar
  • GET /api/v1/campaigns/<id> — Enkele entity
  • POST /api/v1/campaigns — Aanmaken
  • PATCH /api/v1/campaigns/<id> — Gedeeltelijke update
  • DELETE /api/v1/campaigns/<id> — Soft-delete
  • GET /api/v1/campaigns/<id>/timeline — Audit + activiteiten

Zoeken