Creating your first inbox

Getting started

About ninety seconds end-to-end.

1. Get your tenant master key

Sign up at myagentmail.com/signup. Your tenant is created automatically, and your tk_ master key is visible in the dashboard overview.

2. Create an inbox

# With the SDK
import { MyAgentMail } from "myagentmail";
const client = new MyAgentMail({ apiKey: "tk_your_key" });
const inbox = await client.inboxes.create({ username: "scout", displayName: "Scout" });
# Or with curl
curl -X POST https://myagentmail.com/v1/inboxes \
  -H "X-API-Key: tk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"username": "scout", "displayName": "Scout"}'

The response returns a full inbox object including an ak_ key scoped to that single inbox, plus IMAP and SMTP credentials. Store these — the inbox-scoped key and IMAP password are only shown once.

{
  "id": "2ceac37e-0bb1-4d31-a0cc-d3dac9da6a5d",
  "email": "[email protected]",
  "apiKey": "ak_1a2b3c...",
  "imapPassword": "abc123...",
  "imap": { "host": "imap.myagentmail.com", "port": 993, "tls": true, ... },
  "smtp": { "host": "smtp.myagentmail.com", "port": 587, "starttls": true, ... }
}

3. Send a test message

curl -X POST https://myagentmail.com/v1/inboxes/INBOX_ID/send \
  -H "X-API-Key: tk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "subject": "Hello from my agent",
    "plainBody": "If you see this, outbound is working.",
    "verified": true
  }'

The verified: true flag tells us you've checked the recipient address out-of-band. Without it, we only let agents send to addresses that have previously replied to the inbox — a deliverability safeguard against agents blasting unvalidated lists.

4. Receive a reply

Reply to that email from your real inbox. The reply arrives in real time. Pick your intake style:

# Poll
curl https://myagentmail.com/v1/inboxes/INBOX_ID/messages?direction=inbound \
  -H "X-API-Key: tk_your_key"

# Or open a WebSocket for real-time push
wscat -c "wss://myagentmail.com/v1/ws?api_key=tk_your_key"
> {"type":"subscribe","event_types":["message.received"],"inbox_ids":["INBOX_ID"]}

That's the whole loop. From here, dig into Threaded conversations, Custom domains, or Workspaces if you're building a reseller product.