# Doorman > Doorman reads every submission to a website's forms and lets real customers through while sales pitches, SEO spam and bots stay out: contact, demo request and quote forms first. It stops sales pitches, SEO spam and bots, forwards only the real submissions, so the owner never has to think about spam; every drop keeps a plain-language reason (the sentence or field that gave it away), rescuable in one click. No captcha: real visitors never see anything. Each submission is judged in about 100 ms, inline, before the thank-you page loads. This file is for coding agents (Claude Code, Codex, Cursor, etc.) setting Doorman up for a user. Everything below can be done without a browser. Base URL: https://withdoorman.com Human docs: https://withdoorman.com/docs MCP server: https://withdoorman.com/mcp (Streamable HTTP) ## The four rules that matter most 1. Act on `action` (or the boolean `deliver`), never on `route`. `route` is Doorman's opinion; `action` is what you should do. They differ in watch mode: route "drop", action "deliver". Code that drops on route silently throws away every lead watch mode was meant to keep. 2. Start a new lead form (contact, demo, quote) in watch mode, and switch to enforce after a week or two of verdicts look right. On a low-traffic form one wrongly dropped lead costs more than a year of spam. 3. The user must click the confirmation link Doorman emails them. Until they do, the account has 100 checks and emails nothing (Slack and webhooks work); once they confirm, the last two weeks of real submissions are emailed to them. Don't report "done" until GET https://withdoorman.com/v1/account says "verified": true, or you've told them plainly. 4. A backend check needs a timeout (3-5 s) and a fallback that still delivers the lead if Doorman is slow or down. ## Setup steps (plain HTTP, the fastest path in-session) 1. Find the project's forms. Look for
elements, form libraries (react-hook-form, Formik, Webflow/Framer exports), and backend routes that receive contact/demo/lead submissions (e.g. /api/contact). Note what the business sells from the README or landing copy, and whether the site sends a Content-Security-Policy. 2. Ask the user for the email address real submissions should go to, and whether they already have a Doorman account. If they do, ask for an API key from https://withdoorman.com/app#/settings and skip to step 3; don't sign up again. Otherwise create the account: curl -X POST https://withdoorman.com/v1/signup -H "Content-Type: application/json" -d '{ "email": "owner@example.com", "site_url": "example.com", "site_context": "Example sells invoicing software to small businesses in the US.", "mode": "watch", "agent": "claude-code" }' Signup also creates the account's first form (kind "lead", forwarding to that email) and returns its id: { "api_key": "dm_live_...", "account": { "verified": false, ... }, "form": { "id": "f_...", "action_url": "https://withdoorman.com/f/f_...", "mode": "watch", ... }, "next_steps": [...] } Use that form rather than creating another. Save api_key as DOORMAN_KEY in the project's local secrets file: whichever the stack uses (.env, .env.local for Next, .dev.vars for Cloudflare, or the host's secret store). Check that file is gitignored before writing to it. Never commit the key. site_context matters: Doorman judges each submission against it ("is this a person who wants what this business offers?"). One or two concrete sentences: what is sold, to whom. 3. Integrate. Pick ONE per form: - The form already posts to the project's own backend (an existing handler, API route, Worker, server action) → backend check (a). Keeps your handler, validation and storage. - Static site or site builder with no backend → hosted form action (b). - SPA with no backend → post from the client to the hosted action (c). Strict Content-Security-Policy? Add https://withdoorman.com to script-src for d.js, to form-action for a hosted form action, and to connect-src for AJAX or client-side posts. A backend check needs no CSP change. a) Backend check. Call from the handler, with a timeout and a fallback that delivers: async function doormanCheck(env, { email, name, message, ip }) { try { const res = await fetch("https://withdoorman.com/v1/check", { method: "POST", headers: { Authorization: `Bearer ${env.DOORMAN_KEY}`, "Content-Type": "application/json" }, body: JSON.stringify({ form: "f_...", email, name, message, signals: { ip, seconds_on_page: 42, honeypot_filled: false, javascript_ran: true }, forward: false, }), signal: AbortSignal.timeout(4000), }); if (!res.ok) throw new Error(`Doorman ${res.status}`); return await res.json(); } catch (err) { return { deliver: true, action: "hold", reason: "doorman_unreachable" }; // never lose a lead } } const r = await doormanCheck(env, { email, name, message, ip }); if (r.deliver) await saveLead({ email, name, message, flagged: r.action === "hold" }); // deliver false: skip saving/notifying, but show the same thank-you as everyone else This is plain fetch: Cloudflare Workers/Pages, Node 18+, Next.js, Deno and Bun. Same thing as a snippet: GET https://withdoorman.com/v1/forms/f_.../snippet?platform=fetch (also nextjs|express|python|ruby|elixir|curl). The @withdoorman/client npm package wraps it, with the same fallback. The full response: { "id": "sub_...", "form": "f_...", "created_at": "2026-09-30T12:00:00.000Z", "action": "deliver", // what to do: deliver | hold | drop. ACT ON THIS "deliver": true, // false only when action is "drop"; a hold is true (keep it, flagged) "route": "drop", // Doorman's opinion. Differs from action in watch mode. Don't branch on it "p_real": 0.04, "reason": "pitch", "evidence": "the sentence that gave it away", "model": "...", "latency_ms": 88, "label": null, "forwarded": false, "forwarded_to": [], "forward_why": "not_requested", "forward_detail": "..." } deliver: normal path. hold: keep it, flagged for review. drop: show the normal thank-you but don't save or notify. Never tell the visitor the verdict. signals: pass what you have. ip, seconds_on_page (from a hidden timestamp field), honeypot_filled (a hidden field bots fill), javascript_ran. They noticeably improve bot detection. Adding d.js to the page fills _t, _js and _gotcha fields you can pass through as-is. forward: false (default) means you handle the lead yourself and Doorman sends nothing. forward: true means Doorman also sends it to the form's destinations (email, Slack, webhook) exactly like a hosted post; that's how the owner gets an email without you writing email code. The response says whether it went: "forwarded": true and "forwarded_to": ["email", ...], or "forwarded": false with a "forward_why" of unverified (owner hasn't clicked the confirmation link), no_destination, recipient_unconfirmed, email_limit, dropped or not_requested. If you set forward: true, check "forwarded" once and tell the user if it's false. b) Static HTML / any site builder (no key, no backend): set the form's action and method. ...
Keep existing field names. Doorman detects email (email, e-mail, your_email), name (name, full_name, first_name) and message (message, comments, body, details, inquiry, question, notes, description) by name; anything else is kept as an extra field. Add data-doorman-ajax to the form to submit without a page reload. A hidden _next field (same site only) or the form's redirect_url sets where the visitor lands; default is https://withdoorman.com/thanks. Watch mode and forwarding are handled for you. c) React / SPA with no backend: POST FormData (or JSON) from the client to the action URL with Accept: application/json. The response is always {"ok": true} whatever the verdict. Get a component: GET https://withdoorman.com/v1/forms/f_.../snippet?platform=react Checkout / orders: kind "checkout" with { "order": { "items": "...", "total_usd": 120 }, "signals": { "card_country", "ip_country", "attempts", "device_orders_last_hour", "account_age_days", "name_match", "card_type", "shipping" } }. 4. Destinations (where real submissions go) for hosted forms and checks with forward: true. Every form forwards to the account's email by default (pass email_to: "" to turn that off). Add Slack or a webhook if the user wants: PATCH https://withdoorman.com/v1/forms/f_... { "slack_url": "https://hooks.slack.com/services/...", "webhook_url": "https://...", "email_to": "a@x.com, b@x.com" } Email forwarding only goes to confirmed addresses: the account's own email once confirmed, and any other address after its owner clicks a confirmation email Doorman sends them. Webhook and Slack URLs must be public (private and internal addresses are refused). Webhooks are signed: header Doorman-Signature: t=,v1=.")>. webhook_secret appears on the form object once a webhook_url is set. Failed deliveries are retried after 1m, 5m, 30m, 2h, 12h. Check they work: POST https://withdoorman.com/v1/forms/f_.../test-delivery 5. Verify, read state back, and tell the user. Test submissions are free (up to 100 a day) and not forwarded: POST https://withdoorman.com/v1/forms/f_.../test { "message": "Hi, we run a 12-person dental clinic and spend a day a week chasing invoices. Can we see a demo?" } -> action deliver POST https://withdoorman.com/v1/forms/f_.../test { "message": "We help SaaS founders fill their pipeline with done-for-you outreach. 15 min chat?" } -> route drop (action deliver in watch mode) GET https://withdoorman.com/v1/forms/f_... -> the form's mode, destinations and settings as saved GET https://withdoorman.com/v1/account -> "verified", plan and this month's usage Tell the user: which integration you used, where submissions go, that the form is in watch mode (and to switch to enforce when the verdicts look right), that drops are visible and rescuable at https://withdoorman.com/app, and, if "verified" is false, to click the confirmation link in their email or nothing gets emailed to them. ## MCP (optional) The MCP server has the same operations as tools (doorman_signup, doorman_whoami, doorman_get_install_snippet, doorman_update_form, doorman_test_submission, ...). A newly added MCP server usually only loads in the agent's next session or after a reconnect, so do the setup itself over plain HTTP above, and add MCP for later use. With an existing key (recommended): claude mcp add --transport http doorman https://withdoorman.com/mcp --header "Authorization: Bearer $DOORMAN_KEY" Codex: add to ~/.codex/config.toml: [mcp_servers.doorman] url = "https://withdoorman.com/mcp" with the header Authorization = "Bearer ". Without a key, only doorman_signup and doorman_docs work. If the user already has an account, don't sign up again: ask for a key and pass it as api_key to each tool, or reconnect with the header. ## Options worth knowing - mode: "watch" delivers everything and tags would-be drops (route "drop", action "deliver"). Recommended for new lead forms; switch to "enforce" with PATCH {"mode": "enforce"} after a week or two. Default is enforce. - deliver_at (default 0.8) and drop_below (default 0.2) are the P(real) thresholds. Between them is "hold": forwarded flagged as held (forward_holds, default true) and queued for review. - allow_list / block_list: emails or domains (acme.com, *.acme.com) always delivered / always dropped, without a check. - kind: lead (contact/demo/quote/sales, default; pitches, spam, bots), signup (fake and throwaway accounts), checkout (card testing, stolen cards), comment (promotion, link spam, harassment, hate, threats). One form per distinct form on the site: POST https://withdoorman.com/v1/forms { "name": "Demo request", "kind": "lead", "mode": "watch", "site_context": "..." } - Nothing is silently dropped: over the monthly quota or when judging fails, submissions are held and forwarded unjudged, flagged as held. A flood from one IP (over 30 posts a minute to one form) is stored as held in the dashboard, not forwarded. ## If something doesn't work Don't guess at a workaround. Send the problem to Doorman's founder, who reads every request: POST https://withdoorman.com/v1/support { "message": "what you were trying to do and what happened", "error": "the exact error text", "category": "setup|bug|billing|question|other", "agent": "your agent's name" } or the MCP tool doorman_contact_support. The account's context (plan, forms, recent errors, never keys) is attached, and the reply goes to the account email. Tell the user you've done it. Without an account yet: https://withdoorman.com/support. ## API reference (all need Authorization: Bearer dm_live_... except signup) - POST /v1/signup { email, site_url, site_context, form_name?, mode?, agent? } creates the account, its first form and a key - GET /v1/account (alias /v1/me) email, verified, plan, usage - GET /v1/forms - POST /v1/forms { name, kind?, mode?, site_context?, email_to?, slack_url?, webhook_url?, ... } - GET /v1/forms/{id} - PATCH /v1/forms/{id} { any form setting } - DELETE /v1/forms/{id} - GET /v1/forms/{id}/snippet?platform=html|ajax|react|fetch|nextjs|express|curl|python|ruby|elixir|webflow|framer|wordpress - POST /v1/forms/{id}/test { message, email? } - POST /v1/forms/{id}/test-delivery - POST /v1/check { form? | kind? + context?, email, name, message, fields?, signals?, order?, forward? } - GET /v1/submissions?form=&route=&review=true&before=&limit= - GET /v1/submissions/{id} - POST /v1/submissions/{id}/label { label: "real"|"spam" } - POST /v1/support { message, error?, category?, agent? } Errors are JSON { "error": "human-readable message" } with 4xx/5xx status. 429 means slow down. ## Pricing Every new account starts with a 14-day Pro trial, no card (30 days from a referral link); then Free unless upgraded. Free: 1 form, 100 submissions/month, 100 email forwards (Slack and webhooks unlimited). Pro: $29/month or $290/year, 10 forms, 5,000 submissions, 2,000 email forwards. Business: $79/month or $790/year, 50 forms, 50,000 submissions, 10,000 email forwards. Pitches and bots count as submissions; over the limit nothing is dropped (held and forwarded unjudged). Limited offer until November 30, 2026 for the first 100 paying customers: Pro $19/month, Business $59/month, kept while subscribed. Test submissions are free. Details: /pricing