How webhooks work
- Event occurs: A token operation or system event happens in Guardian.
- Notification sent: Guardian sends a webhook payload to your configured endpoint.
- Process payload: Your endpoint receives a lightweight event description.
- Fetch details: Use the API to fetch full details if needed.
Configuration
Callback behavior and payload signing are documented on the endpoint that registers the webhook (see Register webhook for more details).Security
- Webhook payloads are signed so you can verify authenticity.
- Configure secure (HTTPS) endpoints.
- Validate webhook signatures before processing requests.
HMAC signing
The x-hmac-signature header is a base16-encoded (hex) Message Authentication Code (MAC) generated from the raw request payload using your HMAC key and SHA256.How to verify
- Calculate the HMAC using:
- The raw payload you received in the webhook body
- Your HMAC key
- The SHA256 hashing function
- Compare the calculated value with the
x-hmac-signatureheader you received.