> ## 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
> 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 `;`
## OpenAPI
````json POST /campaigns
{
"openapi": "3.0.3",
"info": {
"title": "CommBox API",
"x-logo": {
"url": "https://www.commbox.io/logo/commbox_logo_large.png"
},
"version": "2.07",
"termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
"contact": {
"name": "commbox",
"url": "https://www.commbox.io",
"email": "contactus@commbox.io"
}
},
"servers": [
{
"url": "https://api.commbox.io/",
"description": "Production server"
}
],
"security": [
{
"BearerAuth": []
}
],
"tags": [
{
"name": "Core",
"description": "
Systemwide verification"
},
{
"name": "Objects",
"description": "
Objects are conversations between the AI Agent or the human agent and the customers, where each segment of the conversation is referred to as a Child. Every conversation must have a designated Stream – a communication channel such as Chat, Email, Text/SMS, etc., through which the conversation takes place.
The Object APIs category concentrates on a specific conversation, where the Stream is part of the identifying parameters. In contrast, the Streams APIs category, the Channel is the focal point of the request, and the objects and users are the filtering aspects."
},
{
"name": "Media",
"description": "Converting media files to Base64"
},
{
"name": "AI Services",
"description": "APIs that provide AI capabilities by the platform. "
},
{
"name": "Streams",
"description": "
Streams are communication channels used in CommBox, such as Chat, WhatsApp, SMS/Text, etc. In the Streams category of APIs, the channel is the focal point of the request, and the objects and users are the filtering aspects. See the Enums Section for available channels and their CommBox code."
},
{
"name": "Tags",
"description": "
Tags are a classification tool for summarizing aspects of the conversation or the user. It can mark the conversation to indicate a new sale or identify a customer as not interested in the product. To help manage the Tags assets, Tags can be grouped with a common identifier."
},
{
"name": "SMS",
"description": "
Sending customers **SMS messages** (Texting) requires an initial opt-in step, which is not offered by CommBox and is the sole responsibility of the sending entity (Business)."
},
{
"name": "WhatsApp",
"description": "
CommBox facilitates activities in **WABA** for the clients. Our platform helps clients create new templates and manage existing ones.
**Opt-in for WhatsApp**
Before sending WhatsApp messages to someone, you must first receive opt-in permission confirming that they wish to receive future messages from you on WhatsApp. This can be done using any channel your business uses to communicate with people — your website, app, email, retail location, etc.
- The opt-in must be an active opt-in, which means it must be triggered by a user action, such as entering a phone number or checking a box to indicate consent.
- The opt-in must clearly state your business’ name.
- Clear opt-in messaging so that the customers know what type(s) of messaging they are signing up for.
For more information, please visit: https://developers.facebook.com/docs/whatsapp/guides/opt-in/"
},
{
"name": "Campaigns",
"description": "Send WhatsApp campaigns via an API. Campaigns are reflected in the metrics page in the platform."
},
{
"name": "Users",
"description": "
**Users** are people recorded in CommBox and they include both the business side and the customers.
Managers are APIs that deal with the business personas such as Admins, Agents, Team leaders, etc., and they include **Profiles**, **Presence**, **Assignments**, **Notifications**, and **Teams** sub-categories.
General USERS"
},
{
"name": "Managers",
"description": "
The **MANAGERS** APIs category relates to activities involving the Admins, Team Leaders, Agents, and any other business-related persona. This category includes **Profiles**, **Presence**, **Assignments**, **Notifications**, and **Teams** sub-categories."
},
{
"name": "Profiles",
"description": "
**Profiles** relate to system permissions and enabled activities assigned to a group of agents (managers).
When looking for a specific user, the USER ID is required.
The profile ID is required when selecting a specific profile (See Enum section)."
},
{
"name": "Presence",
"description": "
The Presence APIs relate to the agent availability status. Active and ready for assignment, Busy, or Away from the desk. Additional statuses can be created by the admin."
},
{
"name": "Assignments",
"description": "
The **Assignments** category relates to conversations (Objects) assigned to a specific agent."
},
{
"name": "Teams",
"description": "A Team is a group of agents with specific business agendas, roles, and permissions. Admins and Team Managers can set up Team Managers to create and manage teams and give those teams specific inbox filters, tags, and knowledge-based assets."
},
{
"name": "Audiences",
"description": "The Audiences APIs allow the creation, editing and listing of organizational audiences used for campaigns."
},
{
"name": "Forms",
"description": "The Forms APIs allow agents to assist customers in completing and signing forms issued by the organization. Once the customer submits the form, a new object is created that includes a link to the original conversation and stores the completed, signed form as an attachment."
},
{
"name": "Authentication",
"description": "Authentication APIs provide accessibility to the system."
},
{
"name": "Automation",
"description": "
Automation APIs are related to chatbot capabilities."
},
{
"name": "Transcription",
"description": "
**Transcription** turns a call recording into readable, speaker-attributed messages inside the conversation."
}
],
"x-tagGroups": [
{
"name": "API Calls",
"tags": [
"Core",
"Objects",
"Media",
"AI Services",
"Streams",
"Tags",
"SMS",
"WhatsApp",
"Users",
"Managers",
"Profiles",
"Presence",
"Assignments",
"Teams",
"Audiences",
"Forms",
"Authentication",
"Automation"
]
}
],
"paths": {
"/campaigns": {
"post": {
"tags": [
"Campaigns"
],
"summary": "Send Campaign",
"description": "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.\n\nThe selected `stream_id` must belong to an active WhatsApp channel.
\n\n**Audience file requirements:**\n\nThe 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.
\n\n**Template requirements:**\n\nThe template must be approved by WhatsApp, and `language_code` must exactly match the language configured for the template, for example `en` or `en_US`.\n\nFor templates with input parameters, all placeholders must have values. Separate the values with a semicolon `;`",
"operationId": "send_campaigns",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"type": "object",
"required": [
"template_name",
"language_code",
"stream_id",
"sub_stream_id",
"agent_id",
"scheduled_date"
],
"properties": {
"campaign_name": {
"type": "string",
"description": "(Optional) Enter the title of the campaign"
},
"audience_file": {
"type": "string",
"format": "binary",
"description": "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": {
"type": "string",
"description": "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": {
"type": "boolean",
"default": false,
"description": "(Optional) When true, the uploaded `audience_file` is also saved as a reusable audience. Requires `audience_file` and `new_audience_name`. Defaults to false."
},
"new_audience_name": {
"type": "string",
"maxLength": 50,
"description": "Required when `save_as_new_audience` is true, ignored otherwise. The name the uploaded audience is saved under. Example: ne_usa_above_50"
},
"template_name": {
"type": "string",
"maxLength": 50,
"description": "Required. The name of an approved WhatsApp template.
Example: end_of_year_sale"
},
"language_code": {
"type": "string",
"description": "Required. The WhatsApp language code matching the template's language.
Example: en_uk"
},
"stream_id": {
"type": "string",
"description": "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": {
"type": "string",
"description": "Required. The CommBox ID of a sub-channel of `stream_id`. Leave value empty if there is no subchannel."
},
"agent_id": {
"type": "string",
"description": "Required. The CommBox user id that owns the campaign. The user must belong to the same brand as the API key."
},
"notify_mail": {
"type": "string",
"format": "email",
"maxLength": 50,
"description": "(Optional) An email address that receives the campaign completion report."
},
"scheduled_date": {
"type": "string",
"description": "Required. When left empty, campaign will be sent immediately. Use **unix time in seconds** (UTC)"
},
"expiration_date": {
"type": "string",
"description": "(Optional) The campaign end date and time. Use **unix time in seconds** (UTC)"
},
"template_inputs": {
"type": "string",
"description": "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": {
"type": "string",
"description": "(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": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 200
},
"description": {
"type": "string",
"example": "Campaign created"
},
"response_time": {
"type": "string",
"example": "2025-01-22T11:15:55.0822473Z"
},
"data": {
"type": "string",
"example": ""
}
}
}
}
}
},
"400": {
"description": "Bad Request - The request could not be understood by the server. Incoming parameters might not be valid",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 400
},
"description": {
"type": "string",
"example": "Bad Request"
},
"response_time": {
"type": "string",
"format": "date-time",
"example": "2025-02-06T07:51:52.2581942Z"
}
}
}
}
}
},
"401": {
"description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 401
},
"description": {
"type": "string",
"example": "Unauthorized"
},
"response_time": {
"type": "string",
"format": "date-time",
"example": "2025-02-06T07:51:52.2581942Z"
}
}
}
}
}
},
"404": {
"description": "Not found - The requested resource is not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 404
},
"description": {
"type": "string",
"example": "Not Found"
},
"response_time": {
"type": "string",
"format": "date-time",
"example": "2025-02-06T07:51:52.2581942Z"
}
}
}
}
}
},
"429": {
"description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 429
},
"description": {
"type": "string",
"example": "Too Many Requests"
},
"response_time": {
"type": "string",
"format": "date-time",
"example": "2025-02-06T07:51:52.2581942Z"
}
}
}
}
}
},
"500": {
"description": "Server Error - The server could not return the representation due to an internal server error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "integer",
"example": 500
},
"description": {
"type": "string",
"example": "Internal Server Error"
},
"response_time": {
"type": "string",
"format": "date-time",
"example": "2025-02-06T07:51:52.2581942Z"
}
}
}
}
}
}
}
}
}
},
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer",
"description": "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."
}
}
}
}
````