Her webhook olayı için detaylı payload örnekleri ve açıklamaları
Bu sayfada, Wespoke webhook'larının gönderdiği tüm payload yapılarının detaylı örneklerini bulabilirsiniz. Her örnek, olayın tetiklenme koşullarını ve döndürülen verileri içerir.
Bir asistan araması başlatıldığında tetiklenir.
{
"event": "call.started",
"timestamp": "2025-10-08T12:34:56.789Z",
"data": {
"id": "call_abc123xyz",
"assistantId": "asst_def456uvw",
"assistantName": "Müşteri Destek Asistanı",
"phoneNumberId": "phone_ghi789rst",
"phoneNumber": "+905551234567",
"direction": "inbound",
"from": "+905559876543",
"to": "+905551234567",
"status": "in-progress",
"startedAt": "2025-10-08T12:34:56.789Z",
"metadata": {
"callerId": "customer_123",
"source": "mobile"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Bir asistan araması sonlandırıldığında tetiklenir.
{
"event": "call.ended",
"timestamp": "2025-10-08T12:38:23.456Z",
"data": {
"id": "call_abc123xyz",
"assistantId": "asst_def456uvw",
"assistantName": "Müşteri Destek Asistanı",
"phoneNumberId": "phone_ghi789rst",
"phoneNumber": "+905551234567",
"direction": "inbound",
"from": "+905559876543",
"to": "+905551234567",
"status": "completed",
"isSuccess": true,
"startedAt": "2025-10-08T12:34:56.789Z",
"endedAt": "2025-10-08T12:38:23.456Z",
"duration": 206,
"endReason": "customer-hangup",
"cost": {
"total": 0.85,
"currency": "USD",
"breakdown": {
"transcription": 0.15,
"llm": 0.35,
"tts": 0.25,
"livekit": 0.10
}
},
"summary": {
"totalMessages": 12,
"userMessages": 6,
"assistantMessages": 6,
"toolsExecuted": 2,
"interrupted": 1
},
"metadata": {
"callerId": "customer_123",
"source": "mobile"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Bir arama başarısız olduğunda tetiklenir.
{
"event": "call.failed",
"timestamp": "2025-10-08T12:35:30.123Z",
"data": {
"id": "call_xyz789abc",
"assistantId": "asst_def456uvw",
"assistantName": "Müşteri Destek Asistanı",
"phoneNumberId": "phone_ghi789rst",
"phoneNumber": "+905551234567",
"direction": "inbound",
"from": "+905559876543",
"to": "+905551234567",
"status": "failed",
"isSuccess": false,
"startedAt": "2025-10-08T12:35:10.000Z",
"endedAt": "2025-10-08T12:35:30.123Z",
"duration": 20,
"error": {
"code": "ASSISTANT_ERROR",
"message": "Assistant configuration error: Missing API key",
"details": {
"component": "llm",
"provider": "openrouter"
}
},
"metadata": {
"callerId": "customer_456",
"source": "web"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Bir araç başarıyla çalıştırıldığında tetiklenir.
{
"event": "tool.executed",
"timestamp": "2025-10-08T12:36:15.789Z",
"data": {
"id": "tool_exec_123xyz",
"callId": "call_abc123xyz",
"toolId": "tool_customer_lookup",
"toolName": "Müşteri Bilgisi Sorgula",
"toolType": "api_request",
"executedAt": "2025-10-08T12:36:15.789Z",
"duration": 234,
"input": {
"customerId": "customer_123",
"fields": ["name", "email", "orderHistory"]
},
"output": {
"success": true,
"data": {
"name": "Ahmet Yılmaz",
"email": "ahmet@example.com",
"orderHistory": [
{
"orderId": "order_789",
"date": "2025-09-15",
"total": 150.00
}
]
}
},
"status": "success"
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Bir araç çalıştırması başarısız olduğunda tetiklenir.
{
"event": "tool.failed",
"timestamp": "2025-10-08T12:37:45.234Z",
"data": {
"id": "tool_exec_456abc",
"callId": "call_abc123xyz",
"toolId": "tool_database_query",
"toolName": "Veritabanı Sorgula",
"toolType": "database_query",
"executedAt": "2025-10-08T12:37:45.000Z",
"duration": 234,
"input": {
"query": "SELECT * FROM customers WHERE id = ?",
"params": [999]
},
"error": {
"code": "DATABASE_ERROR",
"message": "Connection timeout",
"details": {
"timeout": 5000,
"host": "db.example.com"
}
},
"status": "failed"
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Bir asistan yapılandırması güncellendiğinde tetiklenir.
{
"event": "assistant.updated",
"timestamp": "2025-10-08T14:20:30.456Z",
"data": {
"id": "asst_def456uvw",
"name": "Müşteri Destek Asistanı",
"description": "7/24 müşteri destek hizmeti sunar",
"model": "gpt-4-turbo",
"voice": "elevenlabs-turkish-female",
"systemPrompt": "Sen yardımsever bir müşteri destek asistanısın...",
"tools": [
{
"id": "tool_customer_lookup",
"name": "Müşteri Bilgisi Sorgula",
"enabled": true
},
{
"id": "tool_create_ticket",
"name": "Destek Talebi Oluştur",
"enabled": true
}
],
"settings": {
"temperature": 0.7,
"maxDuration": 600,
"voicemail": {
"enabled": true,
"message": "Lütfen mesaj bırakın..."
}
},
"updatedAt": "2025-10-08T14:20:30.456Z",
"updatedBy": {
"userId": "user_789",
"email": "admin@example.com"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Kampanyadaki her bir arama sonlandığında tetiklenir. Gerçek zamanlı kampanya takibi için kullanılır.
{
"event": "campaign.call.update",
"timestamp": "2025-12-11T10:02:06.000Z",
"data": {
"campaignId": "cm1abc123xyz",
"campaignName": "Q4 Satış Kampanyası",
"contact": {
"id": "cc_def456uvw",
"phoneNumber": "+905551234567",
"name": "Ahmet Yılmaz",
"customData": {
"company": "Acme Ltd",
"department": "Satın Alma"
},
"status": "COMPLETED",
"attempts": 1
},
"call": {
"id": "call_ghi789rst",
"status": "completed",
"endReason": "hangup",
"duration": 125,
"cost": 0.42,
"startTime": "2025-12-11T10:00:00.000Z",
"endTime": "2025-12-11T10:02:05.000Z"
},
"progress": {
"totalContacts": 500,
"processedContacts": 151,
"pendingContacts": 344,
"callingContacts": 5,
"percentComplete": 30.2
},
"metadata": {
"assistantId": "asst_abc123",
"assistantName": "Satış Asistanı",
"phoneNumberId": "pn_xyz789",
"phoneNumber": "+905559876543"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}COMPLETED - Arama başarıyla tamamlandıFAILED - Arama başarısız olduNO_ANSWER - Cevap alınamadıBUSY - Hat meşgulVOICEMAIL - Sesli mesaja düştüBir kampanyadaki tüm kişiler işlendiğinde tetiklenir.
{
"event": "campaign.completed",
"timestamp": "2025-12-11T14:00:00.000Z",
"data": {
"campaignId": "cm1abc123xyz",
"campaignName": "Q4 Satış Kampanyası",
"status": "COMPLETED",
"completedAt": "2025-12-11T14:00:00.000Z",
"duration": 18000000,
"statistics": {
"totalContacts": 500,
"completed": 420,
"failed": 30,
"noAnswer": 25,
"busy": 15,
"voicemail": 10,
"successRate": 84.0,
"totalCalls": 530,
"totalAttempts": 580,
"averageAttempts": 1.16,
"totalDuration": 25200,
"totalCost": 126.50
},
"metadata": {
"assistantId": "asst_abc123",
"assistantName": "Satış Asistanı",
"phoneNumberId": "pn_xyz789",
"phoneNumber": "+905559876543"
}
},
"webhookId": "webhook_123abc",
"attemptNumber": 1
}Tüm webhook payload'ları aşağıdaki ortak alanları içerir:
eventWebhook olayının türü (örn: "call.started", "tool.executed")
timestampOlayın gerçekleştiği zaman (ISO 8601 formatında)
dataOlaya özgü veri nesnesi (her olay türü için farklıdır)
webhookIdWebhook yapılandırmasının benzersiz kimliği
attemptNumberBu webhook gönderimi için deneme numarası (1-5 arası)
Webhook endpoint'iniz aşağıdaki gereksinimleri karşılamalıdır:
HTTP/1.1 200 OK
Content-Type: application/json
{
"received": true
}Webhook entegrasyonunuzu test etmek için kontrol panelinde bulunan webhook test aracını kullanabilirsiniz. Bu araç, gerçek webhook payload'larını simüle eder ve endpoint'inizin doğru yanıt verdiğini doğrular.
Webhook Test Aracına Git