Email + LinkedIn API for AI sales agents
Build AI sales agents that actually work leads end-to-end — connect on LinkedIn, send personalized email, detect replies, branch the cadence, and follow up at the right moment. One API key, two channels, multi-tenant ready.
The problem
A modern AI sales agent isn't a single send — it's a stateful conversation across two channels.
Day 0: it finds a qualified lead, sends a personalized email or LinkedIn invite. Day 3: it checks whether the lead engaged. If they accepted on LinkedIn, it follows up there. If they replied to the email, it exits the cadence and pings a human. If they did neither, it nudges with a different angle.
Doing this from scratch means stitching together: an email API, an inbox-receive system, a LinkedIn automation tool, a reply-detection layer, a session-router for LinkedIn rate limits, a cadence runtime, webhook delivery, signal verification. That's six vendors and the integration glue between them.
What MyAgentMail gives you
One API key, both channels, every primitive a real sales agent needs:
- Provisioned email inbox with custom domain (
[email protected]), full send + receive over SMTP/IMAP, threading, drafts, bounce + complaint tracking. - LinkedIn outreach via real LinkedIn accounts the customer connects — invitations, DMs, post engagement signals, intent monitoring across keyword searches and engagement on specific profiles.
- Reply detection —
message.receivedwebhook fires when a lead replies;linkedin.message.receivedwhen they DM back. Cadence runtime exits the sequence automatically. - Open + click tracking —
message.opened,message.clickedevents fire so the agent can branch on engagement signals (gate on clicks, not opens — opens are noisy due to Apple Mail Privacy Protection). - Server-side cadence engine — define your sequence once (
linkedin_connect → wait → email → wait → linkedin_message), enroll a lead, we fire the steps with branch conditions likeafter_acceptandno_reply_to_prev. Daily send caps + business-hours guard built in. - Multi-tenant from day one — workspaces and scoped API keys per customer, so SaaS-on-top-of-MyAgentMail is supported out of the box.
Sketch
import { MyAgentMail } from "myagentmail";
const mam = new MyAgentMail({ apiKey: process.env.MYAGENTMAIL_KEY });
// 1. Provision an inbox for the agent.
const inbox = await mam.inboxes.create({ username: "scout", domain: "yourcompany.com" });
// 2. Connect a LinkedIn account (or use one already connected).
const session = await mam.linkedin.sessions.list().then((r) => r.sessions[0]);
// 3. Define a sequence — invite, wait 3d for accept, DM, wait 4d, fall back to email.
const cadence = await mam.cadences.create({
name: "Inbound interest follow-up",
sessionId: session.id,
inboxId: inbox.id,
steps: [
{ kind: "linkedin_connect", message: "Hi {{name}} — saw your post on outbound..." },
{ kind: "wait", days: 3 },
{ kind: "linkedin_message", condition: "after_accept", message: "Thanks for connecting..." },
{ kind: "wait", days: 4 },
{ kind: "email", condition: "no_reply_to_prev", subject: "{{name}}, did this miss you?" },
],
});
// 4. Enroll qualified leads. The runtime fires steps server-side, fires
// cadence.step.fired / cadence.lead.replied / cadence.lead.completed
// webhooks to your agent's handler.
await mam.cadences.enroll(cadence.id, [
{ name: "Alice Chen", email: "[email protected]", linkedinUrl: "https://linkedin.com/in/alice-chen" },
]);
Why this beats DIY
| You'd build | We give you |
|---|---|
| SMTP outbound + bounce/complaint handling | Built in (ZeptoMail backbone, auto-pause on abuse signals) |
| Inbound IMAP + threading state | Built in (real inboxes, drafts API, WebSocket events) |
| LinkedIn automation against an account you don't own | Built in (real session, geo-matched residential proxy, jittered polling that survives anti-bot) |
| Cadence state machine + branch conditions | Built in (linkedin_connect → wait → linkedin_message → wait → email with after_accept / no_reply_to_prev) |
| Multi-tenant rate limiting | Per-tenant + per-key buckets, cross-channel quota |
| Open + click tracking | ZeptoMail tracking webhook → message.opened / message.clicked events |
Saves you ~3-4 months of engineering for the same baseline functionality.
Pricing
Email module: $5/month. LinkedIn add-on starts at $29/month for the Solo tier (2 connected sessions, 100 actions/day, 3 intent signals). 7-day free trial on both. See /pricing.
Related
14-day productized build. $10K flat, optional maintenance at $2K/month. We tune the firing rules, the drafter prompts, and the cadence to your ICP.
Other use cases
- For cold outreachBuild your own cold outreach system on MyAgentMailCold email + LinkedIn outreach infrastructure for indie hackers and small teams. Provisioned inboxes, real LinkedIn sessions, intent signals, server-side cadence engine. Drop-in alternative to Lemlist, Apollo, Instantly — with full data ownership.
- For recruiting agentsEmail + LinkedIn API for AI recruiting agentsSource candidates from LinkedIn, message them with personalized outreach, follow up over email when a connection accepts. Reply detection, multi-account quotas, and intent signals built in.
- For support agentsEmail API for AI customer support agentsBuild AI customer support agents that read inbound email, draft thoughtful replies, and learn from human edits before sending. Real inbox per agent, full thread state, drafts API for human-in-the-loop.
- For SaaS buildersMulti-tenant email + LinkedIn API for SaaS buildersBuild SaaS products that give each customer their own provisioned inbox and connected LinkedIn account. Workspace-isolated keys, per-tenant rate limits, scoped billing structures — multi-tenancy is first-class, not an afterthought.
- For transactional emailTransactional email API for AI-powered appsSend password resets, receipts, and notifications from AI-built apps. Provisioned inbox, custom domain, ZeptoMail-backed deliverability, and per-send open + click tracking with optional opt-out for privacy-sensitive sends.
Last reviewed 2026-05-02.