Webhooks
Add endpoints under Developers → Webhooks. Hedvi sends Resend-compatible payloads (type, created_at, data) for email.sent, email.delivered, email.delivery_delayed, email.bounced, email.complained, email.failed and email.suppressed, plus opt-in Hedvi events (hedvi.email.delivery_unknown, hedvi.quota.warning, hedvi.project.paused, domain.updated). Recipient events contain the affected recipient in to.
Verify signatures
Requests are signed with the Standard Webhooks scheme over id.timestamp.body (headers webhook-id, webhook-timestamp, webhook-signature, mirrored as svix-*). Reject timestamps older than 5 minutes. The Resend SDK verifies them:
import { Resend } from "resend";
const resend = new Resend(process.env.HEDVI_API_KEY);
export async function POST(req: Request) {
const payload = await req.text(); // the raw body, unparsed
try {
const event = resend.webhooks.verify({
payload,
headers: {
id: req.headers.get("webhook-id")!,
timestamp: req.headers.get("webhook-timestamp")!,
signature: req.headers.get("webhook-signature")!,
},
webhookSecret: process.env.HEDVI_WEBHOOK_SECRET!, // whsec_…
});
// Deduplicate on webhook-id: delivery is at least once.
return new Response(null, { status: 204 });
} catch {
return new Response("invalid signature", { status: 400 });
}
}Delivery
- At least once. The event id is stable across retries and manual resends — deduplicate on it.
- Any 2xx within 15 seconds counts as success. Retries after 5 s, 5 min, 30 min, 2 h, 5 h, 10 h and 10 h; then the delivery is marked failed and can be resent from the dashboard.
- Redirects are not followed. Endpoints must be public HTTPS; private, loopback and cloud metadata addresses are refused, also after DNS resolution.
- Only the first 1 KB of your response is stored, for troubleshooting.