campaigns

Create campaign

Create, schedule, validate, or queue a bulk WhatsApp campaign.

A campaign dispatches real sends, so (on top of campaigns:write) the key must be authorised to send on the campaign's channel: the umbrella messages:send, or the channel's least-privilege send scope (whatsapp:send / sms:send / email:send).

Set test_mode: true to validate audience counts without queueing.

Pass business_id when creating campaigns for one managed business.

WhatsApp templates are attached to a specific WhatsApp number; pass channel_id to choose the sending number explicitly.

Email campaigns require subject (supports {{n}} variables) and may pass document_source to attach a per-recipient PDF.

A WhatsApp statement run uses a template with a DOCUMENT header and document_source: mode: "url_field" with field_key (a contact custom field holding the https URL for each recipient), mode: "url" for one file to everyone, or mode: "library" for files uploaded in the dashboard (matched to contacts by phone or a custom field in the filename, kept 90 days). filename_template (for example "Statement {{first_name}}.pdf") is required for a DOCUMENT header.

missing_policy decides a recipient with no document: "skip" sends to everyone else and marks that recipient failed with document_missing; "block" refuses a campaign sent now with 400 validation_failed and details.missing_count, and nothing is created.

A scheduled campaign is checked when it fires, not when you create it: the call answers 202 with status "scheduled". If a recipient then has no document under "block", the campaign is closed unsent and a campaign_blocked alert in the workspace names the missing count.

Email campaigns may pass block_content, a block-editor document ({ version: 1, blocks: [...] } with heading/text/button/image/divider/spacer/columns/hero/social/video/html blocks), instead of body; it compiles to branded HTML plus a plain-text part per recipient at send time. Pass either body or block_content, not both.

An email template_id that references a block-designed template carries its design automatically; an inline block_content overrides it.

Audience accepts { type: "all" }, { type: "list", list_id } or { type: "segment", segment_id }. Pass a segment id to target a smart audience evaluated at send time.

To schedule, set mode: "schedule" and scheduled_at (ISO 8601, at most 90 days ahead); the response status is then scheduled. Sends less than 30s out collapse back to immediate.

Optional fields: description (internal label), preheader (email preview text, supports {{n}}), unique_entries (default true; dedupes recipients that match twice) and engagement_limit (cap the number of recipients).

post/api/v1/campaigns

Request

  • Base URL: https://app.blueticked.com
  • URL: https://app.blueticked.com/api/v1/campaigns
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

A unique key (e.g. a UUID) that makes a POST safe to retry: replaying the same key within 24h returns the original result instead of acting twice.

Request body

namestring required
descriptionstring nullable
business_idstring uuid nullable
channel_idstring uuid nullable
channel'whatsapp' | 'sms' | 'email' required
bodystring
subjectstring nullable
preheaderstring nullable
template_idstring uuid nullable
block_contentunknown
template_variablesobject
document_sourceunknown
mode'now' | 'schedule'
scheduled_atstring date-time nullable
test_modeboolean
unique_entriesboolean
engagement_limitinteger nullable

Response

Success

campaign_idstring uuid required
statusstring required
message_countnumber required
queuedboolean required
request_idstring required

Example response

{
  "campaign_id": "8701a57c-11df-4a63-a950-0f22206d6bdf",
  "status": "active_in_progress",
  "message_count": 240,
  "queued": true,
  "request_id": "req_b2e3d610e10f1b07468721ee98f0e1d2"
}

Changes

No recorded changes to this operation across all 1 revision of this API.