Webhook Payload Örnekleri

Her webhook olayı için detaylı payload örnekleri ve açıklamaları

Genel Bakış

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.

call.started

Bir asistan araması başlatıldığında tetiklenir.

call.started Payload
{
  "event": "call.started",
  "timestamp": "2025-10-08T12:34:56.789Z",
  "data": {
    "id": "call_abc123xyz",
    "assistantId": "asst_def456uvw",
    "assistantName": "Customer Support Assistant",
    "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
}

call.ended

Bir asistan araması sonlandırıldığında tetiklenir.

call.ended Payload
{
  "event": "call.ended",
  "timestamp": "2025-10-08T12:38:23.456Z",
  "data": {
    "id": "call_abc123xyz",
    "assistantId": "asst_def456uvw",
    "assistantName": "Customer Support Assistant",
    "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
}

call.failed

Bir arama başarısız olduğunda tetiklenir.

call.failed Payload
{
  "event": "call.failed",
  "timestamp": "2025-10-08T12:35:30.123Z",
  "data": {
    "id": "call_xyz789abc",
    "assistantId": "asst_def456uvw",
    "assistantName": "Customer Support Assistant",
    "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
}

tool.executed

Bir araç başarıyla çalıştırıldığında tetiklenir.

tool.executed Payload
{
  "event": "tool.executed",
  "timestamp": "2025-10-08T12:36:15.789Z",
  "data": {
    "id": "tool_exec_123xyz",
    "callId": "call_abc123xyz",
    "toolId": "tool_customer_lookup",
    "toolName": "Query Customer Info",
    "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": "John Smith",
        "email": "ahmet@example.com",
        "orderHistory": [
          {
            "orderId": "order_789",
            "date": "2025-09-15",
            "total": 150.00
          }
        ]
      }
    },
    "status": "success"
  },
  "webhookId": "webhook_123abc",
  "attemptNumber": 1
}

tool.failed

Bir araç çalıştırması başarısız olduğunda tetiklenir.

tool.failed Payload
{
  "event": "tool.failed",
  "timestamp": "2025-10-08T12:37:45.234Z",
  "data": {
    "id": "tool_exec_456abc",
    "callId": "call_abc123xyz",
    "toolId": "tool_database_query",
    "toolName": "Database Query",
    "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
}

assistant.updated

Bir asistan yapılandırması güncellendiğinde tetiklenir.

assistant.updated Payload
{
  "event": "assistant.updated",
  "timestamp": "2025-10-08T14:20:30.456Z",
  "data": {
    "id": "asst_def456uvw",
    "name": "Customer Support Assistant",
    "description": "Provides 24/7 customer support service",
    "model": "gpt-4-turbo",
    "voice": "elevenlabs-turkish-female",
    "systemPrompt": "You are a helpful customer support assistant...",
    "tools": [
      {
        "id": "tool_customer_lookup",
        "name": "Query Customer Info",
        "enabled": true
      },
      {
        "id": "tool_create_ticket",
        "name": "Create Support Ticket",
        "enabled": true
      }
    ],
    "settings": {
      "temperature": 0.7,
      "maxDuration": 600,
      "voicemail": {
        "enabled": true,
        "message": "Please leave a message..."
      }
    },
    "updatedAt": "2025-10-08T14:20:30.456Z",
    "updatedBy": {
      "userId": "user_789",
      "email": "admin@example.com"
    }
  },
  "webhookId": "webhook_123abc",
  "attemptNumber": 1
}

campaign.call.update

Kampanyadaki her bir arama sonlandığında tetiklenir. Gerçek zamanlı kampanya takibi için kullanılır.

campaign.call.update Payload
{
  "event": "campaign.call.update",
  "timestamp": "2025-12-11T10:02:06.000Z",
  "data": {
    "campaignId": "cm1abc123xyz",
    "campaignName": "Q4 Sales Campaign",
    "contact": {
      "id": "cc_def456uvw",
      "phoneNumber": "+905551234567",
      "name": "John Smith",
      "customData": {
        "company": "Acme Ltd",
        "department": "Procurement"
      },
      "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": "Sales Assistant",
      "phoneNumberId": "pn_xyz789",
      "phoneNumber": "+905559876543"
    }
  },
  "webhookId": "webhook_123abc",
  "attemptNumber": 1
}

İletişim Durumları (contact.status):

  • COMPLETED - Arama başarıyla tamamlandı
  • FAILED - Arama başarısız oldu
  • NO_ANSWER - Cevap alınamadı
  • BUSY - Hat meşgul
  • VOICEMAIL - Sesli mesaja düştü

campaign.completed

Bir kampanyadaki tüm kişiler işlendiğinde tetiklenir.

campaign.completed Payload
{
  "event": "campaign.completed",
  "timestamp": "2025-12-11T14:00:00.000Z",
  "data": {
    "campaignId": "cm1abc123xyz",
    "campaignName": "Q4 Sales Campaign",
    "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": "Sales Assistant",
      "phoneNumberId": "pn_xyz789",
      "phoneNumber": "+905559876543"
    }
  },
  "webhookId": "webhook_123abc",
  "attemptNumber": 1
}

Ortak Alanlar

Tüm webhook payload'ları aşağıdaki ortak alanları içerir:

event

Webhook olayının türü (örn: "call.started", "tool.executed")

timestamp

Olayın gerçekleştiği zaman (ISO 8601 formatında)

data

Olaya özgü veri nesnesi (her olay türü için farklıdır)

webhookId

Webhook yapılandırmasının benzersiz kimliği

attemptNumber

Bu webhook gönderimi için deneme numarası (1-5 arası)

Yanıt Gereksinimleri

Webhook endpoint'iniz aşağıdaki gereksinimleri karşılamalıdır:

  • 5 saniye içinde yanıt vermeli
  • 2xx HTTP durum kodu döndürmeli (200, 201, 204, vb.)
  • Yanıt gövdesi isteğe bağlıdır (göz ardı edilir)
  • İmza doğrulaması başarısız olursa 401 döndürmeli
Örnek Başarılı Yanıt
HTTP/1.1 200 OK
Content-Type: application/json

{
  "received": true
}

Test Etme

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