Tüm API istekleri kimlik doğrulama gerektirir. Token'ınızı Ayarlar sayfasından alabilirsiniz.
API token'ınızı aşağıdaki üç yöntemden biriyle gönderebilirsiniz:
Authorization: Bearer YOUR_TOKEN
?token=YOUR_TOKEN
/api/instance/{instanceId}/... formatındadır. Instance ID'nizi Instance Yönetimi sayfasından öğrenebilirsiniz.
WhatsApp bağlantılarını (instance) oluşturma, listeleme, bağlama ve yönetme.
/api/instance
Tüm instance'ları listele
Tüm oluşturulmuş instance'ları ve bağlantı durumlarını döndürür.
{
"instances": ["default", "inst_a1b2c3d4"],
"statuses": {
"default": { "accountStatus": { "status": "open" } },
"inst_a1b2c3d4": { "accountStatus": { "status": "disconnected" } }
}
}/api/instance
Yeni instance oluştur
Yeni bir WhatsApp instance'ı oluşturur. ID belirtilmezse otomatik üretilir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | string | opsiyonel | Instance ID (boş bırakılırsa inst_xxxx üretilir) |
| description | string | opsiyonel | Instance açıklaması |
{ "description": "İş Hattı" }
{ "success": true, "instanceId": "inst_a1b2c3d4" }/api/instance/{instanceId}
Instance sil
Instance'ı ve tüm oturum verilerini kalıcı olarak siler.
{ "success": true }/api/instance/{instanceId}/status
Bağlantı durumu
Instance'ın WhatsApp bağlantı durumunu döndürür.
{
"accountStatus": { "status": "open" }
}open, connecting, disconnected/api/instance/{instanceId}/qr
QR kodu (JSON)
QR kodunu base64 data URI formatında döndürür. Zaten bağlıysa qrCode null döner.
{ "qrCode": "data:image/png;base64,iVBOR...", "status": "connecting" }/api/instance/{instanceId}/qrcode
QR kodu (PNG)
QR kodunu doğrudan PNG resim olarak döndürür. <img> etiketinde kullanılabilir.
image/png — QR yoksa JSON döner./api/instance/{instanceId}/me
Hesap bilgileri
Bağlı WhatsApp hesabının bilgilerini döndürür.
{ "id": "905xx:xx@s.whatsapp.net", "name": "Ahmet", "phone": "905xxxxxxxxx" }/api/instance/{instanceId}/connect
Bağlantıyı başlat
Instance'ın WhatsApp bağlantısını başlatır. Bağlantı başarılı olunca QR kodu üretilir.
{ "success": true }/api/instance/{instanceId}/restart
Yeniden başlat
WhatsApp bağlantısını kapatıp yeniden başlatır. İşlem arka planda gerçekleşir.
{ "success": true, "message": "Restarting..." }/api/instance/{instanceId}/logout
Oturumu kapat
WhatsApp oturumunu kapatır. Tekrar bağlanmak için yeni QR taraması gerekir.
{ "success": true }/api/instance/{instanceId}/clear
Mesajları temizle
Instance'a ait tüm mesaj geçmişini veritabanından siler.
{ "success": true }Metin, resim, dosya, ses, video, konum, kişi kartı, sticker, anket ve tepki gönderme. to alanı telefon numarası (+905xxxxxxxxx) veya grup ID'si (xxxxx@g.us) olabilir. Medya URL veya Base64 data URI destekler.
/api/instance/{instanceId}/messages/chatMetin mesajıMetin mesajı gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı telefon numarası veya grup ID |
| body | string | zorunlu | Mesaj metni |
{ "to": "+905xxxxxxxxx", "body": "Merhaba!" }{ "sent": true, "id": "BAQE..." }/api/instance/{instanceId}/messages/imageResim gönderResim gönderir. URL veya Base64 data URI destekler.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| image | string | zorunlu | Resim URL'i veya Base64 data URI |
| caption | string | opsiyonel | Resim altı açıklama |
{
"to": "+905xxxxxxxxx",
"image": "https://example.com/photo.jpg",
"caption": "Ürün görseli"
}{ "sent": true, "id": "BAQE..." }/api/instance/{instanceId}/messages/videoVideo gönderVideo gönderir. URL veya Base64 data URI destekler.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| video | string | zorunlu | Video URL'i veya Base64 data URI |
| caption | string | opsiyonel | Video açıklaması |
{
"to": "+905xxxxxxxxx",
"video": "https://example.com/video.mp4",
"caption": "Tanıtım videosu"
}{ "sent": true, "id": "BAQE..." }/api/instance/{instanceId}/messages/documentDosya gönderDosya/döküman gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| document | string | zorunlu | Dosya URL'i veya Base64 data URI |
| filename | string | opsiyonel | Dosya adı (varsayılan: "document") |
| caption | string | opsiyonel | Dosya açıklaması |
{ "to": "+905xxxxxxxxx", "document": "https://example.com/rapor.pdf", "filename": "rapor.pdf" }{ "sent": true, "id": "BAQE..." }/api/instance/{instanceId}/messages/audioSes dosyasıSes dosyası gönderir (müzik çalar olarak görünür).
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| audio | string | zorunlu | Ses URL'i veya Base64 data URI |
{ "to": "+905xxxxxxxxx", "audio": "https://example.com/audio.mp3" }/api/instance/{instanceId}/messages/voiceSesli mesaj (PTT)Push-to-talk sesli mesaj gönderir (yeşil dalga ikonu ile görünür).
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| audio | string | zorunlu | Ses URL'i veya Base64 (tercihen OGG Opus) |
{ "to": "+905xxxxxxxxx", "audio": "https://example.com/voice.ogg" }/messages/audio ile aradaki fark: voice mesaj PTT olarak gönderilir ve WhatsApp'ta yeşil mikrofon ikonu ile görünür./api/instance/{instanceId}/messages/stickerSticker gönderSticker gönderir. WebP formatı önerilir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| sticker | string | zorunlu | Sticker URL'i veya Base64 (WebP) |
{ "to": "+905xxxxxxxxx", "sticker": "https://example.com/sticker.webp" }/api/instance/{instanceId}/messages/locationKonum gönderHarita konumu gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| lat | number | zorunlu | Enlem |
| lng | number | zorunlu | Boylam |
| name | string | opsiyonel | Konum adı |
| address | string | opsiyonel | Adres metni |
{ "to": "+905xxxxxxxxx", "lat": 41.0082, "lng": 28.9784, "name": "İstanbul" }/api/instance/{instanceId}/messages/contactKişi kartıvCard formatında kişi kartı gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| contact_name | string | opsiyonel | Kişi adı (varsayılan: "Contact") |
| contact_phone | string | opsiyonel | Kişi telefon numarası |
{ "to": "+905xxxxxxxxx", "contact_name": "Ahmet", "contact_phone": "905xxxxxxxxx" }/api/instance/{instanceId}/messages/pollAnket gönderAnket (poll) gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Alıcı |
| name | string | zorunlu | Anket sorusu |
| values | string[] | zorunlu | Seçenekler (2-12 arası) |
| selectableCount | number | opsiyonel | 0 = çoklu, 1 = tekli seçim (varsayılan: 0) |
{ "to": "+905xxxxxxxxx", "name": "Toplantı?", "values": ["Pzt", "Çar", "Cum"], "selectableCount": 1 }/api/instance/{instanceId}/messages/reactionEmoji tepkisiBir mesaja emoji tepkisi gönderir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Sohbet ID'si |
| msgId | string | zorunlu | Mesaj ID'si |
| emoji | string | zorunlu | Emoji karakteri |
{ "to": "+905xxxxxxxxx", "msgId": "BAQE...", "emoji": "\ud83d\udc4d" }/api/instance/{instanceId}/messages/deleteMesaj silGönderilmiş mesajı herkesten siler.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| to | string | zorunlu | Sohbet ID'si |
| msgId | string | zorunlu | Silinecek mesaj ID'si |
{ "deleted": true }/api/instance/{instanceId}/messagesMesaj geçmişiMesaj geçmişini sayfalanmış olarak getirir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| limit | number | opsiyonel | Sayfa başına mesaj (varsayılan: 100) |
| page | number | opsiyonel | Sayfa numarası (varsayılan: 1) |
| status | string | opsiyonel | Filtre: sent, received, pending, failed, delivered, read |
| chatId | string | opsiyonel | Sohbet ID'sine göre filtrele |
/api/instance/{instanceId}/messages/statisticsİstatistiklerMesaj istatistiklerini döndürür.
{ "total": 1250, "sent": 480, "received": 720, "pending": 5, "delivered": 460, "failed": 10 }/api/instance/{instanceId}/messages/clearGeçmişi temizleVeritabanındaki tüm mesaj geçmişini siler.
{ "success": true }Aktif sohbetleri listeleme, mesajlarını getirme ve yönetme.
/api/instance/{instanceId}/chatsSohbetleri listeleTüm aktif sohbetleri döndürür.
[{ "id": "905xx@s.whatsapp.net", "name": "Ahmet", "unreadCount": 3, "lastMessage": 1711100000, "archived": false }]/api/instance/{instanceId}/chats/idsSohbet ID'leriSadece sohbet ID'lerini döndürür.
["905xx@s.whatsapp.net", "120363xx@g.us"]/api/instance/{instanceId}/chats/messagesSohbet mesajlarıBelirli bir sohbetin mesajlarını getirir.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| chatId | string | zorunlu | Sohbet ID'si |
| limit | number | opsiyonel | (varsayılan: 50) |
/api/instance/{instanceId}/chats/readOkundu işaretleSohbeti okundu olarak işaretler.
{ "chatId": "905xx@s.whatsapp.net" }/api/instance/{instanceId}/chats/archiveArşivle{ "chatId": "905xx@s.whatsapp.net" }/api/instance/{instanceId}/chats/unarchiveArşivden çıkar{ "chatId": "905xx@s.whatsapp.net" }/api/instance/{instanceId}/chats/deleteSohbet sil{ "chatId": "905xx@s.whatsapp.net" }Kişi listesi, numara sorgulama, profil fotoğrafı ve engelleme işlemleri.
/api/instance/{instanceId}/contactsKişileri listele[{ "id": "905xx@s.whatsapp.net", "name": "Ahmet Yılmaz", "notify": "Ahmet" }]/api/instance/{instanceId}/contacts/idsKişi ID'leri["905xx@s.whatsapp.net", "905yy@s.whatsapp.net"]/api/instance/{instanceId}/contacts/contactKişi detayıBelirli bir kişinin bilgilerini döndürür.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| chatId | string | zorunlu | Kişi ID'si (ör: 905xxxxxxxxx) |
{ "id": "905xx@s.whatsapp.net", "name": "Ahmet", "notify": "Ahmet" }/api/instance/{instanceId}/contacts/checkNumara sorgulaNumaranın WhatsApp'ta kayıtlı olup olmadığını kontrol eder.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| chatId | string | zorunlu | Kontrol edilecek numara |
{ "exists": true, "jid": "905xx@s.whatsapp.net" }/api/instance/{instanceId}/contacts/imageProfil fotoğrafı| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| chatId | string | zorunlu | Kişi ID'si |
{ "url": "https://pps.whatsapp.net/..." }/api/instance/{instanceId}/contacts/blockEngelle{ "chatId": "905xxxxxxxxx" }{ "success": true }/api/instance/{instanceId}/contacts/unblockEngeli kaldır{ "chatId": "905xxxxxxxxx" }{ "success": true }Grup listesi, detayları ve katılımcı bilgileri.
/api/instance/{instanceId}/groupsGrupları listele[{ "id": "120363xx@g.us", "name": "Ekip", "participants": 12, "creation": 1700000000, "desc": "..." }]/api/instance/{instanceId}/groups/idsGrup ID'leri["120363xx@g.us", "120363yy@g.us"]/api/instance/{instanceId}/groups/groupGrup detayı| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| groupId | string | zorunlu | Grup ID'si |
{ "id": "120363xx@g.us", "name": "Ekip", "description": "...", "participants": [{ "id": "905xx@s.whatsapp.net", "admin": "admin" }], "owner": "905xx@s.whatsapp.net" }Dosya yükleme, listeleme ve silme. Yüklenen dosyalar mesaj gönderiminde kullanılabilir (maks. 64MB).
/api/instance/{instanceId}/media/uploadDosya yüklemultipart/form-data formatında dosya yükler.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| file | File | zorunlu | Yüklenecek dosya (maks. 64MB) |
curl -X POST -H "Authorization: Bearer TOKEN" -F "file=@photo.jpg" /api/instance/default/media/upload{ "success": true, "file": { "filename": "171...-123.jpg", "originalname": "photo.jpg", "mimetype": "image/jpeg", "size": 245000, "url": "https://domain.com/media/default/171...-123.jpg" } }url değerini mesaj gönderme endpoint'lerinde medya kaynağı olarak kullanabilirsiniz./api/instance/{instanceId}/media/listDosyaları listele[{ "filename": "171...-123.jpg", "size": 245000, "url": "...", "created": "2026-03-22T10:00:00.000Z" }]/api/instance/{instanceId}/media/deleteDosya sil| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| filename | string | zorunlu | Silinecek dosya adı |
{ "success": true, "deleted": "171...-123.jpg" }Gelen mesajlara otomatik yanıt kuralları. Kurallar öncelik sırasına göre (priority, düşük = önce) işlenir.
/api/instance/{instanceId}/chatbot/rulesKuralları listele{ "rules": [{ "id": 1, "match_type": "contains", "trigger_text": "fiyat", "response": "...", "delay": 2, "enabled": 1, "priority": 0 }], "enabled": true }/api/instance/{instanceId}/chatbot/rulesKural oluştur/güncelleid verilirse günceller, boş bırakılırsa yeni kural oluşturur.
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| id | number | opsiyonel | Güncellenecek kural ID |
| match_type | string | opsiyonel | exact, contains, startswith, regex (varsayılan: "exact") |
| trigger_text | string | zorunlu | Tetikleyici metin |
| response | string | zorunlu | Otomatik yanıt |
| delay | number | opsiyonel | Gecikme (sn) (varsayılan: 1) |
| enabled | boolean | opsiyonel | (varsayılan: true) |
| priority | number | opsiyonel | Öncelik (varsayılan: 0) |
{name}, {phone}, {time}/api/instance/{instanceId}/chatbot/rules/{id}Kural sil{ "success": true }/api/instance/{instanceId}/chatbot/toggleChatbot aç/kapat{ "enabled": true }{ "success": true, "enabled": true }Birden fazla alıcıya aynı mesajı gecikmeyle gönderin. İşlem arka planda çalışır.
/api/instance/{instanceId}/bulkToplu mesaj başlat| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| recipients | array | zorunlu | Alıcı dizisi: [{ "id": "905xx", "name": "Ali" }] |
| messageType | string | opsiyonel | text, image, document (varsayılan: "text") |
| body | string | koşullu | Mesaj metni (body veya mediaUrl'den biri zorunlu) |
| mediaUrl | string | koşullu | Medya URL'i |
| delay | number | opsiyonel | Gönderimler arası bekleme (sn) (varsayılan: 3) |
{ "success": true, "jobId": 1 }/api/instance/{instanceId}/bulkİşleri listele| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| limit | number | opsiyonel | (varsayılan: 20) |
| page | number | opsiyonel | (varsayılan: 1) |
/api/instance/{instanceId}/bulk/{jobId}İş detayıİş detayını ve alıcı bazlı durumları döndürür.
/api/instance/{instanceId}/bulk/{jobId}/cancelİptal et{ "success": true }İleri tarihli mesajlar zamanlayın. Sistem her 30 saniyede zamanı gelen mesajları otomatik gönderir.
/api/instance/{instanceId}/scheduledZamanlı mesaj oluştur| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| recipient | string | zorunlu | Alıcı |
| recipientName | string | opsiyonel | Alıcı adı |
| messageType | string | opsiyonel | text, image, document (varsayılan: "text") |
| body | string | koşullu | Mesaj metni |
| mediaUrl | string | koşullu | Medya URL'i |
| filename | string | opsiyonel | Dosya adı |
| scheduledAt | string | zorunlu | ISO 8601 tarih (gelecekte) |
{ "success": true, "id": 1 }/api/instance/{instanceId}/scheduledListele| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| limit | number | opsiyonel | (varsayılan: 50) |
| page | number | opsiyonel | (varsayılan: 1) |
| status | string | opsiyonel | pending, sent, failed |
/api/instance/{instanceId}/scheduled/{id}İptal etSadece pending durumundaki mesajlar iptal edilebilir.
{ "success": true }Instance bazlı webhook ve gönderim ayarları.
/api/instance/{instanceId}/settingsAyarları al{ "webhookUrl": "https://...", "webhookEnabled": "true", "sendDelay": "0" }/api/instance/{instanceId}/settingsAyarları güncelle| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
| webhookUrl | string | opsiyonel | Webhook URL'i |
| webhookEnabled | boolean | opsiyonel | Webhook aktif/pasif |
| sendDelay | number | opsiyonel | Mesajlar arası gecikme (ms) |
{ "success": true }Webhook URL tanımlarsanız, aşağıdaki olaylar HTTP POST olarak gönderilir. Zaman aşımı: 10 saniye.
{ "event": "...", "data": {...}, "timestamp": 171..., "instance_id": "default" }message_receivedYeni mesaj geldiğinde{ "event": "message_received", "data": { "id": "BAQE...", "from": "905xx@s.whatsapp.net", "to": "905yy@s.whatsapp.net", "body": "Merhaba", "type": "chat", "timestamp": 1711100000, "fromMe": false, "chatId": "905xx@s.whatsapp.net" }, "timestamp": 1711100000, "instance_id": "default" }message_ackMesaj durumu değiştiğinde{ "event": "message_ack", "data": { "id": "BAQE...", "chatId": "905xx@s.whatsapp.net", "status": "read", "fromMe": true }, "timestamp": 1711100000, "instance_id": "default" }connection_statusBağlantı durumu değiştiğinde{ "event": "connection_status", "data": { "status": "connected", "account": { "id": "905xx@s.whatsapp.net", "name": "Ahmet", "phone": "905xxxxxxxxx" } }, "timestamp": 1711100000, "instance_id": "default" }pending → sent → delivered → read → playedTüm hatalar { "error": "Hata mesajı" } formatında döner.
| Kod | Durum | Açıklama |
|---|---|---|
| 400 | Bad Request | Eksik veya geçersiz parametre |
| 401 | Unauthorized | Geçersiz veya eksik API token |
| 404 | Not Found | Instance veya kaynak bulunamadı |
| 409 | Conflict | Kaynak zaten mevcut |
| 429 | Too Many Requests | Rate limit aşıldı (200 istek/dk) |
| 500 | Server Error | Sunucu hatası |