IOSOR Learn
Embedded Route Webhook Signature and Replay Window Gates
Verify inbound DLR and inbound-message webhooks from every embedded route: signature check, bounded replay window, nonce and timestamp discipline before trusting delivery state.
Lead Telecom & Routing Architect · Lausanne, CH
Every inbound DLR and inbound-message webhook from an embedded route must pass a signature check against the shared secret and fall inside a bounded replay window before any handler mutates delivery state. Treat unsigned, late, or duplicate callbacks as untrusted events, not delivery evidence.
Define the signature contract per embedded route
Each embedded route carries its own signing scheme: HMAC over the raw body, a header with the signature, a timestamp header, and often a nonce or event id. Capture this contract per route before go-live: which header carries the digest, which carries the timestamp, and whether the digest covers the body only or body plus timestamp. Verify against the raw request bytes, not a re-serialized JSON object, because key order and whitespace drift breaks the digest.
Enforce a bounded replay window
A replay window is the maximum age you accept between the route timestamp and your receive time. Bind it to your measured webhook latency: if p99 delivery is 8 seconds, a 300-second window is safe and a 24-hour window is not. Reject callbacks older or newer than the window with an explicit status, log the skew, and never write delivery state for a rejected event.
Deduplicate with idempotency keys and nonces
Signature validity does not prove a callback is new. Persist the event id or nonce with a TTL equal to the replay window plus a margin, and drop duplicates before state mutation. This is where DLR receipts drift: a replayed receipt can regress a delivered status back to pending or double-count a billing event. Keep the idempotency store per route so one route's keys cannot mask another's replays.
Map DLR fields before trusting status
A signed callback with an unexpected payload shape still corrupts state. Validate required DLR fields, status vocabulary, and message reference format before updating the delivery record. Unknown status strings should be quarantined, not coerced into delivered or failed. Schema drift is common on embedded routes after partner-side releases, so run a field-level check per route and reconcile anomalies against Embedded Route DLR Payload Schema Drift before widening traffic.
Reconcile webhooks against delivery order
Out-of-order callbacks are legitimate: a delivered receipt may arrive before the accepted receipt. Rejecting them as replays is wrong; ordering them is your job. Store the route timestamp and event sequence, apply state transitions by monotonic rule, and flag regressions for review.
Start with IOSOR
Run this checklist for each embedded route you are evaluating before you trigger a partner comparison. First, capture the raw webhook body and recompute the HMAC signature with the partner's shared secret; reject any payload whose signature does not match byte-for-byte. Next, record the timestamp or nonce on every callback and enforce a replay window, so a captured request cannot be resent after the window closes. Confirm that at least two distinct gates cover the same decision: signature validity and replay freshness must both pass before a DLR is marked delivered or a route is promoted.
Related: PAYG hold before first debit · Wallet stop-lines before production.
IOSOR takeaway
Each embedded route carries its own signing scheme: HMAC over the raw body, a signature header, a timestamp header, and often a nonce or event id. Store the route timestamp and event sequence, apply state transitions by a monotonic rule, and flag any regression for review (/tools/brief · DLR / webhook). Compare partners on these gates directly: replay-window tolerance, timestamp skew handling, and nonce or event-id uniqueness.
Was this guide helpful?
Related guides
- Embedded Route Fallback Destination Weighting: Audit and Comparison Gates
Audit how fallback destinations are weighted across embedded routes, catch silent weight drift, and decide when to rebalance or renegotiate before volume shifts.
- Embedded Route Sandbox-to-Production Promotion Gates
How to decide an embedded SMS, voice, or email route is safe to promote: verify sandbox DLR receipts, schemas, credentials, and quotas transfer to live traffic.
- Embedded Route Cost-Band Quote Drift: Verify Before You Commit Volume
Prove partner-quoted per-route cost bands still hold after destination mix, encoding, and volume-tier shifts before you sign embedded messaging volume.












