API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · campaigns

Campaign Schema

ID del esquema
campaign
Colección
campaigns
Permisos
  • Leercampaign_view
  • Crearcampaign_create
  • Modificarcampaign_edit
  • Eliminarcampaign_delete

Campos

Campaign Schema

campaigns4 permisos

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

namestringobligatorio
1–200 caracteres
descriptionstringopcional
máx. 2000 caracteresadmite null
typestringobligatorio
NEWSLETTERSALES_OUTREACHACCOUNT_REVIEWTECH_ROLLOUTRETENTIONUPSELLSURVEYCOMPLIANCEGENERIC
statusstringobligatorio
DRAFTREADYRUNNINGPAUSEDENDED_PENDING_TASKSCOMPLETEDARCHIVEDFAILED
Valor por defecto: "DRAFT"
ownerIduuidopcional
admite null
assignedTeamIduuidopcional
admite null
memberIdsuuid[]opcional

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

Valor por defecto: []admite null
baseEntitystringobligatorio

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

1–64 caracteres
segmentIduuidopcional

Reference to a reusable campaign_segment.

admite null
segmentQueryobjectopcional

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

admite null
segmentModestringopcional
STATICDYNAMIC_PERIODICDYNAMIC_EVENT
Valor por defecto: "STATIC"
segmentRefreshIntervalMinintegeropcional

Re-evaluation interval for DYNAMIC_PERIODIC mode (minutes).

5 – 1440admite null
onLeaveSegmentstringopcional

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

KEEPSKIP
Valor por defecto: "KEEP"
recipientResolverobjectopcional
admite null
strategystringopcional
BY_FUNCTION_ROLEBY_RELATIONSHIP_FLAGEXPLICIT_CONTACTSALL_CONTACTS
rolesstring[]opcional

FunctionRole slugs, evaluated in priority order.

Valor por defecto: []
sendToAllMatchingbooleanopcional
Valor por defecto: false
onePerPersonbooleanopcional

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

fallbackStrategystringopcional
PRIMARY_CONTACTCOMPANY_EMAILSKIPWARN
Valor por defecto: "SKIP"
requireOptInbooleanopcional
Valor por defecto: false
optInCategoriesstring[]opcional
admite null
emailFieldstringopcional
workEmailprivateEmailanyAvailable
Valor por defecto: "anyAvailable"
explicitContactIdsuuid[]opcional
admite null
actionsobject[]obligatorio
Valor por defecto: []
idstringobligatorio
1–64 caracteres
typestringobligatorio
SEND_EMAILSEND_EMAIL_SEQUENCESEND_NEWSLETTERCREATE_TASKCREATE_TICKETCREATE_OPPORTUNITYSTART_WORKFLOWWEBHOOK
triggerstringobligatorio
ON_ITEM_CREATEDON_DEMANDDELAYEDCONDITIONAL
delayHoursintegeropcional
0 – 2160admite null
conditionsobject[]opcional
Valor por defecto: []
fieldstringobligatorio
1–200 caracteres
opstringobligatorio
containsexactregexeqneqgtegtlteltexistsany
valuestring | number | booleanopcional
admite null
valueTypestringopcional
stringnumberversionbooleandate
conditionsModestringopcional
ANDOR
Valor por defecto: "AND"
nextIdsstring[]opcional
máx. 20 elementosValor por defecto: []
configobjectopcional

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

enabledbooleanopcional
Valor por defecto: true
scheduledStartAtdatetimeopcional
admite null
autoStartbooleanopcional
Valor por defecto: falsesolo lectura
autoStartBystringopcional
máx. 64 caracteressolo lecturaadmite null
autoStartBlockedobjectopcional

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

solo lecturaadmite null
lastTestSendsobjectopcional

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

solo lecturaadmite null
scheduledEndAtdatetimeopcional
admite null
startedAtdatetimeopcional
solo lecturaadmite null
completedAtdatetimeopcional
solo lecturaadmite null
pausedAtdatetimeopcional
solo lecturaadmite null
dailySendLimitintegeropcional
≥ 1admite null
frequencyCapMinHoursintegeropcional
≥ 0admite null
approvalRequiredbooleanopcional
Valor por defecto: false
approvedByuuidopcional
solo lecturaadmite null
approvedAtdatetimeopcional
solo lecturaadmite null
mandatoryVisibilitybooleanopcional

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

Valor por defecto: false
configobjectopcional

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

admite null
statsobjectopcional
solo lecturaadmite null
itemsTotalintegeropcional
≥ 0Valor por defecto: 0
itemsPendingintegeropcional
≥ 0Valor por defecto: 0
itemsInProgressintegeropcional
≥ 0Valor por defecto: 0
itemsDoneintegeropcional
≥ 0Valor por defecto: 0
itemsSkippedintegeropcional
≥ 0Valor por defecto: 0
itemsFailedintegeropcional
≥ 0Valor por defecto: 0
emailsSentintegeropcional
≥ 0Valor por defecto: 0
emailsDeliveredintegeropcional
≥ 0Valor por defecto: 0
emailsOpenedintegeropcional
≥ 0Valor por defecto: 0
emailsClickedintegeropcional
≥ 0Valor por defecto: 0
emailsBouncedintegeropcional
≥ 0Valor por defecto: 0
emailsUnsubscribedintegeropcional
≥ 0Valor por defecto: 0
emailsComplainedintegeropcional
≥ 0Valor por defecto: 0
tasksCreatedintegeropcional
≥ 0Valor por defecto: 0
ticketsCreatedintegeropcional
≥ 0Valor por defecto: 0
opportunitiesCreatedintegeropcional
≥ 0Valor por defecto: 0
recipientsEmailedintegeropcional
≥ 0Valor por defecto: 0
uniqueOpensInclMachineintegeropcional
≥ 0Valor por defecto: 0
rateBaseintegeropcional
≥ 0Valor por defecto: 0
rateBasisstringopcional
deliveredsent_minus_bounces
openRatenumberopcional
≥ 0admite null
clickRatenumberopcional
≥ 0admite null
lastAggregatedAtdatetimeopcional
admite null
lastSegmentEvaluatedAtdatetimeopcional
solo lecturaadmite null
tagsstring[]opcional
Valor por defecto: []

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/campaigns — Lista, paginada y filtrable
  • GET /api/v1/campaigns/<id> — Una entidad
  • POST /api/v1/campaigns — Crear
  • PATCH /api/v1/campaigns/<id> — Actualización parcial
  • DELETE /api/v1/campaigns/<id> — Eliminación lógica
  • GET /api/v1/campaigns/<id>/timeline — Auditoría y actividades

Búsqueda