Webhooks: get notified in your system
Register an https address, choose the events and check each delivery’s signature.
A webhook makes Amati notify your system when something happens, with a JSON POST, within about a minute.
Register
- Open API and go to Webhooks.
- In Address, enter a public https URL (ports 443 or 8443).
- In Events, tick what you want to receive.
- Click Create webhook and keep the secret shown: it is used to check signatures.
- Use Send test to see whether your address answers.
Available events
- Transactional email:
mail.message.delivered,delayed,bounced,complained,rejected,opened,clicked. - Domain:
mail.domain.active,mail.domain.dns_broken. - Newsletter:
newsletter.contact.subscribed,unsubscribed,bounced,complainedandnewsletter.campaign.submitted,approved,rejected,paused,sent. - Calendar:
agenda.event.created,updated,deleted. - Drive:
drive.file.uploaded.
The event carries only identifiers. For details, fetch the item through the API. Newsletter contact events also include the email.
Check the signature
Each delivery carries the Amati-Signature header, with the time (t) and an HMAC SHA-256 (v1) computed over the time and the original body, with the webhook secret. Compute it over the body before parsing the JSON and reject times more than 5 minutes off. The step by step is in the API documentation, in the Webhooks section.
Delivery and retries
- Answer with any 2xx status within 5 seconds and do the heavy work later.
- Without an answer, Amati retries several times over a few hours.
- An event may arrive more than once or out of order: use the
Amati-Deliveryheader to ignore repeats. - After many consecutive failures, the webhook becomes Turned off after failures. Fix the address and click Turn back on.
Latest deliveries shows each delivery: Queued, Delivered or Failed. Change secret generates a new secret; the next deliveries already use it.
Did not find the answer?
Log in to the panel and talk to support, or write to suporte@amati.digital.