Turn support emails into an AI-powered helpdesk.
Don't build your own email ingestion layer. Receive support tickets as clean JSON with AI-extracted intent over webhooks, then pass them to your LLM to draft replies instantly.
// POST /api/webhooks/inboxparse
export async function POST(req: Request) {
// Fires once AI labeling and summarization are done
const { event, data } = await req.json();
if (event !== 'email.ai_processed') return new Response('Ignored');
// Fetch the AI-enriched email by ID
const res = await fetch(
`https://inboxparse.com/api/v1/emails/${data.messageId}`,
{ headers: { Authorization: `Bearer ${process.env.INBOXPARSE_API_KEY}` } }
);
const { data: email } = await res.json();
// email.content.markdown - LLM-ready body
// email.ai - summary, labels, action, suggested_response
if (email.ai.labels.some((l) => l.name === 'bug_report')) {
await createJiraTicket({
title: email.subject,
description: email.content.markdown,
});
}
if (email.ai.action === 'reply_now') {
await draftAiResponse(email);
}
return new Response('OK');
}Agent-Ready Data
Stop feeding raw HTML and quoted replies to your LLM. InboxParse cleans messages into Markdown and reconstructs the full thread context.
Built-in Intent Extraction
InboxParse analyzes every incoming email asynchronously. By the time the email.ai_processed webhook fires, summaries, labels, suggested actions, and draft replies are ready to fetch.
Zero Infrastructure
No IMAP polling loops, no OAuth token refresh logic. Connect the shared support@ mailbox once, and listen for simplified webhooks.
Instant Delivery
Configure a webhook endpoint and receive JSON payloads the second a customer emails you. Reply within seconds.
Focus on AI, Not Email
Spend your time engineering the perfect prompt and agent logic, not fighting MIME parsing edge cases.
Secure & Private
Data is encrypted at rest and in transit. Scoped access ensures your AI only reads what it needs.
2. Draft and send reply with AI
Copy-and-paste ready. No boilerplate.
import { generateText } from 'ai';
import { google } from '@ai-sdk/google';
async function draftAiResponse(email: any) {
// 1. Generate reply using Vercel AI SDK
// (email.ai.suggested_response is a ready-made draft if you
// want to skip your own model call entirely)
const { text: aiReply } = await generateText({
model: google('gemini-flash-latest'),
system: `You are a helpful customer support agent.
AI summary of the ticket: ${email.ai.summary}`,
prompt: `Draft a polite reply to this message: ${email.content.markdown}`
});
// 2. Send the reply via InboxParse API
await fetch('https://inboxparse.com/api/v1/emails/reply', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.INBOXPARSE_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
email_id: email.id,
mailbox_id: process.env.SUPPORT_MAILBOX_ID, // your support@ mailbox
body: aiReply // InboxParse handles HTML formatting
})
});
}Frequently asked questions
How does InboxParse detect email intent?+
InboxParse analyzes every incoming email with AI and attaches your workspace labels (e.g. bug_report, billing_issue), a summary, a suggested action, and a draft reply. Fetch the enriched email by ID as soon as the email.ai_processed webhook fires.
Can I use InboxParse to auto-reply to support emails?+
Yes. Fetch the AI-enriched email when your webhook fires - clean Markdown plus a ready-made suggested_response draft - optionally refine it with your own LLM, and send it back through the InboxParse reply API. The entire loop can be fully automated.
Do I need to build my own email ingestion layer?+
No. InboxParse handles IMAP polling, OAuth token refresh, MIME parsing, and HTML-to-Markdown conversion. You receive clean, structured JSON over webhooks and focus on your AI logic.
Explore more use cases
Build your AI helpdesk today.
Start with our Developer plan and replace your legacy parser with an AI-native ingestion layer.