Postploy-Signature header proves a request came from Postploy and wasn’t changed on the way.
tis when the request was signed, in Unix seconds.v1is an HMAC-SHA256 oft, a dot and the raw request body, made with your endpoint’s secret and written in hex.
Check a signature
1
Read the raw body
Use the body exactly as it arrived, before any JSON parsing. Parsing and turning it back into text can change it, and then the signature won’t match.
2
Make your own signature
Join
t, a . and the raw body. Make an HMAC-SHA256 of that with your secret, including its whsec_ start, and write it in hex.3
Compare
The request is real if your signature matches any
v1 in the header. Compare in constant time.4
Check the time
Reject requests where
t is more than 5 minutes away from now. This stops someone sending an old request again.Test your code
Run your signature code on these values, leaving out the time check. It should make the signature shown.
Then send a real test from Settings › Webhooks, or with Send a test event.
Change the secret
If a secret leaks, roll it to get a new one. For the next 24 hours, each request carries twov1 signatures, one made with the new secret and one with the old. Code that accepts any matching v1 keeps working while you swap the new secret in.