
Twilio Sendgrid Inbound Parse
- 103 installs
- 26 repo stars
- Updated July 29, 2026
- twilio/ai
How to receive and parse inbound email via SendGrid Inbound Parse webhooks with MX record setup, payload handling, attachment processing, and webhook security.
About
Twilio SendGrid Inbound Parse converts incoming emails into HTTP POST requests to your webhook endpoint. The service receives email via MX record configuration, offering parsed mode (default) with extracted fields like sender, subject, body, and attachments, or raw mode for full MIME content. Key setup involves pointing domain MX records to mx.sendgrid.net and registering webhook endpoints in SendGrid Console. Supports attachment handling and signed webhook verification for security. Handles email payloads up to 30MB with form-data delivery in parsed mode. Essential for building email-driven workflows without disrupting existing email infrastructure by using subdomains.
- MX record setup and subdomain configuration to avoid disrupting existing email
- Parsed mode extracts sender, subject, text, HTML, envelope, and attachment metadata
- Raw mode delivers full MIME message for header access and non-standard parts
- ECDSA signed webhooks for cryptographic payload verification from SendGrid
- 30MB email size limit with no built-in filtering or rate limiting
Twilio Sendgrid Inbound Parse by the numbers
- 103 all-time installs (skills.sh)
- +6 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #2,984 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
twilio-sendgrid-inbound-parse capabilities & compatibility
- Capabilities
- receive inbound email via webhooks · parse email fields (sender, subject, body, html) · extract and handle file attachments · support raw mime mode for custom parsing · verify webhook signatures with ecdsa · access email envelope data (to, from arrays)
- Works with
- stripe · slack
- Use cases
- code review · api development · email · web scraping
What twilio-sendgrid-inbound-parse says it does
Inbound Parse converts incoming email into HTTP POST requests to your webhook endpoint. SendGrid receives the email at your domain's MX records and forwards the parsed content to your application.
npx skills add https://github.com/twilio/ai --skill twilio-sendgrid-inbound-parseAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 103 |
|---|---|
| repo stars | ★ 26 |
| Last updated | July 29, 2026 |
| Repository | twilio/ai ↗ |
What it does
Receive and process inbound email via SendGrid webhooks for support tickets, email parsing pipelines, and email-to-app workflows.
Who is it for?
Email processing pipelines, support ticket creation from email, email forwarding workflows, automated email routing, inbound email validation.
Skip if: Outbound email sending (use twilio-sendgrid-email-send), email filtering before delivery, multi-endpoint routing per address, guaranteed delivery order.
When should I use this skill?
Building email-driven workflows, integrating email into applications, implementing support ticket systems, processing attachments from email.
What you get
Webhook endpoint receives parsed or raw email content with attachments. Emails are converted to structured data for application processing with verified authenticity.
- Configured MX records pointing to mx.sendgrid.net
- Webhook endpoint accepting and validating POST payloads
- Email field extraction logic (from, subject, text, html, envelope)
By the numbers
- 30MB maximum inbound email size limit
- Form-data POST format for parsed mode delivery
- ECDSA cryptographic signature verification available
Files
Overview
Inbound Parse converts incoming email into HTTP POST requests to your webhook endpoint. SendGrid receives the email at your domain's MX records and forwards the parsed content to your application.
---
Setup
1. Configure MX records: Point your domain (or subdomain) to mx.sendgrid.net 2. Add webhook: SendGrid Console > Settings > Inbound Parse > Add Host & URL 3. Choose mode: Parsed (default) or Raw
Subdomain recommended: Use inbound.yourdomain.com to avoid disrupting existing email on yourdomain.com.
---
Parsed Mode (Default)
SendGrid extracts fields and POSTs them as form data:
| Field | Description |
|---|---|
from | Sender address ("Name <email@example.com>") |
to | Envelope recipient |
subject | Email subject line |
text | Plain text body |
html | HTML body |
envelope | JSON string with to array and from |
attachments | Number of attachments (as string) |
attachment-info | JSON metadata for each attachment |
attachment1, attachment2... | Actual attachment files |
Python (Flask)
from flask import Flask, request
import json
app = Flask(__name__)
@app.route("/inbound", methods=["POST"])
def handle_inbound():
sender = request.form.get("from")
subject = request.form.get("subject")
text_body = request.form.get("text")
html_body = request.form.get("html")
envelope = json.loads(request.form.get("envelope", "{}"))
attachment_count = int(request.form.get("attachments", "0"))
print(f"From: {sender}, Subject: {subject}")
for i in range(1, attachment_count + 1):
attachment = request.files.get(f"attachment{i}")
if attachment:
print(f"Attachment: {attachment.filename}, {attachment.content_type}")
return "", 200Security: All inbound email content (from,subject,text,html, attachments) is untrusted external input. Sanitize HTML to prevent XSS before rendering. If feeding content to an LLM, isolate it as user input — never concatenate into system prompts. Verify webhook authenticity using signed webhooks (see Security section below).
---
Raw Mode
Posts the entire MIME message as rawEmail field. Use when you need full headers, DKIM signatures, or non-standard MIME parts. You must parse the MIME message yourself.
---
Signed Inbound Parse Webhook (Security)
SendGrid supports ECDSA signature verification for Inbound Parse, the same mechanism used for Event Webhooks. Enable it to cryptographically verify that payloads originate from SendGrid.
Strongly recommended over IP allowlisting — SendGrid's webhook traffic comes from dynamic cloud infrastructure where IPs change frequently. Signature verification is more reliable and secure.
---
CANNOT
- Cannot use Inbound Parse on a domain that already receives email — MX records must point to
mx.sendgrid.net. Use a subdomain to avoid disrupting existing email (e.g., Google Workspace, Microsoft 365). - Cannot receive email without MX record changes — DNS access is required. If you can't modify MX records, you can't use Inbound Parse.
- Cannot receive emails larger than 30MB — Inbound messages exceeding 30MB are rejected.
- Cannot filter inbound email before it hits your webhook — All email sent to the configured domain reaches your endpoint. Implement filtering in your handler.
- Cannot route to different endpoints per address — All mail for the configured domain/subdomain goes to a single webhook URL.
- Cannot guarantee delivery order — Emails may arrive at your webhook out of order, especially under high volume.
- No built-in rate limiting — All email to your configured domain reaches your endpoint. Implement rate limiting, payload size validation, and content sanitization in your handler.
---
Next Steps
- Send email:
twilio-sendgrid-email-send - Delivery tracking:
twilio-sendgrid-webhooks - Account setup:
twilio-sendgrid-account-setup
interface:
display_name: "SendGrid Inbound Parse"
short_description: "Receive inbound email via SendGrid Inbound Parse webhook. Covers MX record setup, parsed vs raw mode, handling attachments, and common pitfalls."
icon_small: "./assets/icon-small.png"
icon_large: "./assets/icon-large.png"
brand_color: "#EF223A"
default_prompt: "How do I receive and process inbound emails with SendGrid?"
policy:
allow_implicit_invocation: true