Home/Email Marketing/API email marketing

API email marketing: what an API has to expose, and what an agent needs before it sends

On most platforms, the campaign half of the API is the half that arrived last.

VerifiedBy George Hartley, Co-founder·Updated

Key takeaway

An email marketing API is the programmatic interface to the campaign side of a platform: contacts, lists, segments, templates, campaigns, flows, suppression, events, sending domains. On most platforms that half is a separate product with its own pricing ladder and a thinner API than the transactional one. Check that all nine exist in the vendor's docs before integrating. The trap is a send call that returns success when the platform has only accepted the job, not delivered it. When an AI agent drives that API over MCP, the same objects are in play, and the agent should review the campaign and wait for a person to approve it before anything reaches an audience.

What an email marketing API actually is

An email marketing API is the programmatic interface to the campaign side of an email platform. Audiences, templates, campaigns, and the results that come back, all addressed by code instead of by a person in a dashboard. On most platforms it's the smaller, later, and thinner half of the product, because the campaign side was built for somebody clicking and the API arrived afterwards. A team can wire up a send endpoint in an afternoon and then discover there's no way to create the audience it meant to send to. The send was never the hard part.

A transactional send is one message to one person, triggered by something that happened: a receipt, a password reset, a shipping notice. A marketing send is one message to a defined audience, on a schedule or on a trigger that fires across a list, and it carries an unsubscribe obligation the receipt doesn't. Different unit, different objects. A transactional API needs a recipient, a payload, and a verified sending domain. A marketing API needs somewhere to keep the audience, a rule that decides who's in it, a template with variables in it, and a record of what came back.

What changes when an AI agent drives the email marketing API

An agent that reaches the API through MCP works on the same objects a developer's code does: the contacts, the segment, the template, the campaign. George Hartley, Nitrosend's co-founder, has argued that the next wave of teams will run email through an agent instead of a dashboard. If that holds, the most frequent caller of a marketing API stops being a script somebody wrote and becomes an agent deciding its own calls from a sentence in a chat.

That shifts where the line between building a campaign and delivering it has to sit. Code sends because a developer wrote the send line. An agent needs the platform to keep the two apart. On Nitrosend the split is in the tools themselves. nitro_compose_campaign creates or edits a broadcast draft and never delivers it, and nitro_compose_flow does the same for an automation draft and never activates it. nitro_review_delivery then checks the draft without changing anything. Delivery is its own step: a person looks at the result and approves, and only then does nitro_control_delivery approve the campaign or flow for delivery.

The audience side changes too. nitro_manage_audience creates and updates contacts, subscriptions, lists, events, segments and tags a write at a time. For more than 100 contact writes, the agent switches to nitro_import_contacts with a CSV upload, and existing subscription state is always preserved. Connecting an agent is covered in email for Claude, the code-level reference for the same objects is the email API, and this page stays on the campaign side of email marketing.

Marketing and transactional are usually two products

On most platforms these aren't two endpoints on one API. They're two products, with two pricing ladders, two sets of docs, and sometimes two accounts. A developer integrating the send endpoint rarely finds that out from the documentation, because the documentation for each half reads like a whole platform. It's on the pricing page.

Four platforms, four versions of the same split

PlatformHow the two halves are soldSource
Elastic EmailMarketing and the API are separate products, and a customer on one is told to create a new account to try the other.Elastic Email API pricing
SendGridEmail API and Marketing Campaigns are sold as two products, each priced separately.Twilio SendGrid product page
ResendTransactional bills on emails sent, marketing bills on contacts stored, so Broadcasts add a second plan.Resend, how pricing works
HubSpotMarketing email has its own API, separate from the Engagements API that carries sales email.HubSpot Marketing Emails API guide

The consequence for a buyer is that the price you were quoted and the API you were shown may not be the same purchase, and which is which is answered on the pricing page rather than in the reference. Read both ladders before you integrate either one.

This is what it looks like when the campaign side was never designed to be driven by anything but a person: the transactional half got an API because a machine was always going to call it, and the marketing half got a dashboard because a marketer was always going to sit in front of it. On Nitrosend the transactional email API and the campaign tools sit on the same MCP surface, under one account.

What a marketing API has to expose

A use-case list tells you what somebody else did with an API. The check that survives contact with a vendor's docs is narrower, and it's a list of objects rather than outcomes: are these nine things addressable? That's the difference between an API you can send with and an API you can run a program with.

The nine objects to check

ObjectWhat the API must allow
ContactsCreate, read, and update people and their custom fields.
ListsGroup contacts statically, by membership rather than by rule.
SegmentsDefine a rule that keeps a group current and resolves at send time.
TemplatesStore and render the content, with variables the send fills in.
CampaignsCreate the send itself, schedule it, and address it to an audience.
FlowsMulti-step automation with triggers, waits, and branches.
SuppressionThe do-not-send list, readable as well as writable.
EventsWhat came back, by contact and by send.
Sending domainsAdd a domain and verify its DKIM and DNS records.

HubSpot's marketing email API shows where these lists tend to stop: it documents create and retrieve, and the /publish and /unpublish endpoints need Marketing Hub Enterprise or the transactional email add-on. So the API can compose a campaign and can't send it without the top tier. That isn't an oversight, it's the shape of a product where publishing was a button somebody pressed. Run the nine down any vendor's reference and you'll know whether you're buying a send endpoint or a platform.

How a campaign send works through an API

A campaign send is five calls rather than one, and they go in this order.

  1. Create or select the audience, either a list or a segment whose rule resolves at send time.
  2. Create or reference the template, with the variables the campaign will fill.
  3. Create the campaign, binding that template to that audience.
  4. Schedule it or send it, and get an identifier back rather than a delivered message.
  5. Read the results back as events, against contacts and against the send.

That sequence is also the answer to "should I use SMTP or an API", which is the wrong question for campaign sending. SMTP is a protocol for handing one message to a server. It knows a sender, a recipient, and a payload, and it knows nothing about audiences: there's no SMTP verb for "the people who opened the last three sends". An API is how you address the objects above, and SMTP is how a single message moves once something else has decided who it's for.

Step four is where most first integrations go wrong. A campaign is a job, not a request. The call returns an identifier because the platform has accepted the work, not because anybody received anything, and code that reads a 200 as a delivery will report a clean send for a campaign that bounced in full.

The rules don't relax because a machine pressed send

Bulk email carries obligations that are written down, and none of them have an exemption for code. One-click unsubscribe is the clearest case, because it's a specification rather than a courtesy. RFC 8058 defines it: a List-Unsubscribe-Post header carrying the single key-value pair List-Unsubscribe=One-Click, sent alongside a List-Unsubscribe header, with both covered by a valid DKIM signature. A link in the footer isn't that. A mailbox client can't press a footer.

The mailbox provider states the threshold. Google's requirements for bulk senders reach anyone sending more than 5,000 messages a day to Gmail accounts: SPF and DKIM on the sending domain, DMARC, a spam rate in Postmaster Tools kept below 0.10% and never reaching 0.30%, and one-click unsubscribe on marketing and subscribed messages, with a visible unsubscribe link in the body as well.

A dashboard makes most of it unavoidable. The unsubscribe link is already in the template the tool handed you, the suppression list is applied before the send leaves, and the authentication check runs before the button lights up. Code makes every one of those optional. An API that will send to an audience without reading suppression first isn't a faster dashboard, it's a way to file the same mistake at machine speed before anybody notices.

That's why suppression sits on the checklist above, and why it has to be readable and not only writable. Writable suppression means the platform can record an unsubscribe. Readable suppression means your code can ask, before it builds the audience, who it isn't allowed to contact. Any integration that sends campaigns needs the second one, and plenty of marketing APIs document only the first.

The same split is now repeating at the agent layer

The live version of this question is no longer whether a platform has an API. It's whether an agent can reach the campaign objects through one. MCP servers are how that access is being packaged, and they're being built vendor by vendor, at different scopes.

Mailchimp's official MCP server covers Mailchimp Transactional, formerly Mandrill, and exposes nine tools that mirror what the Transactional API already does. The guide covers Transactional only, not the Marketing API, which is the half with audiences and campaigns on it. It authenticates with a static bearer key in the header rather than OAuth, so an agent connection carries the account's identity and no per-user identity at all. Eight Mailchimp alternatives are ranked on whether an assistant can send a marketing campaign, not only a transactional one.

Resend went the other way. Its MCP server covers the whole platform, with broadcasts, automations, segments, and domains included, so an agent there can build and send a campaign rather than only push a message. The useful point isn't that one vendor moved faster. It's that the nine-object question repeats one layer up, and you'll be asking it again, per vendor, about the agent surface.

There's a structural reason it keeps landing this way. An agent surface added to a dashboard-first product inherits whatever the API already exposed, and where the API was the transactional half, the transactional half is what the agent gets. Nothing about the retrofit fixes the gap underneath it.

Nitrosend built in the other order: every capability is an API endpoint and an MCP tool before it's a screen, so there's no second half waiting to catch up. That answers the question for Nitrosend. It says nothing about any other vendor's agent surface, so ask the nine-object question again for each one.

Worked example: an agent runs the five-call campaign sequence

The five calls from the campaign sequence above map onto an agent session almost one to one, with a review and a person added before step four.

The five calls, as agent tools

StepAgent callOutcome
1. Audiencenitro_define_segmentA previewed, saved segment
2 and 3. Template and campaignnitro_compose_campaignA broadcast draft, not delivered
Review and approvalnitro_review_delivery, then a person says goA checked draft
4. Sendnitro_control_deliveryApproved for delivery, not yet received
5. Resultsnitro_get_insightsDelivery and engagement read back

The request arrives in plain words:

You: send the March product update to customers who bought in the last 90 days, but show me before it goes.

  1. nitro_get_status checks the account's sender identity and readiness before any campaign object is touched.
  2. nitro_define_segment runs as a preview and shows how many contacts the "bought in the last 90 days" rule resolves to, then saves the segment under a name once that count looks right.
  3. nitro_compose_campaign binds the March update template to that segment as a broadcast draft. Nothing is delivered.
  4. nitro_review_delivery runs preflight, spam analysis and validation on the March update draft, and renders previews of it, without approving anything.
  5. nitro_send_test_message sends one real copy of the March update campaign to the account's test recipients, and to nobody on the segment.
  6. The person who asked reads the preview and the test copy and says go. Without that answer, the session stops here.
  7. nitro_control_delivery approves the March update for delivery. It clears the campaign to go out. It does not mean anyone has received it.
  8. nitro_get_insights reads the results back with trends, benchmarks and recommendations.

Before: code that read a 200 from the send call as a delivered campaign and reported a clean send. After: an agent that reports the approved campaign as accepted work, then reports the delivery and engagement numbers once nitro_get_insights has them.

Where API-driven campaigns go wrong when an agent sends them

Each of these is particular to the campaign side, where one approved call reaches a whole audience.

  • An accepted job reported as a delivered campaign. The approval succeeds and the agent tells the user the March update went out, before a single delivery event exists. When the numbers later come back short of the audience, a campaign that stopped partway through sending covers what to check.
  • A bulk marketing send pushed through the transactional path. nitro_send_message sends one transactional message now. An agent that loops it over a customer list skips the campaign draft, the review and the approval, and sends marketing mail down a path built for receipts. Audience sends belong in a campaign draft, as covered in mass email marketing.
  • A replace edit that clears the audience or schedule. nitro_compose_campaign has two edit modes. patch preserves omitted fields. replace needs the campaign ID and a confirm, and clears any audience or schedule the edit left out, so an agent that rewrote only the subject line with replace can leave the draft addressed to nobody.
  • A segment saved without a preview. nitro_define_segment previews by default. An agent that turns the preview off and saves on the first attempt never sees that the 90-day rule matched the whole list, or nobody at all.
  • A large list written one contact at a time. nitro_manage_audience is for individual writes. Past 100 contacts, a CSV through nitro_import_contacts is the documented path, with existing subscription state preserved, consent recorded for the contacts the import creates, and row limits set by account standing and readable at GET /v1/my/imports/spec. A contact-by-contact loop gives up all of that.

Run the campaign side from the same place you send

Every one of those nine items exists because campaign platforms were built for a person to click through, not for code to drive end to end. The fix isn't a longer checklist, it's a platform an agent can drive directly. Nitrosend is MCP-first, so Claude, ChatGPT, Codex, Cursor and others reach contacts, segments, templates, campaigns, and flows the same way a developer's code does, before any of it is a screen. The Codex integration page puts it as full-stack email automation inside an AI agent, rather than an email marketing tool with AI added.

If you've run the nine-object checklist and found your platform answers it in two halves, on two ladders, with an agent surface over one of them, that's the problem Nitrosend is built around. Contacts, subscriptions, lists, events, segments and tags, templates, campaigns, flows, sending domains and analytics sit on one API and one MCP surface, so the audience side is addressable by the same thing that sends. Code-level detail is in the email API docs and the CLI.

Start on the free tier with unlimited contacts and 5,000 starter emails, and drive the campaign side from your agent.

Sources

  • Elastic Email, Email API pricing: marketing and the API sold as separate products, and the statement that a customer on one has to open a new account to use the other.
  • Twilio SendGrid: Email API and Marketing Campaigns priced on two separate pages.
  • Resend, how pricing works: transactional priced on emails sent and marketing priced on contacts stored, so the two halves are two plans.
  • HubSpot, Marketing Emails API: create and retrieve operations, publish and unpublish gated to Marketing Hub Enterprise or the transactional email add-on, and sales email on a separate API.
  • RFC 8058: Signaling One-Click Functionality for List Email Headers, the header pair behind one-click unsubscribe and the DKIM signature it has to carry.
  • Google, email sender guidelines: the 5,000 messages a day threshold, SPF, DKIM, DMARC, the spam rate kept below 0.10% and never reaching 0.30%, and one-click unsubscribe on marketing mail.
  • Mailchimp, Transactional MCP guide: the nine tools that mirror the Transactional API, and the static bearer key an agent connection authenticates with.
  • Resend, MCP server: platform-wide coverage including broadcasts, automations, segments, and domains.

Common questions

What is an API in email marketing?

It's the programmatic interface to an email platform: a way for your code to create contacts, build segments, store templates, create and schedule campaigns, and read the results back, instead of a person doing each of those in a dashboard. On a marketing platform specifically, it covers the campaign side rather than single triggered messages.

How much does it cost to use an email marketing API?

It depends which half you're buying. Vendors commonly price the transactional API on emails sent and the marketing side on contacts stored, so the two are often two bills on two ladders. Before you compare headline prices, check whether the number you were quoted covers campaigns and audiences or only sending.

Is there a free email marketing API?

Yes, commonly, either as a capped free tier or as a time-limited trial. The cap usually sits in a different place on each half: contacts on the marketing side, monthly or daily sends on the transactional side. Nitrosend's free plan starts with 5,000 non-expiring emails, then 500 a month, with unlimited contacts on every plan.

What's the difference between an email API and SMTP?

SMTP is a delivery protocol: hand it a sender, a recipient, and a message, and it moves that one message and nothing else. Audiences aren't in its vocabulary, so it can't be asked who should receive something. An API addresses the objects a campaign is made of: contacts, lists, segments, templates, and the campaign itself. For campaign sending, that's the whole difference.

Can I send transactional and marketing email through the same API?

On many platforms, no. They're two products with two pricing ladders, and with some vendors two accounts. Check three things on the pricing page before you integrate: whether both halves sit on one plan, whether contacts and suppression are shared between them, and whether one API key reaches both.

How do I measure a campaign sent through an API?

You read events back, against the contact and against the send. Delivery, bounce, open, click, and unsubscribe are the usual set, and platforms expose them by polling an events resource, by exporting a report, or by pushing to a handler you host. Check which of the three your vendor offers before you build reporting.

Do I still need a one-click unsubscribe link if I send campaigns through an API?

Yes, and it isn't a template convention. RFC 8058 defines a header pair: List-Unsubscribe-Post carrying List-Unsubscribe=One-Click, alongside List-Unsubscribe, both covered by a valid DKIM signature. Google asks bulk senders for it on marketing mail, with a visible unsubscribe link in the body too. Sending by API changes none of that.

How does API access affect automated email marketing workflows?

It decides how much of the workflow code or an agent can run without a person in a dashboard. A campaign send is five calls: audience, template, campaign, send, results. With API access to all five, an automated workflow can build and schedule a campaign end to end, and the send step still returns accepted work, not delivered mail, so a review and an approval belong before it.

Can an AI agent run an email campaign through an API?

Only if the campaign objects are exposed to the agent surface. Some official MCP servers cover a whole platform, broadcasts, automations, and segments included. Others mirror the transactional API only, which lets an agent send a message but not build an audience. Check what the server exposes, not whether one exists.

Start with the free tier

Simple pricing. Unlimited contacts.

Every plan includes full stack emailing: Flows, Newsletter Campaigns and Transactional Email, plus our NitroWheel LLM and all agent integrations (Claude, ChatGPT, Codex, Cursor and others). Pay for what you send, not who you store.

Choose your billing interval

Every paid plan includes 3 agent inboxes and no Nitrosend footer.

Free

For getting started.

$0USD / month

No card needed.

5,000 emails to start

Start free
  • Then 500 emails every month
  • 3 brands · 2 seats
  • 1 custom sending domain
  • Starter emails never expire

Starter

For your first email program.

$16USD / month

$192 billed yearly.

20,000 emails / month

Choose Starter
  • 5 brands · 3 seats
  • 5 custom sending domains
  • 500 email verifications/month
  • $1.50 / 1,000 extra emails

Pro

For a growing audience.

$40USD / month

$480 billed yearly.

60,000 emails / month

Choose Pro
  • 10 brands · 5 seats
  • 10 custom sending domains
  • 1,000 email verifications/month
  • $1.20 / 1,000 extra emails

Growth

For teams and agencies.

$120USD / month

$1,440 billed yearly.

200,000 emails / month

Choose Growth
  • Unlimited brands · 10 seats
  • 25 custom sending domains
  • 2,500 email verifications/month
  • $0.90 / 1,000 extra emails

Scale

For high-volume sending.

$240USD / month

$2,880 billed yearly.

500,000 emails / month

Choose Scale
  • Unlimited brands · 20 seats
  • 100 custom sending domains
  • 5,000 email verifications/month
  • $0.70 / 1,000 extra emails
Enterprise

Hey, big sender.

Sending 500,000+ emails a month? Get a custom plan designed for you, with volume email pricing and capacity that fits your business.

Daily allowances depend on your plan and sender standing. Strong list, domain and delivery evidence can raise standing, including on day one. Trusted receives the full plan allowance; available email credits, safety checks and delivery pacing still apply.

Free forever. No credit card required. See full comparison →