Neuer Leitfaden: So wärmen Sie eine dedizierte IP auf, ohne Ihre Reputation zu gefährden. Jetzt lesen →
Anmelden
MigoSMTP
E-Mail-API

E-Mails per Code senden, tracken und verwalten

Eine REST API für Versand, Templates, Events und Reporting, mit Keys mit begrenztem Scope und klaren Fehlermeldungen.

Agent-ready: Ein MCP-Server lässt KI-Assistenten Mails sicher senden und prüfen.

Request
POST /v1/send
{ "from": "[email protected]",
"subject": "Hello" }
Response
202 Accepted
{ "id": "msg_[id]" }
Idempotency-Key unterstützt
202 Accepted
JSON
Idempotent
Senden mit einem einzigen JSON-AufrufAuthentifizieren Sie sich mit einem Bearer-Key, senden Sie einen kleinen JSON-Body und erhalten Sie sofort eine Message-ID zurück.
Schnellstart
cURL
Node
Python
PHP
Python
import migosmtp
c = migosmtp.Client("KEY")
c.send(to="[email protected]",
template="welcome")
Gesendet · 202
Typisierte SDKs
Open Source
Offizielle Bibliotheken für Ihren StackWählen Sie Node, Python, PHP oder Go. Dieselben wenigen Zeilen senden eine Nachricht und behandeln Fehler überall gleich.
Scopes für API-Keys
E-Mail sendenErlaubt
Events lesenErlaubt
Domains verwaltenNur Admins
Ratenlimit[n] Req/s
Least Privilege
Sicher rotieren
Keys mit genau dem Zugriff, den sie brauchenErstellen Sie einen Key pro Service, begrenzen Sie, was jeder darf, und widerrufen Sie einen, ohne die anderen anzufassen.
Ratenlimit
Traffic-Spitze
Die Queue glättet die Spitze
Nichts geht verloren
Backpressure
Kein Datenverlust
Lastspitzen souverän abfangenWenn der Traffic Ihre Rate übersteigt, werden Requests in die Queue gestellt und abgearbeitet statt abgelehnt, sodass nichts verloren geht.
Nachrichten-Events
Signierte Events
/events
200 OK
Data Warehouse
200 OK
Alarme
Neuversuch in 30 s
HMAC-signiert
At-least-once
Events kommen auf demselben Weg zurückDieselbe API-Oberfläche streamt Events zu Zustellung, Öffnung, Klick und Bounce signiert an Ihren Endpunkt zurück.
Mailen Sie die Rechnung an Priya und bestätigen Sie die Zustellung
KI-Agent
MigoSMTP MCPeingeschränkter Key
send_emailEine Nachricht senden
get_eventsZustellergebnisse lesen
check_domainDNS-Records prüfen
Gesendet · Request-ID protokolliert · Zustellung bestätigt
MCP bereit
Eingeschränkt und protokolliert
KI-Agenten Ihre API aufrufen lassenDieselbe API steht auch über MCP bereit, sodass ein Agent E-Mails senden, Events lesen und DNS prüfen kann. Keys sind eingeschränkt, Aufrufe werden protokolliert, und Sendungen können eine Freigabe erfordern.
Eine Anfrage
SDKs
Eingeschränkte Keys
Rate Limits
Webhooks
Agent-API
SMTP-RelayREST-APIWebhooksDedizierte IPsDKIM-SignierungInbound ParseTemplatesAnalyticsSuppression-ListenReputations-MonitoringE-Mail-ValidierungTeam-Rollen und Audit-LogSMTP-RelayREST-APIWebhooksDedizierte IPsDKIM-SignierungInbound ParseTemplatesAnalyticsSuppression-ListenReputations-MonitoringE-Mail-ValidierungTeam-Rollen und Audit-Log
Funktionen

Eine API, die sich in Produktion bewährt

REST-Endpunkte

Vorhersehbare Ressourcen für Nachrichten, Templates, Domains und 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 und Variablen

Per Template-Name senden und Variablen pro Nachricht übergeben.

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

Sicher wiederholen, ohne Duplikate zu versenden.

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

Eingeschränkte API-Keys

Jeder Service erhält nur die Berechtigungen, die er braucht.

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

Erhalten Sie signierte Events zu jedem Zustellergebnis.

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

Klare Fehler und Limits

Einheitliche Fehlercodes und Rate-Limit-Header.

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

So funktioniert es

Ihr ServiceRuft den Send-Endpunkt per HTTPS mit einem eingeschränkten API-Key auf.
MigoSMTP-E-Mail-APIPrüft die Anfrage, wendet Templates und Limits an, reiht die Nachricht ein und liefert eine ID zurück.
Events zurück an SieSignierte Webhooks melden Zustell-, Bounce- und Beschwerde-Ergebnisse an Ihre App.
SCHRITT 1

API-Key erstellen

Wählen Sie Scopes und eine IP-Allowlist für den Service, der ihn nutzt.

SCHRITT 2

Erste Nachricht senden

Rufen Sie den Send-Endpunkt mit verifiziertem Absender und einem Empfänger auf.

SCHRITT 3

Auf Events lauschen

Registrieren Sie einen Webhook, um Zustellung, Bounces und Engagement zu verfolgen.

In Aktion sehen

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/apiBeispieldaten
Key
Send only
Env
Production
Scope
Nachrichten
Sample activityAuthentifizieren
requestPOST /v1/messages
authbearer key verified
scopesend permission ok
limitrate headers returned
Status
202
Id
Returned
Idempotency
Key set
Sample activitySenden
bodytemplate and variables
responsemessage id returned
retrysame key, no duplicate
in der Queueangenommen
Zugestellt
Event
Gebounct
Event
Signiert
Ja
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

In wenigen Minuten versenden.

Konto erstellen, Domain hinzufügen und die erste E-Mail senden.

Kostenlos starten Vertrieb kontaktieren