Developers

Verify webhook signatures

Verify HMAC signatures, check timestamps, and handle duplicate webhooks.

1 min read5 sections
On this page

Preserve the raw body

Headers

Use Tembuilder-Event, Tembuilder-Delivery-Id, Tembuilder-Attempt, Tembuilder-Timestamp and Tembuilder-Signature. The signature is v1= plus a hex HMAC-SHA256. The revealed signing secret is unpadded base64url; decode it into bytes first.

Signed bytes

timestamp + "." + raw_body

Compute HMAC-SHA256 with the decoded secret and compare in constant time.

Timestamp and duplicates

Test before production

Accept a correctly signed test. Reject a one-byte body change and stale timestamp. Deliver the same ID twice and verify business side effects are not duplicated. Keep secrets and sensitive payloads out of logs.

Search documentation