curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 45,
"recipient_phone": "+1234567890",
"recipient_name": "John Doe",
"variables": {
"1": "John",
"2": "January 15, 2026",
"3": "2:00 PM"
}
}'
curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 46,
"recipient_phone": "+1234567890"
}'
const response = await fetch(
'https://app.whattalk.ai/api/user/whatsapp/send',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sender_id: 12,
template_id: 45,
recipient_phone: '+1234567890',
recipient_name: 'John Doe',
variables: {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://app.whattalk.ai/api/user/whatsapp/send',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'sender_id': 12,
'template_id': 45,
'recipient_phone': '+1234567890',
'recipient_name': 'John Doe',
'variables': {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
}
)
print(response.json())
{
"success": true,
"conversation_id": 1234,
"message_id": 567,
"whatsapp_message_id": 890,
"message_sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "queued"
}
{
"success": false,
"error": "Insufficient balance. Please top up your account.",
"error_code": "INSUFFICIENT_BALANCE"
}
{
"success": false,
"error": "Sender not found or does not belong to you",
"error_code": "SENDER_NOT_FOUND"
}
{
"success": false,
"error": "Template not found or does not belong to this sender",
"error_code": "TEMPLATE_NOT_FOUND"
}
{
"success": false,
"error": "Template is not approved. Current status: pending",
"error_code": "TEMPLATE_NOT_APPROVED"
}
{
"success": false,
"error": "Invalid phone number format. Use E.164 format (e.g., +14155551234).",
"error_code": "INVALID_PHONE"
}
{
"success": false,
"error": "Sender is not online. Current status: Offline",
"error_code": "SENDER_OFFLINE"
}
WhatsApp
Şablon Mesajı Gönder
Onaylanmış bir şablon kullanarak WhatsApp mesajı gönderin
POST
/
user
/
whatsapp
/
send
curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 45,
"recipient_phone": "+1234567890",
"recipient_name": "John Doe",
"variables": {
"1": "John",
"2": "January 15, 2026",
"3": "2:00 PM"
}
}'
curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 46,
"recipient_phone": "+1234567890"
}'
const response = await fetch(
'https://app.whattalk.ai/api/user/whatsapp/send',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sender_id: 12,
template_id: 45,
recipient_phone: '+1234567890',
recipient_name: 'John Doe',
variables: {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://app.whattalk.ai/api/user/whatsapp/send',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'sender_id': 12,
'template_id': 45,
'recipient_phone': '+1234567890',
'recipient_name': 'John Doe',
'variables': {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
}
)
print(response.json())
{
"success": true,
"conversation_id": 1234,
"message_id": 567,
"whatsapp_message_id": 890,
"message_sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "queued"
}
{
"success": false,
"error": "Insufficient balance. Please top up your account.",
"error_code": "INSUFFICIENT_BALANCE"
}
{
"success": false,
"error": "Sender not found or does not belong to you",
"error_code": "SENDER_NOT_FOUND"
}
{
"success": false,
"error": "Template not found or does not belong to this sender",
"error_code": "TEMPLATE_NOT_FOUND"
}
{
"success": false,
"error": "Template is not approved. Current status: pending",
"error_code": "TEMPLATE_NOT_APPROVED"
}
{
"success": false,
"error": "Invalid phone number format. Use E.164 format (e.g., +14155551234).",
"error_code": "INVALID_PHONE"
}
{
"success": false,
"error": "Sender is not online. Current status: Offline",
"error_code": "SENDER_OFFLINE"
}
Bu endpoint, önceden onaylanmış bir şablon kullanarak WhatsApp mesajı gönderir. Şablon mesajları, bir kullanıcıyla ilk kez konuşma başlatırken veya 24 saatlik mesajlaşma penceresi dışında mesaj gönderirken gereklidir.
Bu endpoint, kullanıcı başına saniyede 5 istek ile hız sınırlıdır.
İstek Gövdesi
integer
gerekli
Mesajın gönderileceği WhatsApp göndereninin kimliği (Gönderenleri Getir endpoint’inden elde edilir)
integer
gerekli
Kullanılacak mesaj şablonunun kimliği (Şablonları Getir endpoint’inden elde edilir)
string
gerekli
Alıcının uluslararası formattaki telefon numarası (ör.
+1234567890)string
Alıcının adı, maksimum 255 karakter (konuşma takibi ve CRM amaçları için kullanılır)
object
Şablon değişkenleri için anahtar-değer çiftleri. Anahtarlar şablondaki değişken adlarıyla eşleşmelidir. Şablonda
{{1}}, {{2}} vb. değişkenler varsa, bunları {"1": "değer1", "2": "değer2"} olarak veya şablonun variables dizisindeki adlandırılmış anahtarları kullanarak sağlayın.Yanıt Alanları
boolean
Mesajın başarıyla gönderilip gönderilmediği
integer
Bu mesajla ilişkili konuşma kimliği (yeni veya mevcut)
integer
Konuşma mesajı kaydının kimliği
integer
WhatsApp mesaj kaydının kimliği
string
Teslimat takibi için Twilio mesaj SID’i
string
İlk mesaj teslim durumu (ör.
queued, sent)Hata Yanıtları
curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 45,
"recipient_phone": "+1234567890",
"recipient_name": "John Doe",
"variables": {
"1": "John",
"2": "January 15, 2026",
"3": "2:00 PM"
}
}'
curl -X POST "https://app.whattalk.ai/api/user/whatsapp/send" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sender_id": 12,
"template_id": 46,
"recipient_phone": "+1234567890"
}'
const response = await fetch(
'https://app.whattalk.ai/api/user/whatsapp/send',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sender_id: 12,
template_id: 45,
recipient_phone: '+1234567890',
recipient_name: 'John Doe',
variables: {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
})
}
);
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://app.whattalk.ai/api/user/whatsapp/send',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'sender_id': 12,
'template_id': 45,
'recipient_phone': '+1234567890',
'recipient_name': 'John Doe',
'variables': {
'1': 'John',
'2': 'January 15, 2026',
'3': '2:00 PM'
}
}
)
print(response.json())
{
"success": true,
"conversation_id": 1234,
"message_id": 567,
"whatsapp_message_id": 890,
"message_sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"status": "queued"
}
{
"success": false,
"error": "Insufficient balance. Please top up your account.",
"error_code": "INSUFFICIENT_BALANCE"
}
{
"success": false,
"error": "Sender not found or does not belong to you",
"error_code": "SENDER_NOT_FOUND"
}
{
"success": false,
"error": "Template not found or does not belong to this sender",
"error_code": "TEMPLATE_NOT_FOUND"
}
{
"success": false,
"error": "Template is not approved. Current status: pending",
"error_code": "TEMPLATE_NOT_APPROVED"
}
{
"success": false,
"error": "Invalid phone number format. Use E.164 format (e.g., +14155551234).",
"error_code": "INVALID_PHONE"
}
{
"success": false,
"error": "Sender is not online. Current status: Offline",
"error_code": "SENDER_OFFLINE"
}
Notlar
- Şablon mesajları onaylanmış şablonları kullanmalıdır.
pendingveyarejecteddurumundaki şablonlar başarısız olur. - Gönderen
onlineolmalıdır. Çevrimdışı gönderenler mesaj gönderemez. - Mesaj maliyetleri otomatik olarak hesap bakiyenizden düşülür (kiracı kullanıcılar için kredi, doğrudan kullanıcılar için dakika).
- Bir şablon mesajı gönderdikten sonra 24 saatlik mesajlaşma penceresi açılır. Bu pencere süresince şablon gerektirmeden serbest form mesajlar gönderebilirsiniz.
- Alıcıyla zaten bir konuşma mevcutsa, mesaj mevcut konuşmaya eklenir.
- Hız limiti: Kullanıcı başına saniyede 5 istek.

