Webhooks
Webhook events fired by Truss.
Verifying signatures
When your subscription has a signing secret, every delivery includes an X-Webhook-Signature header so you can confirm the request came from Truss and was not modified in transit.
The header has the format t=<timestamp>,v1=<signature>, where timestamp is the Unix time the request was signed and signature is a hex-encoded HMAC-SHA256.
To verify a delivery:
- Parse the
tandv1values from the header. - Compute the HMAC-SHA256 of the string
<timestamp>.<raw_request_body>using your signing secret as the key. Sign the raw request body exactly as received — do not parse and re-serialize the JSON, or the signature will not match. - Compare your result to
v1using a constant-time comparison. - Reject the delivery if the signature does not match, or if
timestampis more than 5 minutes old (replay protection).

