Skip to main content

Outbound Webhooks Reference

Outbound webhooks allow HuskyVoice AI to push real-time event data to your server as JSON payloads via HTTPS POST requests.


How to Listen to Webhooks

HuskyVoice sends real-time event data to a URL you provide. Follow these steps to start receiving events:

  1. Create a public HTTPS endpoint on your server to receive POST requests
  2. Register your URL — Go to Dashboard → Integrations → Outbound Webhooks → Add Endpoint
  3. Select the events you want to listen to (e.g., call.completed, call.failed)
  4. Return 200 OK immediately when your server receives the request
  5. Process the event asynchronously after acknowledging

Example — Webhook listener:

# Simulate a webhook delivery to test your endpoint
curl -X POST https://your-server.com/webhook \
-H "Content-Type: application/json" \
-H "X-Husky-Signature: your_expected_hmac_hex" \
-d '{
"event_id": "evt_test123",
"event_type": "call.completed",
"created_at": "2026-06-01T10:00:00Z",
"org_id": "org_abc_123",
"data": {
"call_id": "call_987654321",
"agent_id": "agent_alpha",
"status": "completed",
"duration_seconds": 124,
"summary": "Customer confirmed appointment."
}
}'
Testing Locally

Use a tool like ngrok to expose your local server to the internet while testing — run ngrok http 3000 and use the generated HTTPS URL in your dashboard.


Event Types

EventDescription
call.initiatedFired when the telephony system begins dialing the contact.
call.answeredFired when the recipient picks up the call.
call.completedFired when the call ends successfully (includes summary and transcripts).
call.failedFired when the call could not be completed (busy, no answer, or technical error).
call.disallowedFired when a call is blocked due to DND or policy restrictions.

Payload Schema

Every webhook share a consistent envelope structure. The data object contains the event-specific details.

{
"event_id": "evt_123456789",
"event_type": "call.completed",
"created_at": "2025-04-16T12:00:00Z",
"org_id": "org_abc_123",
"data": {
"call_id": "call_987654321",
"agent_id": "agent_alpha",
"status": "completed",
"duration_seconds": 124,
"transcript": "[...]",
"summary": "Customer interested in a follow-up demo."
}
}

Signature Verification

HuskyVoice signs all webhook payloads with an HMAC-SHA256 signature to ensure authenticity. The signature is sent in the X-Husky-Signature header.

# Compute the expected HMAC to compare with X-Husky-Signature
SECRET="YOUR_WEBHOOK_SECRET"
PAYLOAD='{"event_id":"evt_123","event_type":"call.completed",...}'

echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET"
# Compare the hex output with the X-Husky-Signature header value

Implementation Best Practices

  1. Acknowledge Immediately: Your server should return a 200 OK response instantly.
  2. Async Processing: Perform slow operations (like CRM sync) in a background worker after acknowledging the webhook.
  3. Idempotency: Use the event_id to ignore duplicate deliveries.
  4. Security: Always verify signatures and use HTTPS endpoints.