Webhooks
Event notifications to your own system
Get a signed HTTPS POST to your server when something happens in your account, like a lead captured or a policy sold.
Set up a webhook
- Sign in to the partner portal and open Settings, then Integrations, then Webhooks (/partner/settings/integrations/webhooks).
- Add your endpoint's HTTPS URL and pick the events you want.
- Copy the signing secret it gives you and store it on your server.
- Verify the signature on every request (example below) and reply with any 2xx status within 10 seconds.
Using Zapier instead? Connect it from Settings, then Integrations, then Zapier in the portal; no code needed.
Events
lead.capturedA lead was captured on your microsite
policy.createdA policy was created
policy.soldA policy was sold through your business
commission.earnedA commission was credited to you
payout.completedA payout to you was completed
partner.signupYour partner account was created
partner.activatedYour partner account was activated
What we send
POST https://your-site.example/dei-webhook
Content-Type: application/json
X-DEI-Signature: 5d41402abc4b2a76b9719d911017c592... (HMAC-SHA256 of the raw body, hex)
X-DEI-Event-Type: policy.sold
X-DEI-Event-ID: evt_...
{
"trigger_type": "policy.sold",
"event_id": "evt_...",
"timestamp": "2026-11-12T17:05:00.000Z",
"partner_id": "your-partner-id",
"microsite_id": "your-microsite-id",
"microsite_slug": "your-microsite",
"data": { ... }
}The fields inside data depend on the event.
Verify the signature
Compute an HMAC-SHA256 of the raw request body with your signing secret and compare it to the X-DEI-Signature header. Reject the request if they don't match.
// Node.js (Express): verify a portal webhook before trusting it
const crypto = require('crypto')
const express = require('express')
const app = express()
app.post('/dei-webhook', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.get('X-DEI-Signature') || ''
const expected = crypto
.createHmac('sha256', process.env.DEI_WEBHOOK_SECRET)
.update(req.body) // the raw body, before JSON parsing
.digest('hex')
const valid =
signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
if (!valid) return res.status(401).send('Invalid signature')
const event = JSON.parse(req.body.toString('utf8'))
switch (event.trigger_type) {
case 'policy.sold':
// update your records with event.data
break
case 'lead.captured':
break
}
res.sendStatus(200) // reply with any 2xx within 10 seconds
})
app.listen(3000)Webhooks created with the API
If your API key has the webhooks:manage permission, you can also manage webhooks with /api/external/v1/webhooks; see the API reference. These use a timestamped signature, and failed deliveries are retried up to 4 more times (after about 1 minute, 5 minutes, 30 minutes and 2 hours).
// Webhooks created with the API (/api/external/v1/webhooks) are signed differently:
// X-DEI-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">
// X-Webhook-Id: evt_... X-Webhook-Event: policy.sold
// Body: { "id": "evt_...", "type": "policy.sold", "created": 1731430000, "data": { ... } }
const crypto = require('crypto')
function verifyApiWebhook(rawBody, header, secret, toleranceSeconds = 300) {
const match = /t=(\d+),v1=([a-f0-9]+)/.exec(header || '')
if (!match) return false
const [, t, signature] = match
if (Math.abs(Date.now() / 1000 - Number(t)) > toleranceSeconds) return false
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex')
return (
signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
)
}Good practice
- Use an HTTPS URL that's reachable from the internet (not localhost).
- Always verify the signature, and keep the signing secret out of your code repository.
- Reply quickly with a 2xx and do slow work afterwards; requests time out after 10 seconds.
- Use the event ID to skip events you've already handled.
X-DEI-Test: true header.Webhook not arriving?
Email us at support@dailyeventinsurance.com with your endpoint's host and the event you expected. Hours: Monday-Friday, 9am-5pm PT.
Email support