DocumentationCampaigns

Campaigns

Newsletter campaigns, audience filters, fan-out, and lifecycle states.

Campaigns send a template to a filtered slice of your audience. At send time, MailingCore fans out one queued email per matching contact (respecting locale routing, suppressions, and monthly quota).

Required API key scopes: campaigns:read (list and read) and campaigns:write (create, test, schedule, send, cancel).

Authorization: Bearer mc_live_xxxx
X-Tenant-Id: clxxxxxxxx

Create a campaign

POST /campaigns
{
  "name": "June product update",
  "templateVersionId": "clxversion...",
  "subject": "What's new in June",
  "audienceFilter": {
    "locale": "en",
    "optIn": true,
    "projectId": "clxproject...",
    "attributes": { "plan": "pro" }
  },
  "timezone": "Europe/Madrid"
}
FieldRequiredDescription
nameYesInternal campaign name (max 200)
templateVersionIdNoPublished template version to send
subjectNoOverride subject (max 998)
audienceFilterNoWho receives the campaign
projectIdNoSMTP project
timezoneNoIANA timezone for scheduling

Audience filter

FieldDescription
localeOnly contacts with this locale
optInTypically true for marketing
projectIdProject-scoped audience
attributesMatch custom JSON attributes

Lifecycle states

StatusMeaning
DRAFTCreated; not scheduled or sent
SCHEDULEDWaiting for scheduledAt
SENDINGFan-out in progress
SENTDelivery complete
CANCELLEDStopped before or during send

List and filter:

GET /campaigns?status=DRAFT&page=1&limit=20

Management endpoints

ActionEndpoint
Get oneGET /campaigns/{id}
Update draftPATCH /campaigns/{id}
Test sendPOST /campaigns/{id}/test
SchedulePOST /campaigns/{id}/schedule
Send nowPOST /campaigns/{id}/send
CancelPOST /campaigns/{id}/cancel
Locale coverageGET /campaigns/{id}/locale-coverage

Full step-by-step flow: Campaign workflow.

Templates and locale

Campaigns use a published template version. For multi-language audiences, create locale variants of the same template and rely on contact locale for routing — or run separate campaigns per language.

Check readiness with Locale coverage before scheduling.