नया गाइड: प्रतिष्ठा को नुकसान पहुँचाए बिना डेडिकेटेड IP को वार्म-अप कैसे करें। अभी पढ़ें →
MigoSMTP
ईमेल API

अपने कोड से ईमेल भेजें, ट्रैक करें और मैनेज करें

सेंडिंग, टेम्पलेट, इवेंट और रिपोर्टिंग के लिए REST API, स्कोप्ड की और साफ़ एरर के साथ।

एजेंट-रेडी: MCP सर्वर AI असिस्टेंट को सुरक्षित रूप से मेल भेजने और जाँचने देता है।

रिक्वेस्ट
POST /v1/send
{ "from": "[email protected]",
"subject": "Hello" }
रिस्पॉन्स
202 Accepted
{ "id": "msg_[id]" }
Idempotency-Key समर्थित
202 Accepted
JSON
Idempotent
एक JSON कॉल से भेजेंbearer की से प्रमाणित करें, छोटी JSON बॉडी पोस्ट करें और तुरंत मैसेज ID पाएँ।
क्विकस्टार्ट
cURL
Node
Python
PHP
Python
import migosmtp
c = migosmtp.Client("KEY")
c.send(to="[email protected]",
template="welcome")
Sent · 202
टाइप्ड SDK
ओपन सोर्स
आपके स्टैक के लिए आधिकारिक लाइब्रेरीNode, Python, PHP या Go चुनें। वही कुछ पंक्तियाँ संदेश भेजती हैं और हर जगह एरर एक ही तरह संभालती हैं।
API की स्कोप
ईमेल भेजेंअनुमत
इवेंट पढ़ेंअनुमत
डोमेन मैनेज करेंसिर्फ़ एडमिन
रेट लिमिट[n] req/s
न्यूनतम विशेषाधिकार
सुरक्षित रूप से रोटेट करें
ठीक उतनी एक्सेस वाली कीज़ जितनी ज़रूरी हैहर सर्विस के लिए एक की बनाएँ, हर एक की क्षमता सीमित करें, और बाकी को छुए बिना किसी एक को रिवोक करें।
रेट लिमिट
ट्रैफ़िक स्पाइक
क्यू स्पाइक को सँभाल लेती है
कुछ नहीं छूटता
बैकप्रेशर
डेटा लॉस नहीं
बर्स्ट को सहजता से सँभालेंजब ट्रैफ़िक आपकी रेट से ऊपर जाता है, तो रिक्वेस्ट फ़ेल होने के बजाय क्यू में लगती हैं और निकलती जाती हैं, इसलिए कुछ नहीं छूटता।
मैसेज इवेंट
हस्ताक्षरित इवेंट
/events
200 OK
डेटा वेयरहाउस
200 OK
अलर्ट
30s में रीट्राई
HMAC हस्ताक्षरित
At-least-once
इवेंट उसी तरह लौटते हैंवही API सतह डिलीवर, खोले, क्लिक किए और बाउंस हुए इवेंट आपके एंडपॉइंट पर, हस्ताक्षरित रूप में, वापस स्ट्रीम करती है।
प्रिया को इनवॉइस ईमेल करें और डिलीवरी की पुष्टि करें
AI एजेंट
MigoSMTP MCPस्कोप्ड की
send_emailसंदेश भेजें
get_eventsडिलीवरी नतीजे पढ़ें
check_domainDNS रिकॉर्ड सत्यापित करें
Sent · request id लॉग हुआ · डिलीवरी की पुष्टि
MCP तैयार
स्कोप्ड और लॉग किया हुआ
AI एजेंट को अपना API कॉल करने देंवही API MCP पर भी उपलब्ध है, ताकि एजेंट मेल भेज सके, इवेंट पढ़ सके और DNS सत्यापित कर सके। की स्कोप्ड होती हैं, कॉल लॉग होते हैं, और भेजने के लिए मंज़ूरी ज़रूरी की जा सकती है।
एक अनुरोध
SDK
स्कोप्ड की
रेट लिमिट
वेबहुक
एजेंट API
SMTP रिलेREST APIवेबहुकडेडिकेटेड IPDKIM साइनिंगइनबाउंड पार्सटेम्पलेटएनालिटिक्ससप्रेशन लिस्टप्रतिष्ठा मॉनिटरिंगईमेल वैलिडेशनटीम भूमिकाएँ और ऑडिट लॉगSMTP रिलेREST APIवेबहुकडेडिकेटेड IPDKIM साइनिंगइनबाउंड पार्सटेम्पलेटएनालिटिक्ससप्रेशन लिस्टप्रतिष्ठा मॉनिटरिंगईमेल वैलिडेशनटीम भूमिकाएँ और ऑडिट लॉग
क्षमताएँ

ऐसा API जो प्रोडक्शन में भरोसेमंद चले

REST एंडपॉइंट

संदेश, टेम्पलेट, डोमेन और इवेंट के लिए अनुमानित रिसोर्स।

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

टेम्पलेट और वेरिएबल

टेम्पलेट के नाम से भेजें और हर संदेश के लिए वेरिएबल दें।

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

इडेम्पोटेंसी की

डुप्लिकेट भेजे बिना सुरक्षित रूप से दोबारा कोशिश करें।

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

स्कोप्ड API की

हर सर्विस को सिर्फ़ उतनी अनुमतियाँ दें जितनी उसे चाहिए।

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

वेबहुक

हर डिलीवरी नतीजे के लिए हस्ताक्षरित इवेंट पाएँ।

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

साफ़ एरर और सीमाएँ

एक जैसे एरर कोड और रेट लिमिट हेडर।

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

यह कैसे काम करता है

आपकी सर्विसस्कोप्ड API की के साथ HTTPS पर सेंड एंडपॉइंट को कॉल करती है।
MigoSMTP ईमेल APIअनुरोध को वैलिडेट करता है, टेम्पलेट और सीमाएँ लागू करता है, संदेश को क्यू में डालता है और ID लौटाता है।
आप तक लौटते इवेंटहस्ताक्षरित webhook डिलीवरी, बाउंस और शिकायत के नतीजे आपके ऐप को बताते हैं।
चरण 1

API की बनाएँ

जो सर्विस इसे इस्तेमाल करेगी, उसके लिए स्कोप और IP allowlist चुनें।

चरण 2

अपना पहला संदेश भेजें

सत्यापित सेंडर और एक प्राप्तकर्ता के साथ सेंड एंडपॉइंट को कॉल करें।

चरण 3

इवेंट सुनें

डिलीवरी, बाउंस और एंगेजमेंट देखने के लिए webhook रजिस्टर करें।

इसे चलते देखें

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/apiनमूना डेटा
Key
Send only
Env
Production
स्कोप
संदेश
Sample activityप्रमाणित करें
requestPOST /v1/messages
authbearer key verified
scopesend permission ok
limitrate headers returned
स्टेटस
202
Id
Returned
Idempotency
Key set
Sample activityभेजें
bodytemplate and variables
responsemessage id returned
retrysame key, no duplicate
क्यू मेंस्वीकृत
डिलीवर हुए
इवेंट
बाउंस हुए
इवेंट
हस्ताक्षरित
हाँ
Sample activityइवेंट
deliveredevent posted
bouncedevent posted
signatureverified by your app
retrybackoff on 5xx
टेम्पलेट
12
डोमेन
3
की
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

मिनटों में भेजना शुरू करें।

खाता बनाएँ, अपना डोमेन जोड़ें और पहला ईमेल भेजें।

मुफ़्त शुरू करें सेल्स से बात करें