Enquiry InboxDocs

Guides

How it works

  • POST /api/submit — public, CORS-open intake. Accepts URL-encoded, multipart and JSON bodies. Special fields: _site, _form, _page, _redirect (same-site only), _gotcha (honeypot). Passwords, card data, OTPs, CAPTCHA/CSRF tokens and files are never stored. Limited to 20 submissions per client every 10 minutes. Spam (rules in src/lib/spam.ts) gets a normal success response and nothing is stored; each drop logs an enquiry_spam_dropped event with the rule that matched. One signal is enough for known bots: the "Robert" + random letters name, *leadgen* sender domains, a link in the name, a token name such as NARTYTRYUT772590NERTHRRTH, ruble payout and Cyrillic link scams, telegra.ph and .buzz links, and "earn $50,000,000". Sales templates (lead-gen callback services, SEO and indexing offers, contact-form blasting, product promotions) are dropped when two or more of their phrases appear, because a real enquiry may use one.
  • public/capture.js — copies every <form> submit on a page to the inbox via sendBeacon without touching the original form. Skips search forms and anything marked data-enquiry-ignore.
  • / and /setup — the inbox and the connection guide, both locked behind the EDIT_PASSCODE secret because enquiries contain personal data.
  • GET /api/enquiries, PATCH|DELETE /api/enquiries/:id, GET /api/enquiries/export — session-protected inbox API.
  • GET|POST /api/enquiries/:id/messages — session-protected. Lists the conversation (enquiry_messages, direction out or in), or emails a reply through the EMAIL (send_email) binding with In-Reply-To/References set, stores it and marks the enquiry replied. The visitor's original fields are quoted under the reply.
  • PATCH /api/domains/:id (replyFrom, senderName) and POST /api/domains/:id/test-email — per-domain sender settings, and a test send from the domain's own address to FORWARD_TO with no fallback.
  • custom-worker.ts — wraps the OpenNext worker and adds the email() handler (src/lib/inbound.ts) for mail that Email Routing sends to this Worker.
Last updated 2 November 2026