Home › Documentation › API Reference › Add CS AI Whitelist

Add CS AI Whitelist

Tambah atau update nomor ke dalam whitelist CS AI berdasarkan template. Kalau nomor sudah ada, data akan di-update (upsert) dan status otomatis di-set ke "active". Berguna untuk membatasi CS AI hanya merespon nomor tertentu saat fitur whitelist diaktifkan pada template.

POST https://api.alatwa.com/ai/whitelist/add/{protected_code}

Headers

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

Path Parameters

NameTypeDescription
protected_code string required Protected code (ID publik) dari AI template. Didapat dari endpoint List AI Settings.

Body Parameters

NameTypeDescription
phone string required Nomor WhatsApp yang akan di-whitelist
name string optional Nama customer (maks 100 karakter)
subdistrict string optional Kelurahan/desa (maks 100 karakter)
district string optional Kecamatan (maks 100 karakter)
latitude float optional Latitude lokasi customer
longitude float optional Longitude lokasi customer
metadata object optional Object key-value tambahan (mis. { "email": "...", "kode_pelanggan": "..." })

Try It

Path Parameters
Body Parameters

Code Examples

curl -X POST https://api.alatwa.com/ai/whitelist/add/YOUR_TEMPLATE_CODE \ -H "Authorization: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "phone": "628111111111", "name": "John Doe", "subdistrict": "Menteng", "district": "Menteng", "latitude": -6.1944, "longitude": 106.8229, "metadata": { "email": "[email protected]" } }'
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.alatwa.com/ai/whitelist/add/YOUR_TEMPLATE_CODE'); 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/ai/whitelist/add/YOUR_TEMPLATE_CODE', { method: 'POST', headers: { 'Authorization': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ "phone": "628111111111", "name": "John Doe", "subdistrict": "Menteng", "district": "Menteng", "latitude": -6.1944, "longitude": 106.8229, "metadata": { "email": "[email protected]" } }) });
import requests response = requests.post( 'https://api.alatwa.com/ai/whitelist/add/YOUR_TEMPLATE_CODE', headers={ 'Authorization': 'YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ "phone": "628111111111", "name": "John Doe", "subdistrict": "Menteng", "district": "Menteng", "latitude": -6.1944, "longitude": 106.8229, "metadata": { "email": "[email protected]" } } )

Response

200 Success
{ "status": "ok", "message": "Whitelist added", "action": "created" }

Response Fields

FieldTypeDescription
status string "ok" atau "error"
message string "Whitelist added" (baru) atau "Whitelist updated" (upsert)
action string "created" kalau insert baru, "updated" kalau upsert nomor existing
AI Reject Customer

Biar WhatsApp yang kerja, kamu fokus jualan

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

WhatsApp