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",
"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",
"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
}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