Webhooks¶
Webhooks let you receive real-time notifications when events occur in SpeakNode. When an event triggers, the platform sends an HTTP POST request to your specified URL with the event payload.
Creating a Webhook Subscription¶
- Navigate to Webhooks in the sidebar.
- Click + Create Webhook.
- Fill in the configuration:
- URL: The endpoint where SpeakNode will send event payloads (e.g.,
https://your-server.com/webhooks/speaknode). - Description: A note describing the purpose of this webhook (e.g., "CRM sync for completed conversations").
- Event Types: Select which events should trigger this webhook.
- Enabled: Toggle the webhook on or off.
- URL: The endpoint where SpeakNode will send event payloads (e.g.,
- Click Save.
Event Types¶
| Event | Description |
|---|---|
ConversationComplete | Fired when a conversation ends. Includes the full transcript and metadata. |
SessionStarted | Fired when a new voice session begins. Includes the agent ID and session metadata. |
Note
More event types may be added in future updates. Check your SpeakNode dashboard for the latest list.
Webhook Secret and Signature Verification¶
Each webhook subscription is assigned a Webhook Secret. Use this secret to verify that incoming requests genuinely originate from SpeakNode.
How Verification Works¶
SpeakNode signs each webhook request using HMAC-SHA256:
- The platform computes an HMAC-SHA256 hash of the request body using your webhook secret as the key.
- The resulting signature is included in the request header.
- Your server should compute the same hash and compare it to the header value.
Verification Example¶
import hmac
import hashlib
def verify_webhook(payload: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode("utf-8"),
payload,
hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, signature)
Warning
Always verify the webhook signature before processing the payload. This prevents spoofed requests from being accepted by your server.
Viewing Request History¶
SpeakNode logs every webhook delivery attempt so you can debug issues.
- Open a webhook subscription from the Webhooks list.
- Scroll down to the Request History section.
- Each entry shows:
- Timestamp: When the request was sent.
- HTTP Status: The response status code from your server (e.g.,
200,500,timeout). - Payload: The JSON body that was sent.
- Response: The response body returned by your server.
Tip
If your server returns a non-2xx status code, SpeakNode may retry the delivery. Check the request history to see all attempts.
Troubleshooting¶
| Issue | Solution |
|---|---|
| Webhook not firing | Ensure the webhook is Enabled and the correct event types are selected. |
timeout in history | Your server must respond within a few seconds. Offload heavy processing to a background job. |
4xx or 5xx errors | Check your server logs. Ensure the URL is correct and accessible from the internet. |
| Signature mismatch | Ensure you are using the raw request body (not parsed JSON) and the correct webhook secret. |