Home · Guides · Signed Webhooks
Why should outcome webhooks be signed, and how does HMAC signing work?
By the Ingenious AI team · Published 2026-11-14 · Reviewed 2026-11-14
Short answer: Because outcome records change numbers that bills and scaling decisions rest on, the endpoint that receives them must know the delivery is genuine. OutcomeMeter's outcome webhook (POST /webhooks/outcomes) authenticates each delivery with an HMAC-SHA256 signature computed with a per-account secret: the receiver recomputes the signature over the delivered body and compares — a bad signature is rejected and writes nothing, every time.
Try the free demo measurement See pricing Start free — one provider key
What is an HMAC-SHA256 webhook signature?
An HMAC-SHA256 webhook signature is a keyed hash of the exact delivery body, computed by the sender with a shared secret and verified by the receiver with the same secret. In OutcomeMeter the secret is per-account: only the account's own systems can produce a signature the webhook accepts, and any tampering with the body in transit invalidates the signature.
Outcome data is worth forging — that settles the design question
Verified outcomes drive cost-per-verified-success, the number agencies bill and scale on. A forged outcome stream could inflate a workflow's verified count, deflate its apparent unit cost, and distort every decision downstream. Any endpoint whose writes move money-adjacent metrics must authenticate its writers; an unsigned outcome endpoint is an invitation, whether or not anyone has accepted it yet.
Authentication by network location or obscurity does not survive contact with real deployments: senders run in clouds with shifting addresses, and an unguessable URL is a secret that leaks in logs and screenshots. A cryptographic signature travels with the delivery itself and survives all of that.
How the signing works, step by step
The sender and receiver share a secret, generated per account and held only by the account's systems and the receiver. For each delivery, the sender computes HMAC-SHA256 over the exact bytes of the request body using that secret, and sends the resulting hex digest in a signature header. The receiver recomputes the HMAC over the body it received and compares digests — using a constant-time comparison, so the comparison itself leaks nothing useful to an attacker probing byte by byte.
If the digests match, the body is exactly what the secret-holder sent, and the record is processed (with its idempotency key checked as usual). If they differ — wrong secret, altered body, replayed signature over a changed payload — the delivery is rejected and nothing is written. There is no partial credit and no warning write: rejection is total.
Why per-account secrets matter
A single global secret for all senders means one leak compromises every account's outcome stream, and revoking it breaks everyone at once. Per-account secrets contain the blast radius: a leaked secret endangers one account's stream, can be rotated for that account alone, and — because the webhook knows which account a signature claims — a secret can never accidentally authenticate another account's records.
Rotation hygiene is part of the design: when a secret is suspected compromised, generate a new one, update the sender, and the old signatures stop working immediately. The ledger's append-only history helps here too — records written before the rotation remain visible with their sources, so a compromise window can be audited rather than wondered about.
What signing does not do
Signing proves origin and integrity, not truth. A genuinely signed record can still describe an outcome that the sender's own system recorded wrongly — the signature vouches for who sent it and that it arrived intact, not for the sender's internal accuracy. That is why verified outcomes still carry their verification source and external reference: the signature authenticates the delivery, the reference lets a human audit the fact.
Signing also does not encrypt: the body travels as readable JSON (over TLS in transit), because the goal is authenticity, not secrecy. Teams that conflate the two sometimes skip signing because 'we already use HTTPS' — but TLS authenticates the channel to a host, not the payload to an account, and it ends at whatever proxy terminates it. The HMAC covers the body end to end.
Webhooks among three doors: choosing the right one
OutcomeMeter accepts outcome records three ways, and the webhook is the middle door. The outcome API suits systems that can make authenticated calls with the account's license key and want a direct response per record. The signed webhook suits systems of record that emit events — a helpdesk firing on ticket resolution — where the sender cannot hold the account's license key but can hold a signing secret. CSV import suits everything else, including history and file-based systems.
The doors converge on the same record: workflow, outcome type, external reference, verified flag and verification source, idempotency-checked, appended to the same ledger. Choosing a door is an integration decision, not a data-quality decision — and records from different doors sit side by side, each showing how it arrived.
Failure behaviour is the security feature
Security endpoints reveal themselves in their failures. OutcomeMeter's webhook, given a bad signature, rejects the delivery and writes nothing — no record, no partial record, no 'unverified' fallback copy. That total refusal matters because fallback paths are where forged data would otherwise land: a system that stores unsigned deliveries 'for review' has still let an attacker write into the dataset humans review.
Legitimate senders experience the same strictness as clarity: a misconfigured secret produces immediate, total rejection, which is debuggable in minutes, instead of silent partial acceptance that corrupts a month of verified counts before anyone notices. Strict at the door, boring in the ledger — that is the correct temperament for money-adjacent data.
Wire a signed outcome webhook correctly: the 5-action checklist
The pattern is standard; the mistakes are always in the details — sign the exact bytes, compare in constant time, reject totally.
- Generate the per-account secret: store it in the sender's secret manager, never in code or in the webhook URL.
- Sign the exact body bytes: HMAC-SHA256 over the raw payload as sent — re-serializing JSON before signing breaks verification.
- Send the digest in the header: hex-encoded, alongside the account's delivery, on every attempt including retries.
- Test the negative cases: wrong secret, altered body and missing header must each be rejected with nothing written.
- Plan rotation: document who rotates the secret, where it lives, and how the sender is updated — before you need it.
Worked example: a fictional helpdesk integration, including the day it broke safely
A fictional agency, Corvid Support Partners, wires its helpdesk to POST a signed outcome record whenever a ticket is resolved: workflow, outcome type 'ticket resolved', the ticket's own ID as external reference, verified flag set with the helpdesk as source. In the first month 3,912 records land; cost per verified success for the support workflow stabilizes at $1.08, and the agency starts reporting it to the client.
In month two a helpdesk update changes how the payload is serialized — a field order change alters the body bytes, signatures stop matching, and every delivery is rejected. The ledger shows a clean gap, not corrupted data; the team spots the missing records within a day precisely because absence is visible, fixes the sender to sign the exact bytes it transmits, and replays the missed resolutions from the helpdesk with their original idempotency keys. The verified count recovers fully, with no duplicates and no forged rows to clean out.
OutcomeMeter runs this measurement on your own provider spend: connect a key on the free tier, watch the demo measurement first if you want to see the shape of the output, and read accepted-outcome economics when you are ready to value accepted work. The guides index collects every guide in this series.
Frequently asked questions
What does an HMAC-SHA256 signature prove?
That the delivery was produced by a holder of the account's secret and that the body arrived byte-for-byte intact. It proves origin and integrity. It does not prove the sender's internal records are accurate — that is what the verification source and external reference on each outcome record are for.
What happens if a webhook delivery has a bad signature?
It is rejected and nothing is written. No partial record, no unverified fallback copy. Total rejection keeps forged or corrupted data out of the ledger and makes legitimate misconfigurations immediately, debuggably visible.
Why a per-account secret instead of one global secret?
Containment and rotation. A leaked per-account secret endangers one account's outcome stream and can be rotated for that account alone; a global secret's leak compromises everyone and its rotation breaks everyone.
Is a signed webhook better than the outcome API?
Neither is better; they suit different senders. The API fits systems that can hold the license key and call directly. The webhook fits event-emitting systems of record that can hold a signing secret. CSV import covers file-based systems. All three produce the same ledger record.
Does signing encrypt the outcome data?
No. Signing authenticates; TLS encrypts in transit. The HMAC's job is to bind the exact body to the account's secret end to end, which channel encryption alone does not do once proxies and retries enter the path.
Keep reading
- How do you send outcome records to the verified ledger?
- What is a verified outcome, and why does it outrank a success tag?
- Why does idempotency matter when you record AI cost events?
- How does the attribution ingest API turn AI spend into per-client records?
- Verified vs unverified outcomes: why must they never be blended?
- All OutcomeMeter guides
- Free demo measurement
- Accepted-outcome economics
- OutcomeMeter pricing — Free, Pro $29/mo, Agency $79/mo