Skip to main content

Webhooks

Webhooks enable integration between the ClusterLab platform and external systems. They allow real-time notifications about events and data exchange with other applications.

Webhook Properties

Webhooks include the following key information:

Basic Configuration

  • Webhook URL - Destination URL for webhook calls
  • Webhook Method - HTTP method (GET, POST, etc.)
  • Webhook Events - Events that trigger the webhook
  • Webhook Status - Current operational status

Authentication

  • Webhook Auth Token - Token for authentication
  • Webhook Basic Auth Username - Username for basic authentication
  • Webhook Basic Auth Password - Password for basic authentication
  • Webhook Headers - Custom HTTP headers

Retry Configuration

  • Webhook Timeout - Maximum time to wait for response
  • Webhook Retries - Number of retry attempts
  • Webhook Retry Delay - Time between retry attempts
  • Webhook Retry Delay Unit - Unit for retry delay (e.g., seconds, minutes)

Status Tracking

  • Webhook Last Status Update At - Timestamp of last status update
  • Webhook Last Status Update Message - Message from last update
  • Webhook Last Status Update Attempts - Number of attempts in last update
  • Webhook Last Status Update Error - Error from last update
  • Webhook Last Status Update Response - Response from last update
  • Webhook Last Status Update Response Status Code - HTTP status code
  • Webhook Last Status Update Response Status Message - HTTP status message
  • Webhook Last Status Update Response Headers - Response headers
  • Webhook Last Status Update Response Body - Response body

Webhook Events

Webhooks can be triggered by various events, including:
  • call.started - A call has started
  • call.ended - A call has ended
  • call.transcribed - A call transcript is available
  • campaign.started - A campaign has started
  • campaign.ended - A campaign has completed
  • contact.created - A new contact has been created
  • agent.task.completed - An agent has completed a task

Webhook Payload

Webhook payloads include relevant data about the triggering event. For example, a call.ended event might include:
{
  "event": "call.ended",
  "timestamp": "2023-04-15T14:32:45Z",
  "data": {
    "call_id": "550e8400-e29b-41d4-a716-446655440000",
    "call_sid": "CA123456789",
    "campaign_id": "550e8400-e29b-41d4-a716-446655440001",
    "ai_agent_id": "550e8400-e29b-41d4-a716-446655440002",
    "contact_id": "550e8400-e29b-41d4-a716-446655440003",
    "call_duration": 180,
    "call_status": "completed",
    "call_direction": "outbound",
    "disconnect_reason": "normal",
    "analysis_sentiment": "positive",
    "agent_task_status": "completed",
    "agent_post_call_outcomes": {
      "appointment_scheduled": true,
      "follow_up_required": false
    }
  }
}

API Reference

Create a Webhook

POST /api/v1/webhooks

Get Webhook

GET /api/v1/webhooks/{id}

Update Webhook

PUT /api/v1/webhooks/{id}

Delete Webhook

DELETE /api/v1/webhooks/{id}

List Webhooks

GET /api/v1/webhooks

Test Webhook

POST /api/v1/webhooks/{id}/test

Get Webhook Delivery History

GET /api/v1/webhooks/{id}/history