API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · campaigns

Campaign Schema

Schema ID
campaign
Collection
campaigns
Permissions
  • Readcampaign_view
  • Createcampaign_create
  • Editcampaign_edit
  • Deletecampaign_delete

Fields

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.

namestringrequired
1–200 characters
descriptionstringoptional
max 2000 charactersnullable
typestringrequired
NEWSLETTERSALES_OUTREACHACCOUNT_REVIEWTECH_ROLLOUTRETENTIONUPSELLSURVEYCOMPLIANCEGENERIC
statusstringrequired
DRAFTREADYRUNNINGPAUSEDENDED_PENDING_TASKSCOMPLETEDARCHIVEDFAILED
Default: "DRAFT"
ownerIduuidoptional
nullable
assignedTeamIduuidoptional
nullable
memberIdsuuid[]optional

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
baseEntitystringrequired

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

1–64 characters
segmentIduuidoptional

Reference to a reusable campaign_segment.

nullable
segmentQueryobjectoptional

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

nullable
segmentModestringoptional
STATICDYNAMIC_PERIODICDYNAMIC_EVENT
Default: "STATIC"
segmentRefreshIntervalMinintegeroptional

Re-evaluation interval for DYNAMIC_PERIODIC mode (minutes).

5 – 1440nullable
onLeaveSegmentstringoptional

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

KEEPSKIP
Default: "KEEP"
recipientResolverobjectoptional
nullable
strategystringoptional
BY_FUNCTION_ROLEBY_RELATIONSHIP_FLAGEXPLICIT_CONTACTSALL_CONTACTS
rolesstring[]optional

FunctionRole slugs, evaluated in priority order.

Default: []
sendToAllMatchingbooleanoptional
Default: false
onePerPersonbooleanoptional

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

fallbackStrategystringoptional
PRIMARY_CONTACTCOMPANY_EMAILSKIPWARN
Default: "SKIP"
requireOptInbooleanoptional
Default: false
optInCategoriesstring[]optional
nullable
emailFieldstringoptional
workEmailprivateEmailanyAvailable
Default: "anyAvailable"
explicitContactIdsuuid[]optional
nullable
actionsobject[]required
Default: []
idstringrequired
1–64 characters
typestringrequired
SEND_EMAILSEND_EMAIL_SEQUENCESEND_NEWSLETTERCREATE_TASKCREATE_TICKETCREATE_OPPORTUNITYSTART_WORKFLOWWEBHOOK
triggerstringrequired
ON_ITEM_CREATEDON_DEMANDDELAYEDCONDITIONAL
delayHoursintegeroptional
0 – 2160nullable
conditionsobject[]optional
Default: []
fieldstringrequired
1–200 characters
opstringrequired
containsexactregexeqneqgtegtlteltexistsany
valuestring | number | booleanoptional
nullable
valueTypestringoptional
stringnumberversionbooleandate
conditionsModestringoptional
ANDOR
Default: "AND"
nextIdsstring[]optional
max 20 itemsDefault: []
configobjectoptional

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

enabledbooleanoptional
Default: true
scheduledStartAtdatetimeoptional
nullable
autoStartbooleanoptional
Default: falseread-only
autoStartBystringoptional
max 64 charactersread-onlynullable
autoStartBlockedobjectoptional

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

read-onlynullable
lastTestSendsobjectoptional

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

read-onlynullable
scheduledEndAtdatetimeoptional
nullable
startedAtdatetimeoptional
read-onlynullable
completedAtdatetimeoptional
read-onlynullable
pausedAtdatetimeoptional
read-onlynullable
dailySendLimitintegeroptional
≥ 1nullable
frequencyCapMinHoursintegeroptional
≥ 0nullable
approvalRequiredbooleanoptional
Default: false
approvedByuuidoptional
read-onlynullable
approvedAtdatetimeoptional
read-onlynullable
mandatoryVisibilitybooleanoptional

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

Default: false
configobjectoptional

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
statsobjectoptional
read-onlynullable
itemsTotalintegeroptional
≥ 0Default: 0
itemsPendingintegeroptional
≥ 0Default: 0
itemsInProgressintegeroptional
≥ 0Default: 0
itemsDoneintegeroptional
≥ 0Default: 0
itemsSkippedintegeroptional
≥ 0Default: 0
itemsFailedintegeroptional
≥ 0Default: 0
emailsSentintegeroptional
≥ 0Default: 0
emailsDeliveredintegeroptional
≥ 0Default: 0
emailsOpenedintegeroptional
≥ 0Default: 0
emailsClickedintegeroptional
≥ 0Default: 0
emailsBouncedintegeroptional
≥ 0Default: 0
emailsUnsubscribedintegeroptional
≥ 0Default: 0
emailsComplainedintegeroptional
≥ 0Default: 0
tasksCreatedintegeroptional
≥ 0Default: 0
ticketsCreatedintegeroptional
≥ 0Default: 0
opportunitiesCreatedintegeroptional
≥ 0Default: 0
recipientsEmailedintegeroptional
≥ 0Default: 0
uniqueOpensInclMachineintegeroptional
≥ 0Default: 0
rateBaseintegeroptional
≥ 0Default: 0
rateBasisstringoptional
deliveredsent_minus_bounces
openRatenumberoptional
≥ 0nullable
clickRatenumberoptional
≥ 0nullable
lastAggregatedAtdatetimeoptional
nullable
lastSegmentEvaluatedAtdatetimeoptional
read-onlynullable
tagsstring[]optional
Default: []

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 + filterable
  • GET /api/v1/campaigns/<id> — Single entity
  • POST /api/v1/campaigns — Create
  • PATCH /api/v1/campaigns/<id> — Partial update
  • DELETE /api/v1/campaigns/<id> — Soft delete
  • GET /api/v1/campaigns/<id>/timeline — Audit + activities

Search