Skip to main content
POST
Create a campaign

Authorizations

Authorization
string
header
required

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

Body

application/json

A campaign is a /v1 broadcast. Create it, add recipients, then send.

name
string
required

Name of the broadcast campaign.

Example:

"Black Friday Sale"

channel
enum<string>
required

Broadcast delivery channel. Use 'smart' for per-contact intelligent routing.

Available options:
smart,
sms,
sms_oneway,
whatsapp,
telegram,
email
messageType
enum<string>
default:text

Type of message for broadcast.

Available options:
text,
image,
video,
audio,
document,
template
text
string

Text content or caption. Supports template variables: {{name}}, {{1}}, etc.

Example:

"Hi {{name}}, check out our Black Friday deals!"

content
object

Content for non-text broadcast message types.

emailSubject
string

Email subject line. Required for email broadcasts.

emailHtmlBody
string

HTML body for email broadcasts.

scheduledAt
string<date-time>

Schedule the broadcast for future delivery.

metadata
object
idempotencyKey
string

Idempotency key to prevent duplicate broadcasts.

from
string

The address that sends the campaign (GET /v2/channels). The project default when omitted. Resolved like from on POST /v2/messages, with the campaign's channel as the transport (none for smart).

Response

Created as draft.

campaign
object
required

A campaign. The same object as a /v1 broadcast: its id works on /v1/broadcasts/{broadcastId}.