SendGrid Inbound Parse Alternative: Inbound Email by API Call
A SendGrid Inbound Parse alternative: create an address by API call, get a signed webhook, read the message over REST, with SDKs in nine languages.

SendGrid Inbound Parse is how many teams first turned incoming email into an HTTP request. You point a hostname’s MX record at SendGrid, give it a URL, and each message arrives at your server as a form post. If you are looking at a SendGrid Inbound Parse alternative, you probably already have that workflow running: a support intake, a reply-by-email feature, an invoice parser or a test suite that reads codes. This guide shows how the same workflow looks on Mailcycle, with an address made by one API call, a signed webhook, a REST read and SDKs in nine languages.
What we say about SendGrid below comes from its own documentation, read on 28 November 2026. The pages are listed at the end.
How SendGrid Inbound Parse works, from its docs
SendGrid’s setup guide asks you to choose “a dedicated hostname that serves no purpose other than parsing your incoming email”, such as parse.example.com, and to add an MX record for it with the mail server mx.sendgrid.net at priority 10. The docs add that “only authenticated domains may be used when configuring Inbound Parse”, so the hostname sits on a domain you have already authenticated with SendGrid. You then enter a destination URL, which “must be accessible from the internet”.
When mail arrives, “the Parse API will POST the parsed email to a URL that you specify”. By default the body is multipart/form-data with fields such as headers, dkim, to, from, subject, text, html, sender_ip, envelope, charsets, SPF, attachments and attachment-info.
Your endpoint answers with a 2xx status to accept the post. SendGrid queues and retries posts that get a 5xx response, and the docs say messages that cannot be delivered after 3 days are dropped.
What changes when you move to Mailcycle
The shape of the work stays the same: mail arrives, your server hears about it, your code reads the sender, subject, body and files. Three things get simpler.
- The address comes first, the DNS later. You create an address with one API call, on a shared domain that already receives mail. There is no hostname to reserve and no MX record to wait on. Your own domain comes in when you want it, on Scale.
- The webhook is an event, the message is a read. Mailcycle posts a small signed JSON event with the message id. Your code reads the message over REST or with an SDK whenever it is ready, and the message stays at the address for its retention.
- Mail is encrypted the moment it arrives. Each message is sealed to the address’s key as it lands. The SDK opens it in your own process with your recovery phrase.
An address by API call, with no MX setup
On the Operator plan, addresses are created on shared Mailcycle domains. The server adds a random ending to the prefix you give, and the address receives mail as soon as the call returns:
import { Mailcycle } from 'mailcycle-sdk';
const mc = await Mailcycle.withApiKey({
apiKey: process.env.MAILCYCLE_API_KEY!,
phrase: process.env.MAILCYCLE_PHRASE!,
});
const address = await mc.addresses.create({ prefix: 'support', label: 'Support intake' });
console.log(address.emailAddress); // support-x7k2@…
In Python it is one line after the client:
address = mc.addresses.create(prefix="support", label="Support intake")
print(address.email_address)
This changes how you can design an inbound feature. With a parse hostname, every feature shares one domain and your code splits mail by the local part. With addresses made on demand, each customer, each ticket queue, each test run or each agent can have its own address, and the address id in the webhook tells you which one received the mail. The label is sealed on your machine before it is stored. Every address has a retention from 1 to 90 days, 7 by default, so mail clears itself on the schedule you set.
The email addresses guide covers creating, labelling, renaming and deleting addresses, including the raw POST /inboxes call.
The signed webhook receiver
Add a webhook under API > Webhooks in the web app and choose the message.received event. The signing secret, which starts whsec_, is shown once. Each delivery is a JSON POST like this:
{
"id": "evt_4k2m9x7q1b8c3v6n0z5a",
"type": "message.received",
"createdAt": "2026-11-28T09:14:03.000Z",
"payload": { "messageId": "msg_91be02c4a7d1", "inboxId": "ibx_k3v9x2mq7a" }
}
The receiver checks the Mailcycle-Signature header against the raw body before anything else, answers fast, and reads the message after. This Express handler is the one from our webhook tutorial, cut down to its core:
import express from 'express';
import { Mailcycle, verifyWebhookSignature } from 'mailcycle-sdk';
const mc = await Mailcycle.withApiKey({
apiKey: process.env.MAILCYCLE_API_KEY!,
phrase: process.env.MAILCYCLE_PHRASE!,
});
const app = express();
app.post('/webhooks/mailcycle', express.text({ type: 'application/json' }), async (req, res) => {
const rawBody = typeof req.body === 'string' ? req.body : '';
const valid = await verifyWebhookSignature(
process.env.MAILCYCLE_WEBHOOK_SECRET!,
rawBody,
req.get('Mailcycle-Signature'),
);
if (!valid) {
res.status(401).send('Bad signature');
return;
}
const event = JSON.parse(rawBody);
res.status(204).end(); // answer within 10 seconds, then work
if (event.type === 'message.received') {
const message = await mc.messages.get(event.payload.messageId);
console.log(message.from, message.subject, message.text);
}
});
app.listen(3000);
The signature is an HMAC-SHA256, in hex, of the timestamp, a full stop and the raw body, keyed with your secret. The helper compares it in constant time and refuses a timestamp more than five minutes old, which stops an old delivery being replayed. Python has the same check as verify_webhook_signature(secret, raw_body, header), and every other SDK has its own.
For production, the full tutorial adds deduplication on the Mailcycle-Event-Id header, a queue between the answer and the work, a Next.js route handler and a FastAPI version. Read it at Receive email with a webhook rather than copying more of it here.
Reading the message over REST
The webhook tells you a message exists. The read gives you its content. With the SDK that is mc.messages.get(id) in TypeScript or mc.messages.get(message_id) in Python, and the message comes back opened, with these fields:
| Field | What it holds |
|---|---|
from, fromName, replyTo, to |
Sender, display name, reply address and recipient |
subject |
The subject line |
text |
The plain-text body |
html and safeHtml |
The HTML as sent, and a version with remote images and trackers removed |
attachments |
Filename, MIME type, size and contentId for each file |
receivedAt |
When the message landed |
messageId |
The Message-ID header, for threading replies |
Attachments are a separate read, mc.messages.attachment(message, 0), which returns the bytes opened on your machine. That keeps the event and the message small, and lets your code fetch a large file only when it needs it.
Over plain HTTP, the read is GET https://api.mailcycle.email/messages/:id with your API key as a bearer token. The response holds the sealed message, which the SDK opens with your phrase. To read mail without any webhook, GET /inboxes/:id/messages lists an address’s mail newest first, with a cursor for the next page. See Reading mail for folders, read state and attachments.
Mapping Inbound Parse fields to Mailcycle
If your current handler reads form fields, this is where each one lives now.
| Inbound Parse field | Mailcycle |
|---|---|
from |
message.from and message.fromName |
to |
message.to, and event.payload.inboxId for the address that received it |
subject |
message.subject |
text |
message.text |
html |
message.html, or message.safeHtml to render |
attachments, attachment-info |
message.attachments, then messages.attachment(message, index) |
charsets |
Already applied: text and html come back as Unicode strings |
| Your parse hostname | One address per use, made with addresses.create |
A migration usually touches one function: the one that turns the form post into your own record. Replace the form parsing with a signature check and a messages.get, keep the rest of your code as it is, and your tickets, invoices or tests keep working.
SDKs in nine languages
The receiver above is TypeScript, but the same three calls exist in every Mailcycle SDK: create an address, verify a webhook, read a message. The SDKs cover TypeScript, Python, Go, Rust, Java, .NET, PHP, Ruby and Swift, all under Apache-2.0, and each one opens mail with your phrase in your own process.
Each language has its own tutorial for the read side:
- Receive email in Node.js and in Python
- Receive email in Go and in Rust
- Receive email in Java and in C#
- Receive email in PHP, in Ruby and in Swift
The SDK pages list install commands and reference docs for each.
Mail encrypted on arrival
Each address has its own key pair, made from your 12-word recovery phrase on your machine. When a message lands, Mailcycle seals it to that address’s public key before storing it. Webhook events carry ids, never content, so a webhook log, a load balancer log or a tunnel’s inspector holds no one’s email. Your server opens each message with the phrase when it reads it.
Two practical points follow. Keep MAILCYCLE_PHRASE in your secret store with the same care as a database password. And if a no-code tool such as n8n, Make, Zapier or Pipedream needs the plain message, the decrypt Worker runs in your own Cloudflare account, opens one address’s mail and posts the parsed JSON on to your tool. For a workflow built around a parsed post, that is the closest one-to-one swap.
See Encryption for how the keys are made.
Retries, retention and replays
Mailcycle retries a failed webhook delivery after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 12 hours: eight attempts in all, and the message stays at the address the whole time. Any 2xx within 10 seconds counts as delivered. Each delivery stays in the log for 30 days, with its status and last response code, and any finished delivery can be sent again from the log.
The message itself is independent of the webhook. It waits at the address for its retention, so a handler that was down for a deploy can catch up by listing the address. That gives you two ways to recover: replay the event, or read the mail directly.
Own domains on Scale
Many teams want replies to land on their own domain, like support@example.com or invoices@example.com. Custom domains start on the Scale plan, at $19 a month, with 10 domains included. You add the domain, publish one TXT record to prove you own it, then point its nameservers at Mailcycle, and mail routing is set up for you. Scale also lets you choose the whole part before the @, send replies from the API and give AI agents their own inboxes.
The your own domains guide walks through each step, and Role addresses on your own domain shows how to set up support@, billing@ and the rest.
The MCP server for agents
Some inbound workflows end with a person reading the mail. More and more end with an agent: a support agent that drafts a reply, a coding agent that finishes a sign-up, an assistant that files receipts. For those, the mailcycle-mcp server gives the agent its own tools to list addresses, read messages, wait for new mail and read attachments. It runs on the agent’s own machine, and it works with Claude Code, Claude Desktop, Cursor, Codex, VS Code or any other MCP client.
Setup is npx -y mailcycle-mcp pair and a paste into the app. Agents start reply-only, and you choose which addresses each one holds. See the email MCP server guide and email for AI agents.
Which Mailcycle plan fits an Inbound Parse workload
Prices are the ones on pricing, and the limits are in the plans and limits docs.
| Operator | Scale | |
|---|---|---|
| Price a month | $15 | $19 |
| Addresses | 250 | 1,000 |
| Messages received a month | 250,000 | 750,000 |
| API keys and webhooks | Yes | Yes, full API |
| Send from the API | On Scale | Yes |
| Your own domains | On Scale | 10 |
| AI agent inboxes | On Scale | Yes |
Operator is the direct match for an Inbound Parse workload that only receives: API keys, webhooks and a quarter of a million messages a month, on shared domains. Scale fits when you also reply from the API, want your own domains, or hand the inbox to an agent.
Migrating from SendGrid Inbound Parse, step by step
- List what reads the parse post. Usually one route and one function that turns form fields into a record.
- Create an API key on Operator or Scale, and keep it with your recovery phrase in your secret store.
- Create the addresses you need with
addresses.create, one per feature, customer or queue. - Add the webhook for
message.receivedand store thewhsec_secret. - Swap the handler body. Verify the signature, answer
204, then callmessages.getand pass the fields to your existing function, using the mapping table above. - Point senders at the new addresses. Update the reply-to on your outgoing mail, the address in your help pages, or the one your tests submit.
- Run both for a few days if you want to compare, then remove the old route. If you are moving a domain, do that last, on Scale, once the handler is proven on a shared address.
For a full worked example of an inbound feature, with tickets, threading and reply-by-email, read Add inbound email to your SaaS.
Testing the receiver locally
Webhook URLs must be HTTPS with a hostname, so run a tunnel such as Cloudflare Tunnel or ngrok to your local port and add that URL as the webhook. Send test fires a webhook.test event so you can check the signature path before real mail arrives. For unit tests, sign your own sample bodies with the secret.
If your machine has no public URL at all, the event stream delivers the same events over a WebSocket, and mc.messages.waitFor resolves with the next matching message, opened. That suits workers and test suites.
Troubleshooting the switch
The signature check fails
Verify the raw body before any JSON parsing. A body that has been parsed and serialised again is a different string. In Express, use express.text({ type: 'application/json' }) on the webhook route only.
The message comes back with opened: false
The client has no phrase, or the wrong one. Pass MAILCYCLE_PHRASE to withApiKey along with the key.
The webhook shows repeated deliveries
Answer within 10 seconds and do slow work after. Deduplicate on Mailcycle-Event-Id, which is the same on every attempt.
Related reading
- Receive email with a webhook, the full receiver with deduplication and queues
- Add inbound email to your SaaS, support intake with tickets and replies
- Run an n8n workflow on every new email
- Send email with an API in any language
- Postmark inbound alternative and Mailgun inbound Routes alternative, the same move from other inbound providers
- Resend inbound alternative, with webhooks created from code and a Hono receiver
- CloudMailin alternative, for a Rails target that took JSON Normalized POSTs
- Webhooks guide and the developer overview
Sources and dates
Every SendGrid statement above was read on 28 November 2026 from these pages:
| What | Page |
|---|---|
| Hostname, MX record, destination URL and form fields | https://www.twilio.com/docs/sendgrid/for-developers/parsing-email/setting-up-the-inbound-parse-webhook |
| Authenticated domains, POST to your URL, 2xx response, retries and the 3-day drop | https://www.twilio.com/docs/sendgrid/for-developers/parsing-email/inbound-email |
| Inbound Parse settings in the app | https://www.twilio.com/docs/sendgrid/ui/account-and-settings/inbound-parse |
| Parse settings API and multipart/form-data | https://www.twilio.com/docs/sendgrid/api-reference/settings-inbound-parse |
Mailcycle figures come from https://mailcycle.email/pricing and https://docs.mailcycle.email/concepts/plans-and-limits/. SendGrid and Twilio are trademarks of their owners. We are not affiliated with either.
FAQ
What is a good SendGrid Inbound Parse alternative?
Mailcycle, if you want inbound mail without setting up a receiving domain first. You create an address with one API call on a shared domain, get a signed message.received webhook when mail lands, and read the parsed message over REST or with an SDK in TypeScript, Python, Go, Rust, Java, .NET, PHP, Ruby or Swift.
Do I need to change MX records to receive email with Mailcycle?
No. On the Operator plan your addresses live on shared Mailcycle domains that already receive mail, so an address works the moment the API returns it. When you want your own domain, the Scale plan adds 10 of them, and routing is set up for you once the nameservers point at Mailcycle.
Which Mailcycle plan replaces SendGrid Inbound Parse?
Operator, at $15 a month, includes API keys, webhooks, 250 addresses and 250,000 messages received a month. Scale, at $19 a month, adds your own domains, choosing the whole address, sending from the API and AI agent inboxes. Prices are on https://mailcycle.email/pricing.
How does the Mailcycle webhook compare with the Inbound Parse POST?
SendGrid's docs describe a multipart/form-data POST of the parsed email to your URL. Mailcycle sends a small signed JSON event with the message id and the address id, and your code reads the message by id, so the handler stays fast and the message is fetched when you are ready for it.
How do I verify a Mailcycle webhook?
Each SDK has a helper, verifyWebhookSignature in TypeScript and verify_webhook_signature in Python. It checks an HMAC-SHA256 of the timestamp, a full stop and the raw body against your whsec_ secret, and refuses a timestamp more than five minutes old.
What happens if my endpoint is down when mail arrives?
Mailcycle keeps the message and retries the webhook after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 12 hours. The mail itself stays at the address for its retention, 7 days by default and up to 90, so you can also list it over REST at any time.
How is my mail protected?
Mail is encrypted the moment it arrives, with keys from your account's 12-word recovery phrase. The SDK opens each message in your own process when you pass the phrase, and remote trackers are stripped from the safe HTML.
Can an AI agent read the inbound mail instead of my code?
Yes. The mailcycle-mcp server runs on the agent's own machine and gives Claude Code, Claude Desktop, Cursor, Codex or any other MCP client tools to list addresses, read messages and wait for new mail. AI agent inboxes are part of the Scale plan.
Receive email in code
- AgentMail Alternative for AI Agent Inboxes (AgentMail alternative)
- CloudMailin Alternative: Inbound Email to Rails With an Address per API Call (CloudMailin alternative)
- Mailgun Inbound Routes Alternative: Route Mail by Address, Not Regex (Mailgun Routes alternative)
- Mailosaur Alternative for Email Testing and Test Inboxes (Mailosaur alternative)
- Mailparser and Parseur Alternative: Incoming Email as JSON on a Webhook (Mailparser and Parseur alternative)
- MailSlurp Alternative for Email Testing and Test Inboxes (MailSlurp alternative)
- Mailtrap Alternative for Email Testing and Test Inboxes (Mailtrap alternative)
- Postmark Inbound Alternative: Addresses by API, Signed Webhooks (Postmark inbound alternative)
- Resend Inbound Alternative: An Address per API Call, Signed Events (Resend inbound alternative)
- Testmail.app Alternative for Email Testing and Test Inboxes (Testmail.app alternative)
- Test Email Flows on Real Devices with Appium: Read Sign-Up Codes in Python (Appium)
- How to Give a Browser Use Agent an Email Address and Let It Read Its Own Verification Code (Browser Use sign-ups)
- How to Receive Email in C#: Read the Inbox, Save Attachments and Get New Mail Pushed (C# / .NET)
- How to Test Email Verification in Cypress: Receive Sign-Up Codes with cy.task (Cypress)
- Ethereal Email Alternative: Test Nodemailer Emails with an Address per Test (Ethereal Email alternative)
- Golang Receive Email: How to Receive and Read Email in Go (Go)
- How to Read Email in Java: Read the Inbox, Save Attachments and Receive Mail in Spring Boot (Java)
- How to Receive Email in PHP with an Email API: Read the Inbox, Save Attachments and Handle Webhooks (PHP / Laravel)
- How to Receive Email in Python: Read the Inbox, Save Attachments and Get New Mail Pushed (Python)
- Receive Email in Ruby and Rails: Read the Inbox, Save Attachments and Handle Webhooks (Ruby)
- How to Receive Email in Rust: Read the Inbox, Save Attachments and Handle Webhooks in Axum (Rust)
- Add Inbound Email to Your SaaS: Support Intake and Reply-by-Email (SaaS support)
- How to Verify Email in Selenium Tests: Read Sign-Up Codes with Python and pytest (Selenium)
- How to Handle Email Verification in a Stagehand Browser Agent: Create an Address, Wait for the Code, Delete It (Stagehand sign-ups)
- How to Receive Email in Swift: Read the Inbox, Save Attachments and Handle Vapor Webhooks (Swift)
- Test Accounts for Security Testing: a Separate Email Address per Program (Test accounts for security testing)
- How to Automate Email Verification in Tests with Playwright: OTP Codes, Magic Links and Password Resets (Testing email verification)
- How to Receive Email in Node.js: Read the Inbox, Save Attachments and Handle Webhooks (TypeScript / Node.js)
- How to Receive Email with a Webhook: Inbound Email to Your HTTP Endpoint (Webhooks)