Skip to main content
POST
Create campaigns

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Create a campaign — a multi-recipient send (template, custom message or flow) with optional A/B testing. Scramble reads these rules to document the request body.

Mirrors the input keys the existing App\CampaignController::store accepts (campaign_name / device_id / campaign_type / schedule_type / template_id(s) / flow_id / custom_message / send_date+send_time / timezone / ab_* / contacts), exposed under public-facing names. Recipients are supplied as a list of phone numbers in international format.

campaign_name
string
required

Campaign label shown in the dashboard. Required.

Maximum string length: 255
device_id
string
required

Sending device — the device's phone number or id. Required.

campaign_type
enum<string>
required

What the campaign sends. Required.

Available options:
custom,
template,
flow
schedule_type
enum<string>
required

When to send: now, later (needs send_date+send_time), or recurring. Required.

Available options:
now,
later,
recurring
contacts
string[]
required

Recipient phone numbers in international format. At least one required.

Minimum array length: 1
Maximum string length: 32
template_id
integer | null

WaTemplate id (required for non-A/B template campaigns).

template_id_a
integer | null

A/B testing: the two competing WaTemplate ids.

template_id_b
integer | null
flow_id
integer | null

Flow id (required for flow campaigns).

custom_message
string | null

Free-text message body (required for custom campaigns).

Maximum string length: 4096
send_date
string<date-time> | null

Date to send on (Y-m-d) — required when schedule_type=later.

send_time
string | null

Time to send at (HH:MM) — required when schedule_type=later.

Maximum string length: 16
timezone
string | null

IANA timezone for send_date/send_time. Defaults to UTC.

Maximum string length: 64
ab_testing
string | null

Enable A/B testing (template campaigns only).

ab_split
integer | null

Percentage of recipients sent variant A (10-90). Defaults to 50.

Required range: 10 <= x <= 90

Response

Resource created successfully.

data
any[]
required
meta
string
required