The Mailjet webhook resources allow you to receive real-time notification through HTTP requests on events linked to the messages you sent. This event notification works for both transactional and marketing emails. The supported events are open, click, bounce, spam, blocked, unsub and sent.
This is a very efficient way to do specific actions on your side, like:
logging the marketing messages sent to your customers generating your own statistics updating the unsubscribed contacts in a CRM system. Instead of polling our API a few times a day, the Event API will push new data just as the events happen, almost instantly ("don’t call me, I’ll call you if I have something new").
A webhook URL is the HTTP address our server will call for each event as it occurs.
You can use the API to set up a new webhook using the /eventcallbackurl resource. Alternatively, you can configure this in your account preferences, in the Event Tracking section.
It must return a 200 OK HTTP code if all goes well. Any other HTTP code will result in our server retrying the request later. Our system will retry every 30s and will stop after 24h, unless a new event is generated.
The API also allows you to configure a backup endpoint URL with the property isBackup - it will be used in case the primary URL is suspended. To reactivate a suspended endpoint URL, you need to update it with a new URL.
To reactivate a suspended endpoint URL, you need to update the URL with a new URL.
We strongly recommend using a secure (HTTPS) URL in combination with a basic authentication to make sure data cannot be intercepted, and that only our servers can send you data:
https://username:password@www.example.com/mailjet_triggers.php You can also specify a port in your webhook URL.
https://www.example.com:123/mailjet_triggers.php The event data is sent in the POST request body using a JSON object. Its content depends on the event.