A webhook is a URL in your app that Mailcandor calls when something happens: an email is delivered, bounces, is marked as spam, or a reply arrives. You add the URL once, choose the events, and Mailcandor sends a signed POST with a JSON body for each event.
Before you start
- You need the Admin or Developer role on the team.
- Your endpoint must be reachable at a public
https://address. Mailcandor refuseshttp://URLs, URLs with a username or password in them, and hosts that resolve to private, local or reserved IP addresses. - The endpoint should answer with any
2xxstatus within 10 seconds. Mailcandor does not follow redirects, so give the final URL.
Create a webhook in the dashboard
- Open Webhooks in the left menu.
- Press Add webhook.
- In Endpoint URL, enter your address, for example
https://yourapp.com/webhooks/mailcandor. - Under Events, tick the events you want. You must pick at least one. The list is grouped into Email, Domain, Suppression, Review, Inbound and Contact events.
- Press Add webhook.
- The page now shows Your signing secret. Copy it into your app’s secrets (for example an environment variable such as
MAILCANDOR_WEBHOOK_SECRET), then press Done.
If you lose the secret, open the webhook and press Show signing secret.
Create a webhook with the API
Use a full-access API key. Sending-only keys cannot manage webhooks.
curl https://api.mailcandor.com/v1/webhooks \
-H "Authorization: Bearer $MAILCANDOR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/mailcandor",
"events": ["email.delivered", "email.bounced", "email.complained"]
}'
The answer is 201 with the webhook and its signing_secret:
{
"id": "6a1f0c2e-1b7d-4a55-9c1e-2f3a4b5c6d7e",
"url": "https://yourapp.com/webhooks/mailcandor",
"events": ["email.delivered", "email.bounced", "email.complained"],
"status": "enabled",
"signing_secret": "mcws_..."
}
The API shows the secret only in this response (and when you rotate it), so store it straight away. Always send an events list with at least one event: an empty or missing list is refused with a 422.
Change, pause or delete a webhook
Open the webhook in the dashboard. The buttons at the top are:
| Button | What it does |
|---|---|
| Turn off / Turn on | Stops or restarts deliveries. Events that happen while it is off are not sent and cannot be replayed later. |
| Edit | Change the URL or the events. |
| Show signing secret | Shows the current secret. |
| Rotate secret | Makes a new secret. The old one stops working at once. |
| Delete | Stops sending and removes the delivery history. |
With the API, use PATCH /v1/webhooks/{id} with any of url, events or status ("enabled" or "disabled"), and DELETE /v1/webhooks/{id}.
Check that it works
Send yourself a test email (open Emails and press Send a test email), then open the webhook. The Deliveries table lists each event with its status and number of attempts. Press Details to see what your endpoint answered.
If it does not work
- “Use an https:// URL.” Your URL starts with
http://. Use HTTPS. - “This URL points to a private or reserved address.” The host resolves to an internal IP. Use a public endpoint.
- “We could not find … in DNS.” The hostname does not resolve yet. Check the spelling and your DNS.
- “A team can have 10 webhook endpoints.” Delete one you no longer use.
- No Add webhook button. Your role is Viewer. Ask an admin to change it on the Team page.
- Deliveries show failed attempts. See Webhook not receiving events.
Next, verify the signature on every request, and read the events reference to see what each payload holds. The full API is at docs.mailcandor.com.