Documentation

vaaya / docs / reference

Email

AgentMail gives your agent an inbox it owns: a real address that sends, receives, and replies in-thread. Create the inbox once for $2, then sends are 1¢ and reads are free. This is the agent’s own mailbox — outreach to prospects from your own accounts is the GTM & leads suite, not this.

Actions and prices

ActionPriceBody
agentmail/create_inbox$2.00 one-time{ username?, domain?, display_name? }
agentmail/send{ inbox_id, to, subject, text?, html? }
agentmail/list-messagesfree{ inbox_id }
agentmail/reply{ inbox_id, message_id, text?, html? }

Lifecycle

Create an inbox once; the inbox_id it returns is the email address (e.g. agent-abc@agentmail.to) — pass that exact string to every subsequent call.

# 1) provision an inbox ($2, one-time)
curl -X POST https://vaaya.ai/api/run/agentmail/create_inbox \
  -H "Authorization: Bearer $VAAYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"display_name": "Project Updates"}'
# → { "inbox_id": "agent-abc@agentmail.to", ... }

# 2) send from it (1¢)
curl -X POST https://vaaya.ai/api/run/agentmail/send \
  -H "Authorization: Bearer $VAAYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inbox_id": "agent-abc@agentmail.to",
    "to": "user@example.com",
    "subject": "Build completed",
    "text": "Your build finished successfully."
  }'

# 3) poll for replies (free)
curl -X POST https://vaaya.ai/api/run/agentmail/list-messages \
  -H "Authorization: Bearer $VAAYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inbox_id": "agent-abc@agentmail.to"}'

# 4) reply in-thread (1¢)
curl -X POST https://vaaya.ai/api/run/agentmail/reply \
  -H "Authorization: Bearer $VAAYA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inbox_id": "agent-abc@agentmail.to",
    "message_id": "<0100019e662d5ab0-...@email.amazonses.com>",
    "text": "Thanks — looking into it now."
  }'

When to use

  • “Notify me when X happens” workflows where the recipient may reply.
  • Daily digest emails the agent owns end to end.
  • Any flow where the agent needs a stable reply-to address.

Gotchas

  • Reuse one inbox across many tasks — the $2 setup is the biggest cost; sends are 1¢ and reads are free.
  • list-messages is free, so poll it as often as your latency budget wants.
  • Get the message_id for reply from list-messages — replying by id keeps the thread intact.
  • Don’t cold-email prospects from an agent inbox — deliverable, personalized outreach from your own connected accounts is what GTM & leads is for.