Docs · Guides
Reply drafts
Ask for a draft answer to a message, built from the thread, the contact and your knowledge. It is never sent on its own.
POST /v1/messages/:id/draft-reply returns a suggested reply. Your agent or a person reviews it, changes what needs changing, and sends it with the normal reply call. Agentboxd never sends a draft by itself.
curl -s -X POST https://api.agentboxd.com/v1/messages/$MESSAGE_ID/draft-reply -H "Authorization: Bearer $MAILROOM_API_KEY" -H "Content-Type: application/json" -d '{"instructions":"Say it shipped Monday; offer the tracking link."}'
# 200 {"text":"Hi Priya, …","citations":[{"knowledge_id":"…","title":"Shipping times"}],"model":"deepseek-flash"}const draft = await mr.messages.draftReply(msg.id, { instructions: 'Keep it short.' });
console.log(draft.text, draft.citations.map((c) => c.title));
// Review, then send it in the thread.
await mr.messages.reply(msg.inbox_id, msg.id, { text: draft.text });#What the draft is built from
- The thread: its latest 10 messages, as
extracted_text. - The contact: name, notes and metadata.
- Your knowledge: the top 5 matches for the latest inbound message in that inbox (workspace-wide documents included).
- Your
instructions, if you send any (up to 2,000 characters).
Drafts are written by DeepSeek, the model set on the server (deepseek-flash by default; the response names it in model). Email content is marked as untrusted data in the prompt, so instructions hidden in an email are not meant to steer the draft. Treat that as a guardrail, not a guarantee, and read what comes back.
#Turning it on
Drafts need the workspace’s AI processing set to full. Otherwise the call answers 403 ai_disabled. If the model doesn’t answer, you get 503 llm_unavailable and nothing is sent.
From an MCP client, use draft_reply and then reply_to_email. In the dashboard, the reply box has a Draft reply button that fills the box and lists the knowledge it used.