Testing webhooks
You do not need to send real emails or wait for one to bounce to build your integration. Each domain has a Testing section, separate from production, with its own secret and with signed sample requests to run against your development environment.
It is in Email → Domains, Webhooks tab, Testing selector.
Production and testing
| Production | Testing | |
|---|---|---|
| What it receives | The real events of the domain's emails | Nothing: you send the requests yourself |
| Secret | Starts with whsec_ | Starts with whsec_test |
| Needs an endpoint | Yes | No |
| Counts towards the plan limit | Yes | No |
The two environments never mix. A real event is never signed with the testing secret, and a sample request is never signed with the production one. If your production server only knows its own secret, a sample request does not pass signature verification. That is why the JSON carries no field to tell one kind of event from the other.
Generate the testing secret
- In the domain's Webhooks tab, choose Testing.
- Click Generate testing secret.
- Copy the testing secret that is shown. It starts with
whsec_testand is not shown again.
You do not need to have added a production endpoint first. Keep the secret in your development environment's configuration, in the same variable where production keeps its own.
The testing secret is used exactly like the production one: the same computation and the same libraries. See Verify the signature.
If you compute the signature without a library, strip only the whsec_ prefix: the test that follows is part of the key.
You can rotate it whenever you want. Delete testing secret removes it; you can generate another one afterwards.
Test locally
Your development machine is not reachable from the Internet, so Mailiqo cannot call it. Instead, the panel gives you the request already signed so that you can send it yourself:
- Under Test locally, choose the sample event.
- Enter the URL of your local server. The default is
http://localhost:3000/webhooks/mailiqo. - Click Generate curl.
- Copy the command and run it in your terminal.
curl -X POST 'http://localhost:3000/webhooks/mailiqo' \
-H 'content-type: application/json' \
-H 'user-agent: Mailiqo-Webhooks/1' \
-H 'webhook-id: evt_5f1c2a9e8b7d4c3fa2b1c0d9e8f7a6b5' \
-H 'webhook-timestamp: 1767263349' \
-H 'webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=' \
-d '{"id":"evt_5f1c2a9e8b7d4c3fa2b1c0d9e8f7a6b5","type":"email.bounced","timestamp":1767263349,"data":{"email":{"id":"msg_8c2db7094df247c4b03f6f1d2a9e5c10","send_id":"snd_ecbc059748234c9c9cbb0a1b2c3d4e5f","recipient_email":"[email protected]","recipient_type":"to","channel":"api","sending_domain":"yourdomain.com"},"bounce":{"type":"hard","category":"general","diagnostic":"The recipient address does not exist or cannot receive email."}}}'The request carries the same headers and the same format as a real event, with the signature computed with your testing secret. Your verification code runs just as it does in production, without exposing your machine and without installing anything.
- The signature expires after 5 minutes, because of the
webhook-timestampcheck. If more time has passed, generate another command. - The email data is sample data: the
iddoes not match any email of yours. - The command is written for a bash-like terminal. On Windows, run it in Git Bash or WSL.
Sample requests, pings and resends are limited to 30 every 10 minutes per account.
Check the production endpoint
A production endpoint only receives real events and the endpoint.ping. To check it after deploying:
- click Send ping on the endpoint: Mailiqo sends an
endpoint.pingsigned with the production secret and the panel shows what your server answered; - send an email from that domain to an address of yours and wait for the
email.delivered; or - resend an earlier delivery from the delivery log.
Receive real events on your machine
To see events from real emails in your local environment you need a tunnel that gives your local port a public https URL, and to configure that URL as the endpoint. Since each domain takes one endpoint, do it on a domain that is not in production.
Before going to production
Check that:
- the signature is verified over the raw body, and a wrong signature is rejected;
- production uses its own secret, not the testing one;
- the server answers
2xxin under 10 seconds and processes the event afterwards; - a repeated event, with the same
webhook-id, is not processed twice; - event types and fields you do not know are ignored without raising an error;
- the outcome does not depend on the order in which events arrive.
