Verifying Deliveries
Before acting on a delivery, confirm it genuinely came from Dash. There are two independent checks — use both for defense in depth, but the signature check is the one that matters cryptographically.
1. The shared secret (basic check)
Every delivery carries:
Authorization: Bearer <your subscription's secret>
Compare this against the secret you were shown when you created the subscription (see Getting Started). This is a quick sanity check, but on its own it's only as strong as a shared secret sent over the wire on every request — treat the signature check below as your primary defense.
2. RFC 9421 HTTP Message Signatures (the real proof)
Every delivery is also cryptographically signed per RFC 9421 (HTTP Message Signatures), verifiable against Dash's published JWKS — no shared secret required for this check:
https://api.daysmartrecreation.com/.well-known/jwks.json
Relevant headers
| Header | Content |
|---|---|
WebHook-ID | A unique id for this delivery — also your deduplication key (see Delivery, Retries & Rate Limits). Matches the CloudEvents envelope id and is itself a covered component of the signature (see step 5), so it can't be swapped without invalidating the signature. |
Content-Type | application/cloudevents+json |
Content-Digest | A RFC 9530 SHA-256 digest of the raw request body. |
Signature-Input | The RFC 9421 signature metadata — which components are signed, the key id (keyid), algorithm (alg), and the created timestamp. |
Signature | The RFC 9421 signature itself. |
Verification steps
- Recompute the body digest. SHA-256 the raw request body (before any JSON parsing) and confirm it matches
Content-Digest. - Parse
Signature-Inputto get the covered component list,keyid,alg, andcreated. - Check the timestamp. Reject the request if
createdis further from the current time than an acceptable window (5 minutes is a reasonable default) — this guards against replay of an old, captured request. - Fetch the JWKS from the URL above and find the key whose
kidmatcheskeyid. Cache the JWKS response for a while (an hour is a reasonable default) rather than fetching it on every delivery, and refresh it in the background. - Reconstruct the signature base per RFC 9421 §2.5, covering the method, authority, path, query, and the content digest, and the
WebHook-IDheader. - Verify the signature against the reconstructed base using the key from step 4. Dash signs with
EdDSAbut always use thealgfromSignature-Inputto pick the right verification routine.
If any step fails, reject the request with 401 Unauthorized and do not process the payload.
Since WebHook-ID is a covered signature component, a valid signature already guarantees it wasn't swapped in transit — but as a cheap extra sanity check, confirm the WebHook-ID header equals the id field in the CloudEvents body; they're always the same value.
Don't return
410or415for a failed verification. Those two status codes tell Dash to permanently deactivate your subscription — reserve them for when you intentionally want deliveries to stop. Use401for verification failures instead; see Delivery, Retries & Rate Limits for the full response-code contract.
A working reference implementation
You don't have to implement this from scratch. DaySmart publishes an open-source reference receiver that implements this exact verification recipe end-to-end (handshake, signature verification, deduplication, and the live event dashboard):
DaySmart/dash-webhook-receiver-example-php
It's a small Laravel application you can run locally with Docker to see verified deliveries appear in real time, or adapt directly if you're building a PHP receiver. If you're using another language, the same recipe (steps 1–6 above) applies — the reference app's WebhookSignatureVerifier is the clearest place to see it worked out byte-by-byte.
Updated 2 months ago

