Démarrage
Create an inbox and send your first email from an AI agent in under a minute.
Overview
AgentSend is email infrastructure built for AI agents. It gives each agent its own inbox with a real email address, so your agents can send, receive, and manage email conversations programmatically.
Use AgentSend to build agents that handle customer support, sales outreach, scheduling, research, and any workflow that needs email.
Install
Install the AgentSend SDK for your language, or call the REST API directly.
npm install agentsend
No SDK? No problem. AgentSend works with any HTTP client. All endpoints accept JSON and return JSON.
Quickstart
This example creates an inbox, sends an email, and lists received messages — all in a few lines.
1. Get your API key
Sign up at agentsend.io and create an API key from the dashboard. Set it as an environment variable:
export AGENTSEND_API_KEY="your-api-key"
2. Create an inbox
Each agent gets its own inbox with a unique email address.
const res = await fetch("https://api.agentsend.io/inboxes", { method: "POST", headers: { "x-api-key": process.env.AGENTSEND_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ displayName: "My Support Agent", }), }); const inbox = await res.json(); console.log(inbox.address); // e.g. a1b2c3@agentsend.io
3. Send an email
await fetch(`https://api.agentsend.io/inboxes/${inbox.id}/messages`, { method: "POST", headers: { "x-api-key": process.env.AGENTSEND_API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ to: ["customer@example.com"], subject: "Hello from AgentSend", bodyText: "This email was sent by an AI agent.", }), });
4. Receive emails
When someone replies, the message lands in your agent's inbox. Poll for new messages or set up a webhook for real-time delivery.
const msgs = await fetch( `https://api.agentsend.io/inboxes/${inbox.id}/messages?status=received`, { headers: { "x-api-key": process.env.AGENTSEND_API_KEY } } ).then(r => r.json()); for (const msg of msgs.data) { console.log(msg.fromAddress, msg.subject); }
What Just Happened
- Inbox created — AgentSend provisioned a unique email address for your agent.
- Email sent — The message was queued, sent via AgentSend's infrastructure, and delivered to the recipient.
- Reply received — Any replies to that address land in the inbox, ready for your agent to read.
Core Concepts
- Inboxes — Each agent gets a dedicated email address. Create as many as you need.
- Messages — Send and receive emails with plain text, HTML, and attachments.
- Threads — Messages are automatically grouped into conversation threads.
- Webhooks — Get real-time notifications when emails arrive, bounce, or are delivered.
- Domains — Use your own domain instead of @agentsend.io.
- Attachments — Upload and attach files to outgoing messages.