Skip to content

Webhooks

← Back to API Reference

Two kinds of webhooks:

TypeDirectionPurpose
Outgoing webhooksDariet → your serverNotify you on call events (call_started, call_ended)
Telephony provider webhooksProvider → DarietInbound call routing, status callbacks, media streams

Outgoing Webhooks

Configure webhook_url and webhook_events on an agent to receive call event notifications.

Request Format

All outgoing webhooks are POST requests with Content-Type: application/json.

Behaviour

  • Fire-and-forget — webhooks never block the call pipeline.
  • 10-second timeout per request.
  • No retries — failures are logged but not retried.

call_started

Fired when the call connects and the agent pipeline is ready.

json
{
  "event": "call_started",
  "call_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+919876543210",
  "agent_name": "sales-agent",
  "direction": "inbound",
  "status": "in_progress"
}

call_ended

Fired after the call ends and all data (transcript, usage stats) is persisted.

json
{
  "event": "call_ended",
  "call_id": "550e8400-e29b-41d4-a716-446655440000",
  "phone_number": "+919876543210",
  "agent_name": "sales-agent",
  "direction": "inbound",
  "status": "completed",
  "duration": 45.2,
  "start_time": "2026-03-18T10:23:45.000000",
  "end_time": "2026-03-18T10:24:30.200000",
  "transcript": "[2026-03-18T10:23:46] User: Hello\n[2026-03-18T10:23:48] Agent: Hi, how can I help?"
}

Telephony Provider Webhooks

These endpoints are called by telephony providers — not by API consumers. Configure the inbound webhook URLs in your provider's dashboard, or create a Telephony Endpoint to get the pre-computed URL.

Twilio

MethodEndpointDescription
POST/telephony/twilio/inbound/{agent_name}Inbound call → returns TwiML with Media Streams URL
POST/telephony/twilio/status/{call_id}Status callback (CallStatus, Duration, etc.)
WS/ws/twilio/{agent_name}Real-time audio over Media Streams WebSocket

Exotel

MethodEndpointDescription
POST/telephony/exotel/inbound/{agent_name}Inbound call → returns ExoML
POST/telephony/exotel/stream/{agent_name}Outbound call answer callback
POST/telephony/exotel/status/{call_id}Status callback (Status, CallDuration, etc.)
WS/ws/exotel/{agent_name}Real-time audio WebSocket

Vobiz

MethodEndpointDescription
POST/telephony/vobiz/inbound/{agent_name}Inbound call → returns Vobiz XML
POST/telephony/vobiz/status/{call_id}Status callback (Event, Duration, etc.)
WS/ws/vobiz/{agent_name}Real-time audio WebSocket

Setup checklist

  1. Deploy Dariet with a public HTTPS domain.
  2. Set public_base_url in Settings → Telephony.
  3. Create a Telephony Endpoint for your phone number — it returns the ready-to-paste inbound_webhook_url.
  4. Paste that URL into your telephony provider's dashboard as the inbound webhook.
  5. Point the status callback to {public_base_url}/telephony/{provider}/status/{call_id} (Dariet handles this automatically for outbound calls).