Skip to content

Webhooks ​

With webhooks, Mailiqo notifies your server when an email is delivered, bounces, gets a complaint, is rejected or fails. Instead of asking the API for the status of each message, you receive a POST request with the event as soon as it happens.

How it works ​

  1. You add your server's URL — the endpoint — to a sending domain, from the panel.
  2. For each email sent from that domain, Mailiqo sends a POST to that URL with a JSON describing what happened.
  3. Your server verifies the signature, answers 2xx and processes the event.

Each endpoint belongs to one sending domain and receives the events of the emails sent with that domain, over the API and over SMTP alike. The number of endpoints per domain depends on your plan: today it is one on every plan.

Events ​

EventWhen it is sent
email.deliveredThe recipient's mail server accepted the message
email.bouncedThe destination server returned the message
email.complainedThe recipient marked the message as spam
email.rejectedThe message was discarded before being sent
email.failedThe message could not be sent because of a technical problem

You choose which events each endpoint receives. What each one contains is in Events.

In addition, from the panel you can send an endpoint.ping to check the connection with your server. It does not depend on the events you have chosen.

Opens and clicks do not produce an event: check them in the panel or with GET /email-message/{id}.

Set up an endpoint ​

  1. In the panel, go to Email → Domains and pick the domain.
  2. Open the Webhooks tab and, under Production, click Add webhook.
  3. Enter your server's URL and tick the events you want to receive.
  4. On saving, the signing secret is shown; it starts with whsec_. Copy it then: it is not shown again.

Your server uses that secret to check that each request comes from Mailiqo. See Verify signatures.

To build your integration without touching production, the same tab has a Testing section with its own secret. See Testing.

URL requirements ​

  • It starts with https://. Any port is accepted.
  • It is a public domain name with a valid TLS certificate. IP addresses, credentials inside the URL and names that point to private or local addresses are not accepted.
  • It is at most 1,024 characters long.

Redirects are not followed: a 3xx response counts as a failure. Configure the final URL.

What your server must do ​

  • Verify the signature before trusting the content.
  • Answer with a 2xx status in under 10 seconds. Any other response, a connection error or a slower response counts as a failure, and the event is retried. If processing takes time, put the event on a queue and answer before processing it.
  • Accept duplicates. The same event can arrive more than once. The webhook-id header is the same on every attempt: use it to drop the ones you have already processed.
  • Not rely on order. Events can arrive out of order. The timestamp field says when each one happened.
  • Ignore what it does not know. New fields can appear in the JSON, and so can new event types. Answer 2xx to the types you do not use as well.

The body of your response is not used. Its first 500 bytes are kept in the delivery log in the panel, to help you debug.

If your server answers 410 Gone, Mailiqo takes it that the endpoint no longer exists: it disables it and stops sending it events.

What you can expect from Mailiqo ​

  • Each event is delivered at least once. If your server fails, it is retried for about 24 hours. See Retries and failures.
  • Format changes are additive: fields and event types can be added, but the existing ones are not removed and do not change meaning.
  • The IP addresses the events come from can change. Do not filter by IP: use the signature.

Next steps ​

Built with VitePress