---
title: "Email webhook payload | WebhookRelay"
meta:
  "og:description": "Reference for the JSON payload Webhook Relay delivers for an inbound email: from, from_name, recipient, to, cc, subject, date, message_id, text, html, headers, spf, dkim, dmarc and attachments (with base64 content)."
  "og:title": "Email webhook payload"
  description: "Reference for the JSON payload Webhook Relay delivers for an inbound email: from, from_name, recipient, to, cc, subject, date, message_id, text, html, headers, spf, dkim, dmarc and attachments (with base64 content)."
---

![Stripes](https://webhookrelay.com/docs/email/payload/images/stripes.svg)

Documentation

**Fundamentals**

# **Email webhook payload**

Reference for the JSON payload Webhook Relay delivers for an inbound email: from, from_name, recipient, to, cc, subject, date, message_id, text, html, headers, spf, dkim, dmarc and attachments (with base64 content).

Each inbound email is parsed server-side and delivered as a JSON `POST` with `Content-Type: application/json` and an `X-Webhookrelay-Source: email` header. Empty fields are omitted, so a plain-text email with no attachments won't include `html`, `cc` or `attachments`.

## [Example (HTML email with an attachment)](#example-html-email-with-an-attachment)

```
{
  "from": "jon@example.com",
  "from_name": "Jon Snow",
  "recipient": "5519fb0d-997a-46cd-b102-ac990b4c38fa@in.webhookrelay-mail.com",
  "to": ["5519fb0d-997a-46cd-b102-ac990b4c38fa@in.webhookrelay-mail.com"],
  "cc": ["team@example.com"],
  "subject": "Invoice #1042",
  "date": "Fri, 26 Jun 2026 11:27:41 +0400",
  "message_id": "C70BE3E7-4B20-4240-A1B8-2D19E0032FFD@gmail.com",
  "text": "Hi, your invoice is attached.\r\n",
  "html": "<p>Hi, your invoice is <b>attached</b>.</p>",
  "headers": {
    "From": "Jon Snow <jon@example.com>",
    "To": "5519fb0d-997a-46cd-b102-ac990b4c38fa@in.webhookrelay-mail.com",
    "Subject": "Invoice #1042",
    "Content-Type": "multipart/mixed; boundary=...",
    "Return-Path": "<jon@example.com>"
  },
  "spf": "pass",
  "dkim": "pass",
  "dmarc": "pass",
  "attachments": [
    {
      "name": "invoice.pdf",
      "content_type": "application/pdf",
      "size": 48213,
      "content": "JVBERi0xLjQKJ..."
    }
  ]
}
```

## [Fields](#fields)

| Field | Type | Notes |
| --- | --- | --- |
| `from` | string | Sender address, lower-cased (e.g. `jon@example.com`). |
| `from_name` | string | Sender display name, if present (e.g. `Jon Snow`). Omitted when empty. |
| `recipient` | string | The inbound address that matched — your email input's `<uuid>@in.webhookrelay-mail.com`. |
| `to` | string | All `To` addresses. |
| `cc` | string | All `Cc` addresses. Omitted when empty. |
| `subject` | string | The email subject. |
| `date` | string | The `Date` header, as sent (RFC 2822, e.g. `Fri, 26 Jun 2026 11:27:41 +0400`). |
| `message_id` | string | The `Message-ID`, useful for de-duplication. |
| `text` | string | Plain-text body. Omitted when the email has no text part. |
| `html` | string | HTML body. Omitted when the email has no HTML part. |
| `headers` | object | All parsed headers as a string map (`From`, `To`, `Return-Path`, `Received-Spf`, DKIM signatures, etc.). |
| `spf` | string | SPF result: `pass`, `fail`, `softfail`, `neutral`, `none`, … |
| `dkim` | string | DKIM result: `pass`, `fail`, `none`, … |
| `dmarc` | string | DMARC result: `pass`, `fail`, `none`, … |
| `attachments` | object | Attachments. Omitted when there are none, or when [attachments are dropped](https://webhookrelay.com/docs/email/payload/docs/email/filtering-and-policy/). |

### [Attachment object](#attachment-object)

| Field | Type | Notes |
| --- | --- | --- |
| `name` | string | The attachment filename. |
| `content_type` | string | MIME type, e.g. `application/pdf`, `image/png`. |
| `size` | number | Size in bytes. |
| `content` | string | The attachment bytes, **base64-encoded**, inlined in the JSON. Omitted when dropped or truncated. |
| `truncated` | boolean | `true` when the content was stripped or the per-message attachment cap was exceeded — the metadata (`name`, `content_type`, `size`) is still present, but `content` is omitted. See [policy](https://webhookrelay.com/docs/email/payload/docs/email/filtering-and-policy/). |

## [Using the fields in a transform](#using-the-fields-in-a-transform)

Attach a [function](https://webhookrelay.com/docs/email/payload/docs/webhooks/functions/) to reshape the email before it reaches your endpoint — for example to extract just what you need, or to build a chat message:

```
const email = JSON.parse(r.body);
const slack = {
  text: \`:email: *${email.subject}* from ${email.from_name || email.from}\n${email.text}\`
};
r.setBody(JSON.stringify(slack));
r.setHeader("Content-Type", "application/json");
```

See the [webhook → Slack/Discord/Teams formatter](https://webhookrelay.com/docs/email/payload/webhook-message-formatter/) to build that message visually and copy the function.

Did this page help you?