New guide: how to warm up a dedicated IP without hurting your reputation. Read now →
Log in
MigoSMTP
Email API

Send, track and manage email from your code

A REST API for sending, templates, events and reporting, with scoped keys and clear errors.

Agent-ready: an MCP server lets AI assistants send and inspect mail safely.

Request
POST /v1/send
{ "from": "[email protected]",
"subject": "Hello" }
Response
202 Accepted
{ "id": "msg_[id]" }
Idempotency-Key supported
202 Accepted
JSON
Idempotent
Send with a single JSON callAuthenticate with a bearer key, post a small JSON body and get a message id back immediately.
Quickstart
cURL
Node
Python
PHP
Python
import migosmtp
c = migosmtp.Client("KEY")
c.send(to="[email protected]",
template="welcome")
Sent · 202
Typed SDKs
Open source
Official libraries for your stackPick Node, Python, PHP or Go. The same few lines send a message and handle errors the same way everywhere.
API key scopes
Send emailAllowed
Read eventsAllowed
Manage domainsAdmins only
Rate limit[n] req/s
Least privilege
Rotate safely
Keys with exactly the access they needCreate one key per service, limit what each can do, and revoke one without touching the others.
Rate limit
Traffic spike
Queue smooths the spike
Nothing dropped
Backpressure
No data loss
Absorb bursts gracefullyWhen traffic spikes beyond your rate, requests queue and drain rather than fail, so nothing is dropped.
message events
Signed events
/events
200 OK
Data warehouse
200 OK
Alerts
Retry in 30s
HMAC signed
At-least-once
Events return the same wayThe same API surface streams delivered, opened, clicked and bounced events back to your endpoint, signed.
Email the invoice to Priya and confirm delivery
AI agent
MigoSMTP MCPscoped key
send_emailSend a message
get_eventsRead delivery results
check_domainVerify DNS records
Sent · request id logged · delivery confirmed
MCP ready
Scoped and logged
Let AI agents call your APIThe same API is available over MCP, so an agent can send mail, read events and verify DNS. Keys are scoped, calls are logged, and sends can require approval.
One request
SDKs
Scoped keys
Rate limits
Webhooks
Agent API
SMTP relayREST APIWebhooksDedicated IPsDKIM signingInbound parseTemplatesAnalyticsSuppression listsReputation monitoringEmail validationTeam roles and audit logSMTP relayREST APIWebhooksDedicated IPsDKIM signingInbound parseTemplatesAnalyticsSuppression listsReputation monitoringEmail validationTeam roles and audit log
Capabilities

An API that behaves in production

REST endpoints

Predictable resources for messages, templates, domains and events.

The REST API gives you predictable resources for messages, templates, domains and events. Resource names and verbs follow common conventions, so a new developer can read the reference and send a first message in a few minutes. Requests and responses are JSON.

  • JSON in, JSON out
  • Consistent resource naming
  • Reference with copy-paste examples

Templates and variables

Send by template name and pass variables per message.

Store content once as a template and send it by name, passing variables for each message. Marketing and product teams can change wording without a code release, and developers keep sending code short and testable.

  • Variables per message
  • Change copy without redeploying
  • Same template across API and SMTP

Idempotency keys

Retry safely without sending duplicates.

Networks fail and clients retry. An idempotency key on the request lets you retry safely: the same key never produces a second email. This removes the most common cause of duplicate password resets and receipts.

  • Safe retries on timeouts
  • No duplicate sends
  • Key supplied by your code

Scoped API keys

Give each service only the permissions it needs.

Create keys per service and give each only the permissions it needs, for example send-only for a web app and read-only for a reporting job. If one key leaks, the blast radius is limited, and you can revoke it without redeploying anything else.

  • Least-privilege permissions
  • Revoke instantly
  • Separate keys per environment

Webhooks

Get signed events for every delivery outcome.

Signed webhooks report every delivery outcome back to your system as it happens, so your database reflects reality instead of assumptions. Verify the signature, update your records, and trigger follow-up logic from real events.

  • Delivered, bounced, complained and more
  • Signature verification
  • Retries if your endpoint is down

Clear errors and limits

Consistent error codes and rate limit headers.

Errors use consistent codes and messages, and rate-limit headers tell your client how much capacity is left. Your code can back off gracefully instead of guessing, and your logs explain failures without a support ticket.

  • Machine-readable error codes
  • Rate-limit headers on responses
  • Messages written for developers

How it works

Your serviceCalls the send endpoint over HTTPS with a scoped API key.
MigoSMTP email APIValidates the request, applies templates and limits, queues the message and returns an ID.
Events back to youSigned webhooks report delivery, bounce and complaint outcomes to your app.
STEP 1

Create an API key

Choose scopes and an IP allowlist for the service that will use it.

STEP 2

Send your first message

Call the send endpoint with a verified sender and a recipient.

STEP 3

Listen for events

Register a webhook to follow delivery, bounces and engagement.

See it in action

Email API in action

Each stage plays automatically. Select one to pause on it. Illustrative interface: all figures and addresses shown are sample data.

app.migosmtp.com/apiSample data
Key
Send only
Env
Production
Scope
Messages
Sample activityAuthenticate
requestPOST /v1/messages
authbearer key verified
scopesend permission ok
limitrate headers returned
Status
202
Id
Returned
Idempotency
Key set
Sample activitySend
bodytemplate and variables
responsemessage id returned
retrysame key, no duplicate
queuedaccepted
Delivered
Event
Bounced
Event
Signed
Yes
Sample activityEvents
deliveredevent posted
bouncedevent posted
signatureverified by your app
retrybackoff on 5xx
Templates
12
Domains
3
Keys
5
Sample activityManage
templatewelcome updated
domainverified
keyread-only created
errorclear code on failure
For developers

Versioned, documented and easy to test

Everything in the dashboard is available through the API, with samples in the languages you use.

  • Scoped keys with IP allowlisting
  • Idempotent requests for safe retries
  • Consistent error format
  • SDKs and copy-ready samples
At a glance01 / 05
Base URLapi.migosmtp.com/v1
AuthenticationBearer API key
FormatJSON over HTTPS
EventsSigned webhooks
ReferenceFull API reference and SDK samples
Overview

What is email API?

An email API is a web interface that lets your code send and manage email by calling HTTP endpoints instead of speaking SMTP. With the MigoSMTP email API you POST a JSON request with a verified sender, a recipient and either content or a template name, and the message is queued for delivery through our MigoMTA infrastructure. The response gives you an identifier to track it. You can also send with raw HTTP.

The API suits product teams who want predictable resources for messages, templates, domains and events. Keys are scoped, so a billing service can send receipts without being able to edit domains. Idempotency keys make retries safe, and consistent error codes with rate limit headers let clients back off cleanly. Everything in the dashboard is also available by API. Sandbox and production traffic can be separated using different workspaces and keys, which keeps test sends out of your live reporting and reputation.

For deliverability, an API gives you control SMTP cannot: structured errors, per-message metadata and event webhooks you can feed back into your application. Pair it with suppression handling and you stop mailing bad addresses automatically. Our MCP server lets AI agents call the same API under scoped, revocable keys, so automation stays inside limits you set. Because each key is scoped and logged, you can see exactly which service or agent sent which message and revoke access immediately if needed.

Use cases

Common email API use cases

Transactional email from your app

Trigger receipts, password resets and alerts with a single API call. Send by template name and pass variables, so product code stays free of HTML and copy changes.

Safe retries in job queues

Attach an idempotency key to each send. If a worker crashes and retries, the email API recognises the duplicate and does not send the same message twice.

Per-service keys in microservices

Issue one scoped key per service with an IP allowlist. If one service is compromised, you revoke a single key and the rest of your email pipeline keeps running.

Closing the loop with events

Combine the send endpoint with webhooks so your database reflects delivered, bounced and complained states. Support teams can then answer where an email went without opening logs.

Notifications from a SaaS product

Send in-app events such as invitations, usage alerts and billing notices through one API, with one key per service and templates owned by the product team.

Agents and automation

Give an AI agent or an internal tool a scoped key that can only send or only read status. Every call is logged against that key, so you can review what it did and revoke it at any time.

Choosing a method

Email API or SMTP relay?

Both deliver through the same infrastructure. Choose by how your software is built.

Email APISMTP relay
Best forNew code that wants templates, idempotency and structured responsesExisting apps, CMS plugins and devices that already speak SMTP
IntegrationHTTPS and JSON from any languageHost and credentials in your mail settings
ErrorsStructured error codes and rate limit headersSMTP response codes
Access controlScoped API keys, optional IP allowlistPer-account credentials and IP allowlist

You can use both under one workspace: SMTP for tools you cannot change, and the API for new services.

AI features

AI-assisted email API

Agent-ready

MCP server for AI agents

Connect an AI assistant to MigoSMTP through an MCP server so it can look up message status or draft sends. Keys carry the scopes you grant, and sends can require human approval.

Copilot

Error triage copilot

Paste an API error or failed request and the copilot explains the cause, such as an unverified sender or a malformed field, and shows a corrected call. You apply the fix yourself.

Assist

AI-drafted integration code

Describe what you want to send and the assistant generates a sample request in your language using our SDK conventions. Review and test it before it reaches production.

Predictive

Spike and abuse detection

Anomaly detection watches send rates per key and flags unusual bursts. It can notify your team or suggest pausing a key, and any automatic action is something you opt into.

AI features are assistive and optional: agents act only within the scopes you grant, and your team stays in control of keys and sends.

Best practices

Best practices for email API

Use idempotency keys on every send

Generate a stable key per logical email, such as the order ID plus the event. Retries after timeouts then never produce duplicate messages.

Scope keys to the minimum

Give each service only the permissions it needs and add an IP allowlist where addresses are fixed. Smaller blast radius means simpler incident response.

Respect rate limit headers

Read the limit headers in every response and back off before you are throttled. Exponential backoff with jitter handles bursts without hammering the API.

Verify webhook signatures

Check the signature on each event before trusting it. Rotate the secret on a schedule and immediately if it may have leaked.

Store the message ID

Save the identifier returned by the send call alongside your own record. It makes support lookups and event reconciliation straightforward later.

Keep test and live separate

Use different workspaces and keys for staging and production. Test mistakes then cannot reach real recipients or affect your reputation.

FAQs

Email API: frequently asked questions

Need a hand with your integration? Our team can review it with you before you go live.

What is an email API?

An email API is a set of HTTP endpoints that lets your software send and manage email without running mail servers. You send a JSON request, the provider queues and delivers the message, and you receive status updates through responses and webhooks.

How do I send an email with the MigoSMTP API?

Create an API key, verify a sender domain, then POST JSON to the send endpoint with a from address, recipient and either content or a template with variables. The response returns a message ID you can track. See the API reference for fields.

What is the difference between an email API and SMTP?

SMTP is a protocol that existing software already speaks, so it needs no code changes. An API uses HTTPS and JSON, which gives structured errors, templates, idempotency and metadata. Both use the same delivery infrastructure, so choose by how your application is built.

Is there a sandbox for testing the email API?

Use a separate workspace and API key for testing, so test sends stay out of your live reporting and sender reputation. Never share a key between test and live sending. Ask us if you need a test mode set up for your account.

How are API rate limits applied?

Limits are returned in response headers, so your client can see remaining capacity and back off before it is throttled. The values that apply to you depend on your plan. Build clients that read the headers and slow down gracefully.

Can I send emails in batches?

Check the API reference for the batch options and recipient limits that apply to your plan. Whatever the batch size, send an idempotency key with each request and respect the rate limit headers, so a partial failure can be retried without duplicates.

What is the MigoSMTP MCP server?

An MCP server is a standard way for AI assistants to call tools. Ours lets compatible agents work with the email API, for example to check message status, using scoped keys you control. Sends can require approval from a person.

Which languages and SDKs are supported?

It is a REST API over HTTPS, so any language that can make HTTP requests works. Copy-ready samples and SDKs are listed in the documentation. Keep API keys in environment variables or a secret manager, never in source code.

From the blog

Latest analysis, trends and market data

Start sending in minutes.

Create an account, add your domain and send your first email.

Get started Talk to sales