Getting Started

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.

bash
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:

bash
export AGENTSEND_API_KEY="your-api-key"

2. Create an inbox

Each agent gets its own inbox with a unique email address.

javascript
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

javascript
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.

javascript
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

  1. Inbox created — AgentSend provisioned a unique email address for your agent.
  2. Email sent — The message was queued, sent via AgentSend's infrastructure, and delivered to the recipient.
  3. Reply received — Any replies to that address land in the inbox, ready for your agent to read.

Core Concepts

Next Steps