Skip to main content
POST
Create a campaign

Authorizations

Authorization
string
header
required

Company API key, sent as Authorization: Bearer <key>. Create it in the dashboard (Developer > API Keys) with the permissions the integration needs.

Body

application/json

On update, only the fields given change. A scheduled or running campaign cannot be edited: pause it first.

name
string

Required on creation

Maximum string length: 255
category
enum<string>

Required on creation. Contacts who unsubscribed get no marketing campaign.

Available options:
marketing,
transactional,
specialized
objective
string | null
trigger
enum<string>

Required on creation

Available options:
scheduled,
new_conversation
once_per_contact
boolean
send_delay_minutes
integer

Automatic campaigns: wait after the conversation starts

min_inactive_minutes
integer

Automatic campaigns: wait for the conversation to be quiet

channels
object[]

The senders, by their channel_id (GET /channels)

messages
object

whatsapp: { template_id, variables: { name: { source, value?, fallback? } }, buttons?: { index: value }, header_url? } (source: field:firstname|lastname|name|email|phone|address|identifier, column:<key> of the imported file, or text with value); an automatic campaign may send { text } instead. mail: { subject, html }. Texts accept @firstname, @<column> and @{key|fallback}.

audience
object

Scheduled campaigns: { source: "segment", segment_id }, { source: "file", import_id, save_as_segment? } (a checked file, POST /campaign-imports) or { source: "contacts", contact_ids }

start_at
string<date-time> | null
end_at
string<date-time>

Required to launch

send_window
object | null
Example:
follow_up_intention_ids
string[]

Response

200 - application/json

Always HTTP 200: the outcome is in success and code (absolute value of the response code).

success
boolean
Example:

true

code
integer
Example:

1000

message
string
Example:

"Request success."

body
object

Endpoint payload, null when there is none

token
string | null

Present only on authentication routes

trace_id
string | null

Present only when success is false