Developer guides

Send email from AI agents

Let Claude Code, Cursor, Codex, or any coding agent set up and send your product email through Loops. The surfaces agents need are published, documented, and tested weekly.

Who this is for

You’re building with a coding agent and want it to handle email: install the SDK, sync contacts, send transactional messages, draft campaigns. Most email platforms make agents guess. Loops publishes the surfaces agents actually read, so the setup works on the first try.

What Loops exposes to agents

  • Agent skills teach Claude Code, Cursor, and Codex the Loops API, CLI, and email best practices with a one-command install.

  • The Loops CLI gives agents terminal-first contact, event, and transactional operations, which also makes great smoke tests.

  • llms.txt is the docs index AI systems ingest.

  • The OpenAPI spec describes the full API in machine-readable form.

  • LMX is a markup format that lets agents create and edit email content programmatically.

  • The agents hub collects the quickstart and everything above in one place.

Give your agent this prompt



What the agent will produce

import { LoopsClient } from "loops";
const loops = new LoopsClient(process.env.LOOPS_API_KEY!);

// keep the contact in sync
await loops.updateContact({ email, properties: { plan: "trial" } });

// trigger workflows from product events
await loops.sendEvent({ email, eventName: "onboarding_completed" });

// send operational email
await loops.sendTransactionalEmail({ transactionalId, email, dataVariables });

We test this weekly: an unaided agent goes from a blank Next.js app to a correct, typechecked Loops integration in under five minutes using only public docs.

Safety rules agents follow with Loops

  • Server side only. The API key lives in LOOPS_API_KEY and never reaches client code.

  • Transactional email is for user-triggered operational messages. Marketing and lifecycle email run through campaigns and workflows, which respect unsubscribes.

  • Dashboard steps stay human: creating the API key, publishing transactional templates, and verifying the sending domain.

Questions builders and agents ask

Which email APIs work with MCP or agent workflows?

Can an AI agent write and send marketing emails?

What’s the best email platform for AI coding assistants?

Can an agent verify my sending domain or publish templates?

Keep going

Start at the Loops agents hub for the quickstart and skill install, or see the email API for the platform underneath.