Two types of webhooks
Inbound webhooks — external systems push events to DMHub. Example: your ordering system sends an event when a customer places an order.
Outbound webhooks — DMHub pushes events to your systems. Example: when a conversation is resolved, DMHub notifies your CRM.
Setting up an inbound webhook
- Go to /settings/integrations → Webhooks → New Inbound Webhook
- Give it a name and choose the event type you'll receive
- Copy the generated webhook URL:
``` https://www.dmhub.ai/api/webhooks/inbound/wh_abc123xyz ```
- Paste this URL in your external system as the webhook destination
Payload format
DMHub expects JSON payloads. The structure depends on what you're mapping, but a common pattern:
{
"event": "order.placed",
"customer": {
"phone": "+12025551234",
"email": "customer@example.com",
"name": "Jane Smith"
},
"data": {
"order_id": "ORD-789",
"total": 49.99,
"items": [...]
}
}
Field mapping
After saving the webhook URL, configure field mapping in DMHub:
- Map
customer.phone→ DMHub contact phone - Map
data.order_id→ tag or custom attribute on the conversation - Trigger an automation when this event fires
Setting up an outbound webhook
- Go to /settings/integrations → Webhooks → New Outbound Webhook
- Enter your system's receiving URL
- Select the DMHub events to send:
- conversation.created - conversation.resolved - message.sent - contact.created
- Optionally add custom headers (e.g., an API key for your receiving system)
Verifying webhook signatures
Outbound webhooks include a signature header X-DMHub-Signature so you can verify the payload is genuine:
const crypto = require('crypto');
function verifySignature(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signature)
);
}
The webhook secret is shown once when you create the outbound webhook — store it securely.
Debugging webhooks
Go to /settings/integrations → your webhook → Delivery Log to see:
- Each delivery attempt
- Request/response body
- HTTP status code
- Retry history (DMHub retries failed webhooks 3 times with exponential backoff)
Was this article helpful?
Let us know if this answered your question or if you need more help.
Send feedback