Three ways to split the work
| Mode | The agent | People |
|---|---|---|
| Draft first | Writes a draft for every new message | Read, edit and send |
| Answer the easy ones | Replies to questions it is sure about, drafts the rest | Handle drafts and anything unusual |
| Agent first | Replies to everything within its rules | Read along in Sent and step in |
Most teams start with drafts and give the agent more as they trust it. The mode lives in your code, not in Mektup: the mailbox simply accepts drafts and sends from whoever calls it.
Drafts for a person to approve
// Let the agent prepare the answer, and a person send it
await fetch("https://api.usemektup.com/v1/domains/yourcompany.com/mailboxes/support/drafts", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.MEKTUP_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
to: message.from,
subject: `Re: ${message.subject}`,
text: answer,
}),
});
// The draft appears in the mailbox's Drafts in webmail, ready to check and send.What everyone sees
- Inbox: every message, read or unread, with search and folders.
- Sent: every answer from the address, whoever sent it, in the thread it answers.
- Drafts: what the agent prepared and is waiting for a person.
- The same mailbox in any mail app, through the mailbox's IMAP and SMTP login.
Before you put an agent on a shared address
- Verify the
X-Mektup-Signatureon every webhook so only Mektup can trigger your agent. - Treat the content of an email as untrusted: someone can write instructions to your agent. Don't let it act on what a message tells it to do without checks.
- Block senders the agent should ignore (
POST /v1/blocked); their mail never fires the webhook. - Sending limits apply to the whole account (2,000 a day on Starter), which caps the damage of a loop.