Novo guia: como aquecer um IP dedicado sem prejudicar sua reputação. Ler agora →
MigoSMTP
API de e-mail

Envie, acompanhe e gerencie e-mails a partir do seu código

Uma API REST para envio, templates, eventos e relatórios, com chaves de escopo restrito e erros claros.

Pronta para agentes: um servidor MCP permite que assistentes de IA enviem e inspecionem e-mails com segurança.

Requisição
POST /v1/send
{ "from": "[email protected]",
"subject": "Hello" }
Resposta
202 Accepted
{ "id": "msg_[id]" }
Idempotency-Key suportado
202 Accepted
JSON
Idempotente
Envie com uma única chamada JSONAutentique-se com uma chave bearer, envie um pequeno corpo JSON e receba um ID de mensagem na hora.
Início rápido
cURL
Node
Python
PHP
Python
import migosmtp
c = migosmtp.Client("KEY")
c.send(to="[email protected]",
template="welcome")
Enviado · 202
SDKs tipados
Código aberto
Bibliotecas oficiais para a sua stackEscolha Node, Python, PHP ou Go. As mesmas poucas linhas enviam uma mensagem e tratam erros do mesmo jeito em qualquer lugar.
Escopos de chave de API
Enviar e-mailPermitido
Ler eventosPermitido
Gerenciar domíniosSomente administradores
Limite de taxa[n] req/s
Privilégio mínimo
Rotação segura
Chaves com exatamente o acesso de que precisamCrie uma chave por serviço, limite o que cada uma pode fazer e revogue uma sem mexer nas outras.
Limite de taxa
Pico de tráfego
A fila suaviza o pico
Nada é descartado
Contrapressão
Sem perda de dados
Absorva picos com tranquilidadeQuando o tráfego ultrapassa a sua taxa, as requisições entram na fila e são processadas em vez de falhar, então nada é descartado.
eventos de mensagem
Eventos assinados
/events
200 OK
Data warehouse
200 OK
Alertas
Nova tentativa em 30s
Assinado com HMAC
Pelo menos uma vez
Os eventos voltam do mesmo jeitoA mesma superfície de API envia de volta ao seu endpoint, com assinatura, os eventos de entrega, abertura, clique e rejeição.
Envie a fatura por e-mail para a Priya e confirme a entrega
Agente de IA
MigoSMTP MCPchave com escopo
send_emailEnviar uma mensagem
get_eventsLer os resultados de entrega
check_domainVerificar registros DNS
Enviado · ID da requisição registrado · entrega confirmada
MCP pronto
Com escopo e registro
Deixe agentes de IA chamarem sua APIA mesma API está disponível via MCP, para que um agente possa enviar e-mails, ler eventos e verificar DNS. As chaves têm escopo restrito, as chamadas são registradas e os envios podem exigir aprovação.
Uma requisição
SDKs
Chaves com escopo
Limites de taxa
Webhooks
API para agentes
Relay SMTPAPI RESTWebhooksIPs dedicadosAssinatura DKIMInbound parseTemplatesAnálisesListas de supressãoMonitoramento de reputaçãoValidação de e-mailFunções de equipe e log de auditoriaRelay SMTPAPI RESTWebhooksIPs dedicadosAssinatura DKIMInbound parseTemplatesAnálisesListas de supressãoMonitoramento de reputaçãoValidação de e-mailFunções de equipe e log de auditoria
Recursos

Uma API que se comporta bem em produção

Endpoints REST

Recursos previsíveis para mensagens, templates, domínios e eventos.

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 e variáveis

Envie pelo nome do template e passe variáveis por mensagem.

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

Chaves de idempotência

Tente de novo com segurança, sem enviar duplicatas.

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

Chaves de API com escopo

Dê a cada serviço apenas as permissões de que ele precisa.

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

Receba eventos assinados para cada resultado de entrega.

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

Erros e limites claros

Códigos de erro consistentes e cabeçalhos de limite de taxa.

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

Como funciona

Seu serviçoChama o endpoint de envio por HTTPS com uma chave de API com escopo.
API de e-mail do MigoSMTPValida a requisição, aplica templates e limites, coloca a mensagem na fila e retorna um ID.
Eventos de volta para vocêWebhooks assinados informam ao seu app os resultados de entrega, bounce e reclamação.
ETAPA 1

Crie uma chave de API

Escolha os escopos e uma lista de IPs permitidos para o serviço que vai usá-la.

ETAPA 2

Envie sua primeira mensagem

Chame o endpoint de envio com um remetente verificado e um destinatário.

ETAPA 3

Escute os eventos

Registre um webhook para acompanhar entregas, bounces e engajamento.

Veja em ação

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/apiDados de exemplo
Key
Send only
Env
Production
Escopo
Mensagens
Sample activityAutentique
requestPOST /v1/messages
authbearer key verified
scopesend permission ok
limitrate headers returned
Status
202
Id
Returned
Idempotency
Key set
Sample activityEnviar
bodytemplate and variables
responsemessage id returned
retrysame key, no duplicate
na filaaceito
Entregues
Evento
Com bounce
Evento
Assinado
Sim
Sample activityEventos
deliveredevent posted
bouncedevent posted
signatureverified by your app
retrybackoff on 5xx
Templates
12
Domínios
3
Chaves
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

Comece a enviar em minutos.

Crie uma conta, adicione seu domínio e envie seu primeiro e-mail.

Começar grátis Falar com vendas