sent-webhook-engineer
Builds and debugs Sent v3 webhook receivers end to end — endpoint registration, HMAC signature verification, replay rejection, event dedupe, retry and auto-disable behavior, secret rotation, and delivery-log triage. Use when handling Sent webhook events, verifying x-webhook-signature, fixing 401 or signature-mismatch failures, recovering a disabled endpoint, choosing event_types or event_filters, rotating a signing secret, or interpreting the webhook delivery log.
Security Assessment
About sent-webhook-engineer
Sent Webhook Engineer is an end-to-end reference for building and debugging Sent v3 webhook receivers. It starts from the fact that webhooks are the only way an application learns what happened after POST /v3/messages returns 202, since the 202 proves acceptance and never delivery. The skill's central deliverable is a correct, security-hardened receiver: one that verifies HMAC signatures, rejects replays, deduplicates events, acknowledges quickly, and treats the delivery log as the source of truth when events go missing.
It specifies the exact signature-verification procedure (capture raw body bytes before parsing, strip the whsec_ prefix and base64-decode the key, build the signed content from webhook id, timestamp, and raw body, compute HMAC-SHA256, compare in constant time, and reject when the timestamp is outside a 300-second tolerance), noting the scheme is Svix-compatible and always hand-written because no Sent SDK ships a helper. Reference files provide framework-by-framework raw-body accessor recipes (Next.js, Express, NestJS, FastAPI, Django, Flask, Go/Gin/Echo, Spring Boot, Laravel, Rails, ASP.NET Core), a failure-triage order, retry and auto-disable behavior (ten consecutive failures disable an endpoint), secret rotation, and delivery-log interpretation. A verify_signature.py script serves as the reference oracle.
It targets backend engineers integrating Sent who need to verify x-webhook-signature, fix 401 or signature-mismatch failures, recover a disabled endpoint, choose event types and filters, or rotate a signing secret. The content is defensive security engineering; documented environment variables (SENT_DM_API_KEY, SENT_DM_WEBHOOK_SECRET) are standard secret-handling guidance with no exfiltration.
FAQ
Why does my receiver report a signature mismatch?
In the majority of cases a body-mutating middleware or a framework JSON parser has altered the bytes before verification. You must capture the raw request body bytes before any JSON parsing; the reference files list the correct raw-body accessor for each framework.
Can I use x-webhook-id as a dedupe key?
No. x-webhook-id identifies the endpoint and repeats forever on every delivery, so using it for dedupe silently collapses every event into one. The skill points to per-event-type dedupe keys derived from the event payload instead.
What disables my webhook endpoint and how do I recover it?
A delivery fails on any non-2xx status, a timeout, or a connection failure, and ten consecutive failures disable the endpoint. After fixing the receiver, re-enable it with PATCH /v3/webhooks/{id}/toggle-status or from the Dashboard; any successful delivery resets the failure counter to zero.
Does Sent provide an SDK helper for signature verification?
No SDK ships a verification helper in any language, so the code is always hand-written. The included scripts/verify_signature.py acts as the reference implementation and oracle, and the scheme is Svix-compatible.
How are the signing secret and API key handled?
The signing_secret appears in full only once, in the 201 registration response, and should be persisted to a secret store immediately. Receiver samples read secrets from environment variables such as SENT_DM_WEBHOOK_SECRET and SENT_DM_API_KEY.
Install sent-webhook-engineer
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
sentdm/sent-plugin