AgentsMailv2
ProductAPIDeliverabilityPricingChangelog
docsSign inGet an API key
AgentsMailPrivacyLegal
AgentsMail
ProductDocsBlogPricing
Get started

Newsletter

Stay updated with our latest articles and web development news.

No spam, unsubscribe anytime

Blog/Email marketing for AI agents/Driving email campaigns with AI agents

Driving email campaigns with AI agents

When every action is an API call, an AI agent can do all the work: write, target, send, measure, repeat. Here’s what that looks like in practice.

MC
Mike Codeur

Aug 9, 2026 · 3 min

Driving email campaigns with AI agents

Driving campaigns with AI agents

Most marketing tools have an API at the edge: a way to export contacts, wire up a webhook. The real work still happens with a mouse. AgentsMail flips that. The API is the product, the web interface is just one client. Any action you can do on screen is an HTTP call — which makes it doable by an agent.

What "driving with an agent" means

An AI agent — a script, an assistant, a workflow — chains the steps with no human intervention in between:
  1. Create and fill a list — POST /api/v1/lists, then a bulk contact import, up to 500 per call.
  2. Write a template — POST /api/v1/templates, with the email's HTML.
  3. Create a campaign from that template, then edit its content independently — PATCH /api/v1/campaigns/{id}.
  4. Trigger the send — POST /api/v1/campaigns/{id}/send.
  5. Read the results — GET /api/v1/campaigns/{id} returns progress, sends, bounces.
At no point is there a copy-paste between a spreadsheet and an interface. The agent reads one campaign's results and writes the next one accordingly.

A concrete example

bash
# 1. Create the list
curl -X POST https://emails.example.com/api/v1/lists \
  -H "x-api-key: $MK_API_KEY" \
  -d '{"name":"Active customers"}'

# 2. Import contacts in bulk
curl -X POST https://emails.example.com/api/v1/lists/$LIST_ID/contacts/bulk \
  -H "x-api-key: $MK_API_KEY" \
  -d '{"contacts":[{"email":"ada@example.com","firstName":"Ada"}]}'

# 3. Launch the campaign
curl -X POST https://emails.example.com/api/v1/campaigns/$CAMPAIGN_ID/send \
  -H "x-api-key: $MK_API_KEY"
Three calls. The same sequence can be scripted, scheduled, or handed to an agent that decides the segment and timing on its own.

Why it's useful, not just clever

Repetition disappears. A weekly campaign to a segment that changes each week no longer needs manual handling: the agent recomputes the target, adapts the message, sends, and hands you a report. The guardrails stay. Driving by API doesn't mean opening everything. Sending stays protected — an organization must be explicitly allowed to send, and triggering requires a specific role. A misconfigured agent can't burn your sender reputation. Tracking is legible. At any moment, the agent — or you — can query a campaign's state: how many sends went out, how many are in flight, how long since the last activity. Enough to tell a slow send from a stuck one.

The right level of autonomy

Driving with an agent doesn't mean automating everything blindly. The model that works lets the agent prepare — write, target, schedule — and keeps a human check before the sends that matter. That's exactly what an API where every step is a separate call enables: you choose what the agent does alone, and what goes through you.
ai-agentapiautomationemailing
MC

Written by

Mike Codeur

Read next

All articles
Business2 min

You don’t need a bloated platform to send email

AgentsMail is an email marketing platform driven by API and AI agents. Cheaper than Mailchimp, simpler to use, and without the features nobody opens.

Aug 9, 2026
Development3 min

Good email deliverability: DNS, SPF, DKIM, DMARC

Sending an email is easy. Getting it into the inbox is not. A tour of the DNS records that decide whether your campaigns land — or fall into spam.

Aug 9, 2026
Marketing3 min

How to write a marketing campaign that gets read

A good marketing email isn’t a pretty one. It’s one that gets opened, read, and clicked. Subject line, structure, call to action: the principles that actually matter.

Aug 9, 2026