> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/inbound-email/webhooks.md).

# Webhooks

In this article, you'll learn how to configure Mailtrap webhooks to get notified about every new message you receive in your inbound email inbox.

### How it works

When a new email arrives, Mailtrap POSTs a JSON payload to your webhook URL. The payload includes an `events` array where each object contains the event (`inbound.message_received`), a unique event ID, a Unix timestamp, the inbox ID, the Mailtrap message ID, and the sender name.

Payloads are signed with HMAC-SHA256 via the `mailtrap-signature` header so you can verify they came from Mailtrap. Failed deliveries retry with exponential backoff — up to 10 attempts over 24 hours.

#### Step 1. Either [create your webhook via API](https://docs.mailtrap.io/developers/email-sending/webhooks) or go to [Mailtrap webhooks](https://mailtrap.io/webhooks), click on Create New Webhook

#### Step 2. Add your Webhook URL, select Inbound Inboxes, and select your Inbox

<figure><img src="/files/kJMLeQfUyMvTtQ41iXG0" alt=""><figcaption></figcaption></figure>

#### Step 3. Once you receive a message in your Inbound Inbox, you should see the following output from your webhook:

<figure><img src="/files/soCShH6qh1YAK39kzlyM" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mailtrap.io/inbound-email/webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
