Home › Documentation › API Reference › Create Broadcast v1

Create Broadcast v1

Versi v1 endpoint create broadcast — superset dari /broadcast/create. Auto-detect mode berdasarkan ada/tidaknya field template_id. Mode Inline (tanpa template_id): pesan ditulis langsung di receiver[].message, sama persis seperti /broadcast/create legacy. Mode Template (dengan template_id): pakai template yang sudah disimpan di dashboard, server otomatis substitute placeholder {{name}} dan {{opt1}}-{{opt7}}, plus eval spintax {a|b|c} per recipient.

POST https://api.alatwa.com/v1/broadcast/create

Headers

NameTypeDescription
Authorization string required API Key akun Alat WA Anda
Content-Type string required application/json

Body Parameters

NameTypeDescription
device string | array required Device ID dari menu Device. Boleh single string ("device_a") atau array (["device_a", "device_b"]) - kalau array, executor akan rotasi acak per pesan dengan smart picker (anti-burst + balanced) supaya tidak banyak kirim dari device yang sama berturut. Pakai "default" untuk device pertama.
title string required Nama broadcast (muncul di dashboard).
date_execute string required Waktu mulai eksekusi, format Y-m-d H:i:s (contoh: 2026-04-30 09:00:00). Wajib diisi.
active_start string optional Jam mulai aktif (H:i:s). Default: 00:00:00.
active_end string optional Jam berhenti (H:i:s). Default: 23:59:59.
interval_from integer optional Jeda min antar pesan (detik). Default: 5.
interval_to integer optional Jeda max antar pesan (detik). Default: 15.
generate_receiver string optional "yes" = format nomor otomatis ke 62.... Default: no.
template_id string | array optional Template Code (32-char opaque hash) dari menu Template Pesan, kolom Template Code. Jika diisi maka aktifkan MODE TEMPLATE. Boleh single string atau array ["code_a", "code_b", "code_c"] - kalau array, server random pick salah satu PER recipient supaya pesan ber-variasi (anti-banned). Semua template code harus milik akun yang sama.
type string optional [MODE INLINE] "text" atau "media". Default: text.
media_base64 string optional [MODE INLINE] Wajib jika type=media. File gambar/video/PDF dalam Base64.
receiver array required Array penerima. Format berbeda per mode. MODE INLINE: {phone, message} per row, pesan ditulis langsung. MODE TEMPLATE: {phone, name, opt1..opt7} per row, placeholder di template di-substitute otomatis.

Try It

Body Parameters

Code Examples

curl -X POST https://api.alatwa.com/v1/broadcast/create \ -H "Authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "device": [ "DEVICE_A", "DEVICE_B" ], "title": "Reminder Servis Berkala", "template_id": [ "6e6dbb17cb83f84d06e6dca9cf7ce02f", "081858762d72d9b98c2bf1e115d2ef6b" ], "date_execute": "2026-04-30 09:00:00", "interval_from": 5, "interval_to": 15, "generate_receiver": "yes", "receiver": [ { "phone": "08123456789", "name": "Budi", "opt1": "Vario 160", "opt2": "AHASS Cibubur", "opt3": "30 April 2026" }, { "phone": "08987654321", "name": "Sari", "opt1": "PCX 160", "opt2": "AHASS Bekasi", "opt3": "01 Mei 2026" } ] }'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.alatwa.com/v1/broadcast/create'); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Authorization: YOUR_API_KEY', 'Content-Type: application/json' ]); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch);
const response = await fetch('https://api.alatwa.com/v1/broadcast/create', { method: 'POST', headers: { 'Authorization': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ "device": [ "DEVICE_A", "DEVICE_B" ], "title": "Reminder Servis Berkala", "template_id": [ "6e6dbb17cb83f84d06e6dca9cf7ce02f", "081858762d72d9b98c2bf1e115d2ef6b" ], "date_execute": "2026-04-30 09:00:00", "interval_from": 5, "interval_to": 15, "generate_receiver": "yes", "receiver": [ { "phone": "08123456789", "name": "Budi", "opt1": "Vario 160", "opt2": "AHASS Cibubur", "opt3": "30 April 2026" }, { "phone": "08987654321", "name": "Sari", "opt1": "PCX 160", "opt2": "AHASS Bekasi", "opt3": "01 Mei 2026" } ] }) });
import requests response = requests.post( 'https://api.alatwa.com/v1/broadcast/create', headers={ 'Authorization': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ "device": [ "DEVICE_A", "DEVICE_B" ], "title": "Reminder Servis Berkala", "template_id": [ "6e6dbb17cb83f84d06e6dca9cf7ce02f", "081858762d72d9b98c2bf1e115d2ef6b" ], "date_execute": "2026-04-30 09:00:00", "interval_from": 5, "interval_to": 15, "generate_receiver": "yes", "receiver": [ { "phone": "08123456789", "name": "Budi", "opt1": "Vario 160", "opt2": "AHASS Cibubur", "opt3": "30 April 2026" }, { "phone": "08987654321", "name": "Sari", "opt1": "PCX 160", "opt2": "AHASS Bekasi", "opt3": "01 Mei 2026" } ] } )

Response

200 Success
{ "status": "ok", "message": "Broadcast successfully created", "id": "9a2c8b7d3e1f5a6c8d9e2f1b3a4c5d6e", "total_inserted": 2, "total_skipped": 0 }

Response Fields

FieldTypeDescription
status string "ok" jika sukses.
message string Pesan status.
id string Broadcast ID untuk cek status (lihat endpoint Broadcast Status).
total_inserted integer Jumlah recipient yang berhasil di-queue.
total_skipped integer Jumlah recipient yang dilewati (phone/message kosong).
Create Broadcast Broadcast Status

Biar WhatsApp yang kerja, kamu fokus jualan

Tanpa server, tanpa coding. Daftar, scan QR WhatsApp, dan auto reply pertamamu bisa langsung jalan.

WhatsApp