curl --request POST \
--url https://crm.wachat.net/api/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_name": "<string>",
"device_id": "<string>",
"contacts": [
"<string>"
],
"template_id": 123,
"template_id_a": 123,
"template_id_b": 123,
"flow_id": 123,
"custom_message": "<string>",
"send_date": "2023-11-07T05:31:56Z",
"send_time": "<string>",
"timezone": "<string>",
"ab_testing": "<string>",
"ab_split": 50
}
'import requests
url = "https://crm.wachat.net/api/v1/campaigns"
payload = {
"campaign_name": "<string>",
"device_id": "<string>",
"contacts": ["<string>"],
"template_id": 123,
"template_id_a": 123,
"template_id_b": 123,
"flow_id": 123,
"custom_message": "<string>",
"send_date": "2023-11-07T05:31:56Z",
"send_time": "<string>",
"timezone": "<string>",
"ab_testing": "<string>",
"ab_split": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaign_name: '<string>',
device_id: '<string>',
contacts: ['<string>'],
template_id: 123,
template_id_a: 123,
template_id_b: 123,
flow_id: 123,
custom_message: '<string>',
send_date: '2023-11-07T05:31:56Z',
send_time: '<string>',
timezone: '<string>',
ab_testing: '<string>',
ab_split: 50
})
};
fetch('https://crm.wachat.net/api/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crm.wachat.net/api/v1/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'campaign_name' => '<string>',
'device_id' => '<string>',
'contacts' => [
'<string>'
],
'template_id' => 123,
'template_id_a' => 123,
'template_id_b' => 123,
'flow_id' => 123,
'custom_message' => '<string>',
'send_date' => '2023-11-07T05:31:56Z',
'send_time' => '<string>',
'timezone' => '<string>',
'ab_testing' => '<string>',
'ab_split' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crm.wachat.net/api/v1/campaigns"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crm.wachat.net/api/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm.wachat.net/api/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
],
"meta": "<string>"
}{
"error": {
"code": "plan_limit",
"message": "<string>",
"details": "<string>"
}
}{
"message": "<string>",
"errors": {}
}Create campaigns
Creates and dispatches a campaign to a defined recipient audience, immediately or on a schedule. Use campaigns for larger sends that need delivery metrics and lifecycle status.
curl --request POST \
--url https://crm.wachat.net/api/v1/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_name": "<string>",
"device_id": "<string>",
"contacts": [
"<string>"
],
"template_id": 123,
"template_id_a": 123,
"template_id_b": 123,
"flow_id": 123,
"custom_message": "<string>",
"send_date": "2023-11-07T05:31:56Z",
"send_time": "<string>",
"timezone": "<string>",
"ab_testing": "<string>",
"ab_split": 50
}
'import requests
url = "https://crm.wachat.net/api/v1/campaigns"
payload = {
"campaign_name": "<string>",
"device_id": "<string>",
"contacts": ["<string>"],
"template_id": 123,
"template_id_a": 123,
"template_id_b": 123,
"flow_id": 123,
"custom_message": "<string>",
"send_date": "2023-11-07T05:31:56Z",
"send_time": "<string>",
"timezone": "<string>",
"ab_testing": "<string>",
"ab_split": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
campaign_name: '<string>',
device_id: '<string>',
contacts: ['<string>'],
template_id: 123,
template_id_a: 123,
template_id_b: 123,
flow_id: 123,
custom_message: '<string>',
send_date: '2023-11-07T05:31:56Z',
send_time: '<string>',
timezone: '<string>',
ab_testing: '<string>',
ab_split: 50
})
};
fetch('https://crm.wachat.net/api/v1/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://crm.wachat.net/api/v1/campaigns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'campaign_name' => '<string>',
'device_id' => '<string>',
'contacts' => [
'<string>'
],
'template_id' => 123,
'template_id_a' => 123,
'template_id_b' => 123,
'flow_id' => 123,
'custom_message' => '<string>',
'send_date' => '2023-11-07T05:31:56Z',
'send_time' => '<string>',
'timezone' => '<string>',
'ab_testing' => '<string>',
'ab_split' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://crm.wachat.net/api/v1/campaigns"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://crm.wachat.net/api/v1/campaigns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://crm.wachat.net/api/v1/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"device_id\": \"<string>\",\n \"contacts\": [\n \"<string>\"\n ],\n \"template_id\": 123,\n \"template_id_a\": 123,\n \"template_id_b\": 123,\n \"flow_id\": 123,\n \"custom_message\": \"<string>\",\n \"send_date\": \"2023-11-07T05:31:56Z\",\n \"send_time\": \"<string>\",\n \"timezone\": \"<string>\",\n \"ab_testing\": \"<string>\",\n \"ab_split\": 50\n}"
response = http.request(request)
puts response.read_body{
"data": [
"<unknown>"
],
"meta": "<string>"
}{
"error": {
"code": "plan_limit",
"message": "<string>",
"details": "<string>"
}
}{
"message": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Create a campaign — a multi-recipient send (template, custom message or flow) with optional A/B testing. Scramble reads these rules to document the request body.
Mirrors the input keys the existing App\CampaignController::store accepts (campaign_name / device_id / campaign_type / schedule_type / template_id(s) / flow_id / custom_message / send_date+send_time / timezone / ab_* / contacts), exposed under public-facing names. Recipients are supplied as a list of phone numbers in international format.
Campaign label shown in the dashboard. Required.
255Sending device — the device's phone number or id. Required.
What the campaign sends. Required.
custom, template, flow When to send: now, later (needs send_date+send_time), or recurring. Required.
now, later, recurring Recipient phone numbers in international format. At least one required.
132WaTemplate id (required for non-A/B template campaigns).
A/B testing: the two competing WaTemplate ids.
Flow id (required for flow campaigns).
Free-text message body (required for custom campaigns).
4096Date to send on (Y-m-d) — required when schedule_type=later.
Time to send at (HH:MM) — required when schedule_type=later.
16IANA timezone for send_date/send_time. Defaults to UTC.
64Enable A/B testing (template campaigns only).
Percentage of recipients sent variant A (10-90). Defaults to 50.
10 <= x <= 90