PolpoMail
Webhooks

New email, delivered to your app as JSON

Get every incoming message, or only the ones you care about, as an HTTP POST to your own endpoint the moment it arrives. Included free on every plan.

Webhooks sending support mail to a helpdesk, sales mail to a CRM and invoices to accounting
Route support@ to your helpdesk, sales@ to your CRM and invoices to accounting, each with its own filter.
Creating a webhook: endpoint URL, sender and recipient filters, headers and extra JSON fields
Filters, custom headers, extra JSON fields and a test button, all in one form.
How it works

Three settings, no polling

  1. 1

    Add your endpoint

    In Settings › Developer, enter the URL of your app, an automation tool or a small function. Up to 5 webhooks per mailbox.

  2. 2

    Choose which mail

    Match the sender, or any To or Cc address, with a wildcard like *@gmail.com or a regular expression. Leave both empty to get everything.

  3. 3

    Receive and verify

    Each matching message is POSTed as JSON or plain text, with a request token so you know it came from us.

Features

Built for real integrations

Everything you'd otherwise write an IMAP poller for.

Filters on From, To and Cc

Wildcards or regular expressions, matched without regard to case. Set both and a message must match both.

JSON or plain text

Structured JSON with sender, recipients, subject, text and HTML bodies and attachments, or a simple text version.

Your own fields and headers

Add fields to the JSON, such as a queue or a pipeline, and send headers like Authorization for your API.

Request token and signature

Every request carries the webhook's own token, plus an HMAC-SHA256 signature with a timestamp to block replays.

Retries and status

Failed deliveries are retried after 30 seconds and 5 minutes. The last result of each webhook is always on screen.

Test with sample data

Send a realistic test message to your endpoint before saving, and see the status code and response it returned.

Payload

What your endpoint receives

The message id works with the REST API, so you can download attachments, move the message or reply.

{
  "account": "you@yourcompany.com",
  "delivery_id": "dlv_3kq9…",
  "event": "message.received",
  "message": {
    "id": 1187,
    "mailbox": "INBOX",
    "message_id": "test-f46f4ce2753b18b9@example.com",
    "date": "2026-11-28T19:46:41Z",
    "from": {
      "name": "Jane Example",
      "address": "jane@example.com"
    },
    "to": [
      {
        "name": "",
        "address": "you@yourcompany.com"
      }
    ],
    "cc": [
      {
        "name": "Sam Example",
        "address": "sam@example.org"
      }
    ],
    "reply_to": [],
    "subject": "Test message: order #1042 shipped",
    "text": "Hi,\n\nThis is a test message sent from the Developer settings page.\nYour webhook is working.\n\nJane",
    "html": "\u003cp\u003eHi,\u003c/p\u003e\u003cp\u003eThis is a test message sent from the Developer settings page.\u003cbr\u003eYour webhook is working.\u003c/p\u003e\u003cp\u003eJane\u003c/p\u003e",
    "truncated": false,
    "attachments": [
      {
        "index": 2,
        "filename": "invoice-1042.pdf",
        "content_type": "application/pdf",
        "size": 48213,
        "url": "https://polpomail.com/api/v1/messages/1187/attachments/2"
      }
    ],
    "size": 52741
  },
  "queue": "support",
  "timestamp": "2026-11-28T19:46:41Z",
  "webhook_id": 3
}

Request headers

X-Polpo-Webhook-Token
The webhook's request token. Compare it with yours.
X-Polpo-Signature
t=<unix time>,v1=<HMAC-SHA256> of t.body, keyed with the token
X-Polpo-Delivery
Unique for each message, the same across retries, so you can skip duplicates
X-Polpo-Event
message.received or webhook.test
Your headers
Up to 10, such as Authorization

Verify in a few lines

token = request.headers["X-Polpo-Webhook-Token"]
if not hmac.compare_digest(token, MY_TOKEN):
    abort(401)

Answer with any 2xx status. The full guide, including signature checks, is in the developer docs.

Use cases

What teams build with webhooks

FAQ

Webhook questions

Do webhooks cost extra?

No. Webhooks are included on the free plan, with up to 5 webhooks per mailbox.

Which emails trigger a webhook?

New mail that reaches the mailbox, after inbox rules have run, including mail that is forwarded. Messages filed as spam in the Junk folder don't trigger webhooks, and neither does mail you send.

Are attachments included?

Each attachment is listed with its name, type, size and a REST API download link. The file content isn't included, so requests stay small; download what you need with an access token that has the read scope. Text and HTML bodies over 256 KB are shortened and marked as truncated.

What happens if my endpoint is down?

Network errors, timeouts, and 408, 429 and 5xx answers are retried after 30 seconds and again after 5 minutes. Other 4xx answers aren't retried. After 50 failed deliveries in a row the webhook is paused and you get an email. The message itself is always kept in your mailbox.

How do I know a request really came from Polpo Mail?

Every webhook has its own request token, sent in the X-Polpo-Webhook-Token header. Compare it with the token shown in Settings › Developer. For stronger checks, verify the X-Polpo-Signature header, an HMAC-SHA256 of the timestamp and body keyed with the token, and reject old timestamps.

Can webhooks reach servers on my private network?

No. Endpoints must be reachable on the public internet; private, loopback and cloud metadata addresses are blocked, even through DNS. Use a public URL, for example behind your reverse proxy.

Connect your inbox to your app today.

Business email on your own domain, with webhooks and a REST API, free for up to 10 mailboxes.

Create your free workspace