{"_note":"Machine-readable build plan from AgentMail. For the visual version open https://www.agentmail.to/build","kind":"blueprint","tldr":"Own the inboxes, send sequences from them, catch replies on message.received, classify, write to the ATS, escalate the rest.","title":"Recruiting candidate reply loop on owned inboxes","summary":"Candidate replies stop dying in a shared mailbox: every reply is classified, threaded, written to the ATS, and either booked or handed to a recruiter.","stack":[{"name":"AgentMail","role":"Inboxes, custom domain, threading, webhooks, drafts","why":"Replies need an owned address and thread history, not a send pipe."},{"name":"Claude or GPT","role":"Classifier and reply writer","why":"Reads extracted_text and returns a structured intent."},{"name":"Postgres or Supabase","role":"Candidate state and idempotency keys","why":"Stops double replies when a webhook retries."},{"name":"ATS API (Greenhouse, Lever, Ashby)","role":"System of record","why":"Recruiters already live there."},{"name":"Slack","role":"Escalation channel","why":"Low-confidence replies need a human in minutes, not hours."}],"steps":["Create one inbox per recruiter on a verified custom domain.","Register a message.received webhook, verify Svix signatures, dedupe by svix-id.","Classify each reply with extracted_text into a fixed intent set plus confidence.","Auto-reply in thread for interested, not now, and unsubscribe intents.","Create a Draft and ping Slack for anything below the confidence threshold.","Write intent, reply body and stage change back to the ATS."],"agentmailSetup":["Add your recruiting domain with client.domains.create, publish SPF, DKIM, DMARC and MX, wait for verified.","Create inboxes with client_id like inbox-recruiter-{id} so restarts reuse the same address.","Create a webhook on message.received scoped to those inbox_ids, with a custom Authorization header.","Verify deliveries with the Svix signing secret and the raw request body.","Use labels (interested, not-now, needs-human, replied) for state, and filter lists by label.","Use inboxes.drafts.create with in_reply_to for escalations, then drafts.send after recruiter approval.","Use an Idempotency-Key header on every send so webhook retries never double email a candidate."],"ideas":[],"options":[],"resources":[{"label":"Recruiting candidate reply loop with owned inboxes","url":"https://agentmail.to/use-case/ai-agent-that-processes-recruiting-email-replies","kind":"use-case"},{"label":"AI agents for recruiting","url":"https://agentmail.to/use-case/ai-agents-for-recruiting","kind":"use-case"},{"label":"Webhooks overview","url":"https://docs.agentmail.to/webhooks-overview","kind":"docs"},{"label":"Reply and attachment extraction","url":"https://docs.agentmail.to/reply-extraction","kind":"docs"},{"label":"Drafts for human review","url":"https://docs.agentmail.to/drafts","kind":"docs"}],"agentPrompt":"---\nproject: Recruiting candidate reply loop on owned inboxes\nbuilt_with: AgentMail\ndocs: https://docs.agentmail.to\nllms: https://docs.agentmail.to/llms.txt\n---\n\n# Goal\nBuild a candidate reply loop where outreach is sent from AgentMail inboxes owned by the agency, every inbound reply is received over a message.received webhook, classified into a fixed intent set, answered in the original thread, and written back to the ATS. Low-confidence or sensitive replies become Drafts with a Slack notification so a recruiter approves before anything goes out. Inboxes live on a verified custom domain, one per recruiter or per role, so sender reputation and audit history belong to the agency rather than a shared mailbox.\n\n# Architecture\n- Sequencer: picks candidates, calls inboxes.messages.send from the matching recruiter inbox with an Idempotency-Key, labels the message with the campaign.\n- AgentMail inboxes: one per recruiter or role on the verified domain, each with stored threads and automatic threading of replies.\n- Webhook receiver: HTTPS endpoint verifying Svix signatures, deduping on svix-id, enqueuing the event, returning 200 fast.\n- Classifier: passes extracted_text plus thread context to the model, returns {intent, confidence, suggested_reply}.\n- Router: high confidence goes to inboxes.messages.reply; low confidence goes to inboxes.drafts.create with in_reply_to and a Slack message with the draft id.\n- ATS sync: maps intent to stage, posts the reply body as a note on the candidate record.\n- State store: candidate id, inbox id, thread id, last intent, processed svix-ids.\n\n# Stack\n- AgentMail: Inboxes, custom domain, threading, webhooks, drafts\n- Claude or GPT: Classifier and reply writer\n- Postgres or Supabase: Candidate state and idempotency keys\n- ATS API (Greenhouse, Lever, Ashby): System of record\n- Slack: Escalation channel\n\n# AgentMail setup\n1. Install SDK: `pip install agentmail` / `npm i agentmail`\n2. Add your recruiting domain with client.domains.create, publish SPF, DKIM, DMARC and MX, wait for verified.\n3. Create inboxes with client_id like inbox-recruiter-{id} so restarts reuse the same address.\n4. Create a webhook on message.received scoped to those inbox_ids, with a custom Authorization header.\n5. Verify deliveries with the Svix signing secret and the raw request body.\n6. Use labels (interested, not-now, needs-human, replied) for state, and filter lists by label.\n7. Use inboxes.drafts.create with in_reply_to for escalations, then drafts.send after recruiter approval.\n8. Use an Idempotency-Key header on every send so webhook retries never double email a candidate.\n\n# Build steps\n1. Create one inbox per recruiter on a verified custom domain.\n2. Register a message.received webhook, verify Svix signatures, dedupe by svix-id.\n3. Classify each reply with extracted_text into a fixed intent set plus confidence.\n4. Auto-reply in thread for interested, not now, and unsubscribe intents.\n5. Create a Draft and ping Slack for anything below the confidence threshold.\n6. Write intent, reply body and stage change back to the ATS.\n\n# Acceptance checks\n- A reply to an outreach email fires message.received within seconds and lands in the same thread id.\n- Replaying the same webhook payload twice produces exactly one reply and one ATS update.\n- An interested reply gets an in-thread answer with a booking link and the ATS stage moves.\n- A low-confidence reply creates a Draft and a Slack ping, and nothing is sent until drafts.send is called.\n- An unsubscribe reply adds the sender to the send block list and no further mail goes to that address.\n\n# Notes\n- Generated by agentmail.to/build. Verify API details against the docs before shipping.\n","suggestions":[{"label":"Inbox per recruiter","prompt":"Show me how to provision an inbox per recruiter on our own domain, with pods per client company"},{"label":"Add interview scheduling","prompt":"Add a scheduling step so interested candidates get booked into the hiring manager's calendar over email"},{"label":"Sync to Greenhouse","prompt":"How do I write classified candidate replies and stage changes back into Greenhouse?"}],"note":null,"human":"https://www.agentmail.to/build","followUp":{"method":"POST","url":"https://www.agentmail.to/api/build-chat","headers":{"Accept":"application/json","Content-Type":"application/json"},"body":{"messages":[{"role":"user","content":"How would I build recruiting candidate reply loop with owned inboxes with AgentMail?"},{"role":"assistant","content":"Own the inboxes, send sequences from them, catch replies on message.received, classify, write to the ATS, escalate the rest.\n[blueprint] Recruiting candidate reply loop on owned inboxes: Candidate replies stop dying in a shared mailbox: every reply is classified, threaded, written to the ATS, and either booked or handed to a recruiter. (fit strong)\nNodes: sequencer=Outreach sequencer (source); inboxes=Recruiter inboxes (agentmail); agent=Reply agent (agent); ats=ATS (destination); scheduler=Scheduler (tool); recruiter=Recruiter (human)\nEdges: sequencer->inboxes [send outreach]; inboxes->agent [webhook]; agent->ats [update stage]; agent->scheduler [book slot]; agent->inboxes [threaded reply]; agent->recruiter [escalate draft]; recruiter->inboxes [approve and send]\nStack: AgentMail (Inboxes, custom domain, threading, webhooks, drafts); Claude or GPT (Classifier and reply writer); Postgres or Supabase (Candidate state and idempotency keys); ATS API (Greenhouse, Lever, Ashby) (System of record); Slack (Escalation channel)\nSteps: 1. Create one inbox per recruiter on a verified custom domain. 2. Register a message.received webhook, verify Svix signatures, dedupe by svix-id. 3. Classify each reply with extracted_text into a fixed intent set plus confidence. 4. Auto-reply in thread for interested, not now, and unsubscribe intents. 5. Create a Draft and ping Slack for anything below the confidence threshold. 6. Write intent, reply body and stage change back to the ATS.\nAgentMail setup: Add your recruiting domain with client.domains.create, publish SPF, DKIM, DMARC and MX, wait for verified. Create inboxes with client_id like inbox-recruiter-{id} so restarts reuse the same address. Create a webhook on message.received scoped to those inbox_ids, with a custom Authorization header. Verify deliveries with the Svix signing secret and the raw request body. Use labels (interested, not-now, needs-human, replied) for state, and filter lists by label. Use inboxes.drafts.create with in_reply_to for escalations, then drafts.send after recruiter approval. Use an Idempotency-Key header on every send so webhook retries never double email a candidate.\nTemplates: cold-outreach, approval-inbox"},{"role":"user","content":"<your follow-up, for example: swap Slack for Teams, or: build idea 2>"}]},"note":"Send the whole history each time, up to 10 user messages. No state is kept between calls."}}