With a webhook, Xendy automatically sends a POST request to your URL when something happens. You can choose from three events:
- DNS records no longer correct (
dns-records.failed)
- DNS records recovered (
dns-records.recovered)
- Webshop import failed (
webshop-import.failed)
- On the Webhooks tab, click Add webhook.
- Enter the URL (https only) and choose the Events.
- Click Add. Copy the webhook secret that appears: you only see it once.
Every message is JSON with id, event, created_at, and data, and includes the headers Xendy-Event, Xendy-Delivery, and Xendy-Signature. You use the signature to verify that the message really came from Xendy. Xendy-Signature has the format t=<timestamp>,v1=<signature>: the signature is an HMAC-SHA256 of <t>.<body> using your secret. Reject messages where t is older than 5 minutes. A JavaScript example is included in the documentation.
Respond within 10 seconds with a 2xx status code. If delivery fails, Xendy will retry after 1, 5, and 30 minutes. If five events in a row fail completely, Xendy sets the webhook to Disabled. Every attempt is visible on the Activity tab, under Outgoing webhook.