curl --request POST \
--url https://api.watx.in/v1/broadcasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "September offer",
"template_name": "september_offer",
"template_language": "en_US",
"recipients": [
{
"to": "+919876543210",
"params": [
"Priya"
]
},
{
"to": "+919876543211",
"params": [
"Arun"
]
}
]
}
'import requests
url = "https://api.watx.in/v1/broadcasts"
payload = {
"name": "September offer",
"template_name": "september_offer",
"template_language": "en_US",
"recipients": [
{
"to": "+919876543210",
"params": ["Priya"]
},
{
"to": "+919876543211",
"params": ["Arun"]
}
]
}
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({
name: 'September offer',
template_name: 'september_offer',
template_language: 'en_US',
recipients: [
{to: '+919876543210', params: ['Priya']},
{to: '+919876543211', params: ['Arun']}
]
})
};
fetch('https://api.watx.in/v1/broadcasts', 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://api.watx.in/v1/broadcasts",
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([
'name' => 'September offer',
'template_name' => 'september_offer',
'template_language' => 'en_US',
'recipients' => [
[
'to' => '+919876543210',
'params' => [
'Priya'
]
],
[
'to' => '+919876543211',
'params' => [
'Arun'
]
]
]
]),
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://api.watx.in/v1/broadcasts"
payload := strings.NewReader("{\n \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\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://api.watx.in/v1/broadcasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.watx.in/v1/broadcasts")
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 \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"broadcast_id": "4f8e2c10-77b9-4d3a-9e12-5a6b7c8d9e0f",
"status": "queued",
"total_recipients": 2,
"accepted": 2,
"rejected": 0
}
}{
"error": {
"code": "bad_request",
"message": "A broadcast is capped at 1000 recipients per request; split larger sends"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key"
}
}{
"error": {
"code": "bad_request",
"message": "'phone' is required"
}
}{
"error": {
"code": "forbidden",
"message": "This API key is missing the 'messages:send' scope"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for this API key"
}
}Launch a broadcast
Queues a template broadcast to a list of phone numbers. Every recipient
is written to the database and handed to the send queue before the call
returns, so the 202 survives a restart. Poll
GET /broadcasts/{id} for progress.
Recipients are capped at 1000 per request. A number that is not a
valid phone number is dropped and counted in rejected. A contact who
has opted out of marketing is dropped silently and is not counted in
accepted. Duplicates of the same contact are collapsed.
Requires the broadcasts:send scope.
curl --request POST \
--url https://api.watx.in/v1/broadcasts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "September offer",
"template_name": "september_offer",
"template_language": "en_US",
"recipients": [
{
"to": "+919876543210",
"params": [
"Priya"
]
},
{
"to": "+919876543211",
"params": [
"Arun"
]
}
]
}
'import requests
url = "https://api.watx.in/v1/broadcasts"
payload = {
"name": "September offer",
"template_name": "september_offer",
"template_language": "en_US",
"recipients": [
{
"to": "+919876543210",
"params": ["Priya"]
},
{
"to": "+919876543211",
"params": ["Arun"]
}
]
}
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({
name: 'September offer',
template_name: 'september_offer',
template_language: 'en_US',
recipients: [
{to: '+919876543210', params: ['Priya']},
{to: '+919876543211', params: ['Arun']}
]
})
};
fetch('https://api.watx.in/v1/broadcasts', 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://api.watx.in/v1/broadcasts",
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([
'name' => 'September offer',
'template_name' => 'september_offer',
'template_language' => 'en_US',
'recipients' => [
[
'to' => '+919876543210',
'params' => [
'Priya'
]
],
[
'to' => '+919876543211',
'params' => [
'Arun'
]
]
]
]),
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://api.watx.in/v1/broadcasts"
payload := strings.NewReader("{\n \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\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://api.watx.in/v1/broadcasts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.watx.in/v1/broadcasts")
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 \"name\": \"September offer\",\n \"template_name\": \"september_offer\",\n \"template_language\": \"en_US\",\n \"recipients\": [\n {\n \"to\": \"+919876543210\",\n \"params\": [\n \"Priya\"\n ]\n },\n {\n \"to\": \"+919876543211\",\n \"params\": [\n \"Arun\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"broadcast_id": "4f8e2c10-77b9-4d3a-9e12-5a6b7c8d9e0f",
"status": "queued",
"total_recipients": 2,
"accepted": 2,
"rejected": 0
}
}{
"error": {
"code": "bad_request",
"message": "A broadcast is capped at 1000 recipients per request; split larger sends"
}
}{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key"
}
}{
"error": {
"code": "bad_request",
"message": "'phone' is required"
}
}{
"error": {
"code": "forbidden",
"message": "This API key is missing the 'messages:send' scope"
}
}{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded for this API key"
}
}Authorizations
Your workspace API key, created in Settings → API keys, sent as
Authorization: Bearer <key>. New keys start with watx_live_; keys
issued before the rename start with converse360_live_ and still work.
Body
Response
The broadcast was accepted and queued.
Show child attributes
Show child attributes