> ## 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 enables the sending of WhatsApp campaigns using pre-approved templates that do not include body parameters (header image, textual placeholders, etc.).<br> Request body parameters includes a CSV or Excel file with the target audience.<br><br>**Note:** The file must include a column named **phone1**, where all phone numbers are formatted with the full country code (e.g., 442079832100 for the UK).<br><br>Must include an approved template with the proper WhatsApp language code.

## OpenAPI

````json POST /whatsapp/campaign
{
  "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"
    }
  ],
  "paths": {
    "/whatsapp/campaign": {
      "post": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send Campaign",
        "description": "This API enables the sending of WhatsApp campaigns using pre-approved templates that do not include body parameters (header image, textual placeholders, etc.).<br> Request body parameters includes a CSV or Excel file with the target audience.<br><br>**Note:** The file must include a column named **phone1**, where all phone numbers are formatted with the full country code (e.g., 442079832100 for the UK).<br><br>Must include an approved template with the proper WhatsApp language code.",
        "operationId": "send_campaigns",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience_file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The CSV or Excel file with the phone numbers.<br>Example:aud1.csv"
                  },
                  "notify_mail": {
                    "type": "string",
                    "description": "The email address of the agent receiving the confirmation"
                  },
                  "scheduled_date": {
                    "type": "string",
                    "format": "date-time",
                    "description": "(Optional) When left empty, campaign will be sent immediately. Use Unix format"
                  },
                  "expiration_data": {
                    "type": "string",
                    "format": "date-time",
                    "description": "(Optional) The campaign end date and time. Use Unix format"
                  },
                  "save_as_new_audience": {
                    "type": "boolean",
                    "example": true,
                    "description": "(Optional) When true, audience will be saved to the DB"
                  },
                  "template_name": {
                    "type": "string",
                    "description": "Template must be an approved template"
                  },
                  "language_code": {
                    "type": "string",
                    "description": "Must use WA language code that match the template's language.<br>For example:en_uk"
                  },
                  "campaign_name": {
                    "type": "string",
                    "description": "(Optional) Enter the title of the campaign"
                  },
                  "audience_id": {
                    "type": "string",
                    "description": "(Optional) Add the title of existing audience from the DB for sending the campaign"
                  },
                  "stream_id": {
                    "type": "string",
                    "description": "A CommBox generated number for the channel from which the campaign will be send"
                  },
                  "substream_id": {
                    "type": "string",
                    "description": "(Optional) A CommBox generated number for the subchannel"
                  },
                  "automation_script_id": {
                    "type": "string",
                    "description": "(Optional) Enter the script ID (flow) to which responding customers will be directed.<br>Navigate to Settings > Automation Flow module, and select the desired flow. The Id is listed under the flow's name after you select it"
                  },
                  "new_audience_name": {
                    "type": "string",
                    "description": "(Optional) Name of the audience in the uploaded file"
                  }
                },
                "example": {
                  "audience_file": "aud1.csv",
                  "notify_mail": "eddie.doe@commbox.io",
                  "scheduled_date": "2025-01-22T11:15:55Z",
                  "expiration_data": "2025-01-22T11:45:55",
                  "template_name": "end_of_year_sale",
                  "language_code": "en_uk",
                  "campaign_name": "Sales_campaign",
                  "audience_id": "NE_USA-above50",
                  "stream_id": "1558"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "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"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
````

