> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Get instant pings when stuff happens to your emails. Like a little notification bell, but for your server.

# Webhooks 🔔

Imagine you send an email and you want to know the moment it's delivered. Or the moment someone clicks a link. Or if it bounced.

That's what webhooks are for. Instead of constantly checking ("did it deliver? did it deliver?"), Mailofly pings your server the instant something happens. Like a walkie-talkie call at exactly the right moment.

***

## How it works

```mermaid theme={null}
sequenceDiagram
    participant You as Your Server
    participant Mail as Mailofly
    participant Person as Recipient

    Mail->>Person: Sends Email
    Person->>Mail: Opens the email 👀
    Mail->>You: POST /your-webhook (email.opened)
    You-->>Mail: 200 OK 👍
```

1. You register a URL (your server's address) in the Mailofly dashboard
2. When an email event happens, Mailofly sends a `POST` request to your URL with all the details
3. Your server reads the info, does whatever it needs to do, and responds with `200 OK`

Simple as that.

***

## Setting up a webhook

1. Go to **Settings** → **Webhooks** in your dashboard
2. Click **Add Webhook**
3. Enter your HTTPS endpoint URL (e.g. `https://yourapp.com/webhooks/mailofly`)
4. Choose which events you want to listen for (delivered, clicked, bounced, etc.)
5. Copy the **Signing Secret** (`whsec_...`) — you'll use this to verify requests are actually from Mailofly

***

## What's next

* [Event types & what they contain](/docs/webhooks/event-types.md) — see all the events and their payloads
* [Verifying webhook signatures](/docs/webhooks/verify-signatures.md) — make sure the pings are really from Mailofly
* [Retries & debugging](/docs/webhooks/retries-and-debugging.md) — what happens when your server doesn't respond


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.