Guide
How to trigger an AI agent from an email
Turn an inbox address into an automation entry point. Point an alias at an HTTPS endpoint and every inbound email is delivered to your app as signed JSON — a ready-made trigger for an AI agent, a script, or a no-code workflow. Webhook forwarding is a Pro feature.
The idea
Instead of forwarding an alias to an inbox, forward it to a URL. When mail arrives at, say, [email protected], we POST the parsed message to your endpoint. Your code — or an automation tool — reads the subject and body and does something useful: summarize the thread, open a ticket, draft a reply, or kick off an agent run.
Set up a webhook alias
- On a verified domain, create an alias and set delivery to A webhook (HTTPS endpoint).
- Enter your HTTPS URL, for example
https://api.yourapp.com/inbound. - Send a test email to the alias and confirm your endpoint receives the JSON body.
What the payload looks like
Each message is delivered as JSON with the sender, recipient alias, subject, parsed text and html, threading headers, attachment metadata, and the full raw_mime. The exact fields and signature scheme are in the webhook reference.
Verify the signature
Every request carries an X-ForwardMailTo-Signature header — an HMAC-SHA256 over timestamp + "." + rawBody using your account signing secret. Always compute the HMAC against the raw request body before any JSON re-serialization, compare in constant time, and reject stale timestamps to prevent replay. The reference includes Node and Python examples.
No code: n8n, Zapier, or Make
Don't want to run a server? Point the alias at a webhook node in your automation tool, feed the text field into an AI step (OpenAI, Claude, and so on), and route the result wherever you like — a spreadsheet, a ticket, or a Slack message. An incoming email becomes the trigger; the AI step does the work.
Good to know
- Endpoints must be public HTTPS. Requests to private or loopback addresses are blocked.
- Non-2xx responses are retried with backoff — de-duplicate on
message_id. - Attachments arrive as metadata; parse
raw_mimeif you need the file contents.