Inbound email classification and department routing API
Turn chaotic hello@, info@, and contact@ shared inboxes into clean department routing—with calibrated probabilities for sales, support, finance, and legal plus an automated-reply safety gate.
Subject: Counter-signature for Data Processing Addendum. Attached is our redlined DPA and list of EU subprocessor questions for your DPO.
curl --fail-with-body https://clef-flash.com/api/v1/decisions \
-H "authorization: Bearer $CLEF_API_KEY" \
-H "content-type: application/json" \
--data-binary @- <<'CLEF_DECISION'
{
"model": "cloudflare/clef-flash",
"threshold": 0.85,
"state": "Subject: Counter-signature for Data Processing Addendum. Attached is our redlined DPA and list of EU subprocessor questions for your DPO.",
"questions": {
"department": {
"type": "choice",
"instructions": "Which internal inbox should receive this incoming email?",
"criteria": {
"sales": "pricing quotes, demo requests, procurement or partnerships",
"support": "bug reports, API help, onboarding or usage questions",
"finance": "invoices, W-9 forms, receipts, refunds or wire remittance",
"legal_security": "DPA, GDPR deletion, vulnerability disclosure or terms inquiry"
}
},
"allow_auto_reply": {
"type": "noul",
"instructions": "Is it safe to send an automated acknowledgement with self-serve links?",
"criteria": {
"true": "standard FAQ, receipt lookup or routine sales/support inquiry",
"false": "legal notice, security vulnerability report or angry executive escalation"
}
}
}
}
CLEF_DECISION
Ship this in production with a $19 Pro key
2,000 decisions/day, 8 concurrent requests in flight, text + JSON + image states, and an API key emailed in about a minute.
Stop manual sorting of shared company inboxes
Shared mailboxes like contact@ and support@ mix W-9 vendor requests, GDPR Data Processing Addenda, SDK integration questions, and enterprise sales quotes in one stream. Forwarding rules based on subject keywords break constantly and accidentally send cheery auto-replies to legal notices.
Clef-Flash reads the email subject, sender domain, headers, and body in a single forward pass—picking strictly from your internal departments and returning a calibrated allow_auto_reply probability so sensitive legal or security threads never receive robotic replies.
- Separates finance/AP (W-9, receipts, VAT) from technical support and legal/DPO requests.
- Prevents embarrassing auto-responders on GDPR notices, security reports, or angry escalations.
- Drops straight into Cloudflare Email Workers, Postmark, SendGrid Inbound Parse, or Resend webhooks.
Department routing & auto-reply policy matrix
Every department label maps cleanly to a downstream webhook, Slack channel, or helpdesk group.
| Department Label | Routing Destination | Auto-Reply Gate |
|---|---|---|
| sales | CRM + #sales-inbound | Allowed when P(allow_auto_reply) >= 0.85 |
| support | Helpdesk Tier 1 queue | Allowed with docs/status link |
| finance | Accounting / AP inbox | Allowed with receipt lookup instructions |
| legal_security | DPO / Security on-call | Suppressed (P(allow_auto_reply) low); human only |
Built for Cloudflare Email Workers and serverless mail webhooks
Inbound mail webhooks enforce tight execution timeouts. Because Clef-Flash runs at ~39 ms median model latency and returns compact JSON without verbose prose, an Email Worker or Lambda function can classify and forward every inbound email synchronously before closing the SMTP webhook.
Validate your exact routing payload in the interactive studio above, then deploy with a $19 Pro API key covering up to 2,000 emails per day.
Multi-language routing across global customer bases
Global teams receive inbound emails in English, Spanish, French, German, and Japanese inside the same contact@ alias. Clef-Flash classifies multilingual messages natively into one canonical set of English department keys so your downstream automation stays unified.
Frequently asked questions
Can Clef-Flash run inside a Cloudflare Email Worker webhook?
Yes. POST /api/v1/decisions is a standard stateless HTTPS JSON call with ~39 ms median model latency, making it ideal for Cloudflare Workers, Postmark, and Resend inbound hooks.
How does the auto-reply safety gate protect legal or security emails?
Pair your department choice question with a boolean allow_auto_reply noul question. Your worker only sends an automated acknowledgement when allow_auto_reply clears your chosen confidence threshold.
Does it work if emails arrive in Spanish, French, or German?
Yes. Clef-Flash is post-trained on multilingual Qwen3.5-9B weights and routes multilingual emails cleanly into your fixed English queue keys.
How large of an email thread can I pass in one request?
Paid keys on /api/v1/decisions accept up to 24,576 tokens (100,000 characters) on Clef-Flash—enough for long forwarded reply chains.
Keep reading
- Support ticket triage API
- Document classification API
- Lead qualification scoring API
- Intent classification API
- Pricing & API keys
Model notes
One short email when a new decision model lands or a benchmark changes. No spam, unsubscribe in one click.