---
title: "Capture email events with Webhooks"
slug: webhooks
description: "Learn how to receive real-time notifications about your email sending activities directly to your server."
created_at: "2023-03-08"
updated_at: "2025-02-26"
image: https://cdn.resend.com/posts/webhooks.jpg
humans: ["bu-kinoshita"]
category: "product"
---

We’re excited to announce one of our most requested features: Webhooks.

## What is a Webhook?

A webhook is a way for one application to provide other applications with real-time information. In our case, we send a notification to your application every time an email event occurs. This allows you to receive real-time and actionable updates on the delivery, open, bounce, and click events of your emails.

<blockquote>
  "Working with Resend has been amazing. By using Webhooks, I'm able to track
  email opened/clicked events via Segment and log those events in LogSnag for
  visibility. I highly believe in the people behind Resend."
  <div class="quote-metadata">
    <div class="quote-avatars">
      <div class="quote-avatar">
        <img
          alt="Finta"
          src="https://cdn.resend.com/posts/logo-finta.jpg"
          width="40"
          height="40"
        />
      </div>
      <div class="quote-avatar quote-avatar-author">
        <img
          alt="Taylor Facen"
          src="/static/avatars/taylor-facen.jpg"
          width="40"
          height="40"
        />
      </div>
    </div>
    <span class="quote-author">
      <span class="quote-author-name">Taylor Facen</span>
      <span class="quote-author-job">Founder of Finta</span>
    </span>
  </div>
</blockquote>

## What can you build with Webhooks?

Webhooks use HTTPS and deliver a JSON payload which includes metadata like the from, to, and status of your email event. You can use email webhooks to automate your workflows, like:

- Automatically remove bounced email addresses from mailing lists
- Create alerts in your messaging or incident tools based on event types
- Store all send events in your own database for custom reporting/retention
- Expose email events in your app

## Setting up

For how powerful webhooks are, they could not be more straightforward to get started.

<blockquote>
  "Resend is super easy to set up. Loving the modern approach the team is taking
  with supercharging email. Never been a fan of other clunky tools."
  <div class="quote-metadata">
    <div class="quote-avatars">
      <div class="quote-avatar">
        <img
          alt="Hammr"
          src="https://cdn.resend.com/posts/logo-hammr.jpg"
          width="40"
          height="40"
        />
      </div>
      <div class="quote-avatar quote-avatar-author">
        <img
          alt="Brek Goin"
          src="/static/avatars/brek-goin.jpg"
          width="40"
          height="40"
        />
      </div>
    </div>
    <span class="quote-author">
      <span class="quote-author-name">Brek Goin</span>
      <span class="quote-author-job">Founder of Hammr</span>
    </span>
  </div>
</blockquote>

First, create an endpoint to receive `POST` requests (or use a tool like [Zapier](https://zapier.com/features/webhooks)).

For example, you can add an API route on Next.js:

```jsx
import type { NextApiRequest, NextApiResponse } from 'next';

export default (req: NextApiRequest, res: NextApiResponse) => {
  if (req.method === 'POST') {
    const payload = req.body;
    console.log(payload);
    res.status(200);
  }
};
```

Then [register your webhook](https://resend.com/webhooks) endpoint on Resend.

![Resend Webhooks](https://cdn.resend.com/posts/webhooks-1.jpg)

Now every time an email event occurs, Resend will send a `POST` request to your endpoint with the event payload.

## Check the full example

We built a [GitHub repository](https://github.com/resend/resend-examples/tree/main/with-webhooks) that shows a Slack notification being triggered from Resend webhooks using Next.js and TypeScript.

![Slack Webhook Example](https://cdn.resend.com/posts/webhooks-2.jpg)

## What’s next?

We’re excited to see what you build with webhooks. For more information on each event types, retry schedule, and delivery attempts, check the [Webhooks docs](https://resend.com/docs/webhooks).
