Documentation Index

Fetch the complete documentation index at: https://help.commbox.io/llms.txt

Use this file to discover all available pages before exploring further.

Send Campaign

Prev Next
Post
/campaigns

This API sends a WhatsApp campaign using a pre-approved template.

The request uses multipart/form-data and can include an audience file (audience_file), one or more IDs of audiences already saved in CommBox (audience_id), or both.

The selected stream_id must belong to an active WhatsApp channel.

Audience file requirements:

The CSV or Excel file must contain a phone1 column. Phone numbers must include the full country code, for example 442079832100. There is a 10 MB file size limit.

Template requirements:

The template must be approved by WhatsApp, and language_code must exactly match the language configured for the template, for example en or en_US.

For templates with input parameters, all placeholders must have values. Separate the values with a semicolon ;

Security
HTTP
Type bearer

API key is needed to authorize requests. You can get your API key via the management console.
A Bearer Token is needed to be set in the Authorization header of every API call.
For additional support you can contact us.

Body parameters
object
campaign_name
string

(Optional) Enter the title of the campaign

audience_file
string (binary)

The target audience file: .csv, .xls or .xlsx, up to 10 MB. Must contain a phone1 column with full country codes. Either audience_file or audience_id is required.

audience_id
string

The numeric ids of audiences already saved in CommBox, separated by ;. Names and titles are not accepted. Every id must exist on the channel given in stream_id. Either audience_file or audience_id is required.
Example: 4471;4472

save_as_new_audience
boolean

(Optional) When true, the uploaded audience_file is also saved as a reusable audience. Requires audience_file and new_audience_name. Defaults to false.

Defaultfalse
new_audience_name
string

Required when save_as_new_audience is true, ignored otherwise. The name the uploaded audience is saved under. Example: ne_usa_above_50

Max length50
template_name
string Required

Required. The name of an approved WhatsApp template.
Example: end_of_year_sale

Max length50
language_code
string Required

Required. The WhatsApp language code matching the template's language.
Example: en_uk

stream_id
string Required

Required. The CommBox ID of the WhatsApp channel the campaign is sent from. Encrypted channel ID is not supported. The channel must belong to the same brand as the API key.

sub_stream_id
string Required

Required. The CommBox ID of a sub-channel of stream_id. Leave value empty if there is no subchannel.

agent_id
string Required

Required. The CommBox user id that owns the campaign. The user must belong to the same brand as the API key.

notify_mail
string (email)

(Optional) An email address that receives the campaign completion report.

Max length50
scheduled_date
string Required

Required. When left empty, campaign will be sent immediately. Use unix time in seconds (UTC)

expiration_data
string

(Optional) The campaign end date and time. Use unix time in seconds (UTC)

template_inputs
string

Required for templates with placeholders. Enter values for all the template's body placeholders, in order, separated by ;. Omit for templates without body parameters.
Example: John;11/8/1971

automation_script_id
string

(Optional) Enter the script ID (flow) to which responding customers will be directed.
Navigate to Settings > Automation Flow module, and select the desired flow. The Id is listed under the flow's name after you select it

Responses
200

OK

object
status
integer
Example200
description
string
ExampleCampaign created
response_time
string
Example2025-01-22T11:15:55.0822473Z
data
string
Example
400

Bad Request - The request could not be understood by the server. Incoming parameters might not be valid

object
status
integer
Example400
description
string
ExampleBad Request
response_time
string (date-time)
Example2025-02-06T07:51:52.258Z
401

Unauthorized - The supplied credentials, if any, are not sufficient to access the resource

object
status
integer
Example401
description
string
ExampleUnauthorized
response_time
string (date-time)
Example2025-02-06T07:51:52.258Z
404

Not found - The requested resource is not found

object
status
integer
Example404
description
string
ExampleNot Found
response_time
string (date-time)
Example2025-02-06T07:51:52.258Z
429

Too Many Requests - Too many requests have been made in a short period of time (Throttling)

object
status
integer
Example429
description
string
ExampleToo Many Requests
response_time
string (date-time)
Example2025-02-06T07:51:52.258Z
500

Server Error - The server could not return the representation due to an internal server error

object
status
integer
Example500
description
string
ExampleInternal Server Error
response_time
string (date-time)
Example2025-02-06T07:51:52.258Z