Email भेजें

आपके हर email के लिए एक API।

इसमें सेटअप करें:
Cursor

Transactional हो या marketing, एक message हो या सौ, सब एक ही Email API से भेजे जाते हैं, जिसमें idempotency, suppression और webhooks पहले से मौजूद हैं। raw HTML pass करें या अपने React Email templates को render करें।

welcome.tsx
200 · 1.2s
import { BirdClient } from "@messagebird/sdk";
import { render } from "@react-email/render";
import { WelcomeEmail } from "./emails/welcome";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const { data, error } = await bird.email.send({
  from:    "Bird <hello@bird.com>",
  to:      ["ada@example.com"],
  subject: "Your invite is ready",
  html:    await render(<WelcomeEmail name="Ada" />),
}).safe();

if (error) throw error;
console.log(data.id);
// → "em_2bX91Yk8h..."

अपना पहला email पाँच मिनट में भेजें।

उसी language से जो आप पहले से इस्तेमाल करते हैं।

Sending Bird Email API का मूल है। पहला send किसी अधिकृत test address (delivered@messagebird.dev) पर जा सकता है, ताकि domain verify करने से पहले ही आप पूरे platform (sends, webhooks, suppression) को आज़मा सकें।

1
2
3
4
5
6
7
8
9
10
import { BirdClient } from "@messagebird/sdk";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const { data, error } = await bird.email.send({
  from:    "you@yourdomain.com",
  to:      ["delivered@bird.dev"],
  subject: "Hello from Node",
  html:    "<p>It works.</p>",
}).safe();

पाँच चीज़ें जो आप खुद नहीं बनाते।

हर Bird channel पर वही contract।

  1. 01

    Transactional + marketing.

    वही endpoint एक password reset भेजता है या एक campaign। एक category फील्ड तय करता है कि suppression और unsubscribes कैसे लागू होंगे।

  2. 02

    Templates आपके तरीके से।

    raw HTML pass करें, या अपने app में React Email templates को HTML में render करके नतीजा भेजें। आपका toolchain, बिना बदलाव के।

  3. 03

    100 तक batch करें।

    प्रति call अधिकतम 100 स्वतंत्र messages, हर एक का अपना recipient और variables, एक इकाई के रूप में validate किए जाते हैं ताकि आप कभी आधा-अधूरा न भेजें।

  4. 04

    contract से ही idempotent।

    हर send एक idempotency key स्वीकार करता है, इसलिए timeout के बाद retry की गई request दोबारा भेजने के बजाय मूल नतीजा ही लौटाती है।

  5. 05

    हर state change पर एक webhook।

    Accepted, delivered, opened, clicked, bounced, complained। हर एक HMAC-signed, replay-protected, idempotent, हर channel पर वही envelope।

पहले से कहीं और भेज रहे हैं? एक दोपहर में switch करें।

जो call आप पहले से करते हैं उसमें मुश्किल से कुछ बदलता है: client बदलें, अपने templates रखें, अपने webhooks को एक endpoint पर point करें। Migration guides में SendGrid, Amazon SES, Mailgun और Resend शामिल हैं।

sendgrid.ts
SendGrid
import sgMail from "@sendgrid/mail";

sgMail.setApiKey(process.env.SENDGRID_API_KEY!);

await sgMail.send({
  from:    "hello@bird.com",
  to:      "ada@example.com",
  subject: "Your invite is ready",
  html:    "<p>Welcome aboard, Ada.</p>",
});
bird.ts
Bird
import { BirdClient } from "@messagebird/sdk";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

await bird.email.send({
  from:    "hello@bird.com",
  to:      ["ada@example.com"],
  subject: "Your invite is ready",
  html:    "<p>Welcome aboard, Ada.</p>",
});

एक message हो या सौ, एक ही call।

एक request में 100 तक स्वतंत्र messages batch करें, हर एक का अपना recipient और variables। batch एक इकाई के रूप में validate होता है: एक खराब message call को 422 के साथ reject कर देता है, इसलिए आप कभी आधा-अधूरा नहीं भेजते। एक single idempotency key पूरी request को retry करने के लिए सुरक्षित बना देती है।

digest.ts
202 · batch
import { BirdClient } from "@messagebird/sdk";
import { render } from "@react-email/render";
import { Digest } from "./emails/digest";

const bird = new BirdClient({ apiKey: process.env.BIRD_API_KEY! });

const messages = await Promise.all(
  users.map(async (u) => ({
    from:    "Bird <hello@bird.com>",
    to:      [u.email],
    subject: "Your weekly digest",
    html:    await render(<Digest user={u} />),
  })),
);

const { data: batch, error } = await bird.email
  .sendBatch(messages, { idempotencyKey: `digest-${runId}` })
  .safe();

if (error) throw error;
console.log(`queued ${batch.data.length} messages`);

हर send के साथ अपना संदर्भ जोड़ें।

Tags एक first-class, filterable dimension हैं: stats API में delivery और engagement को campaign, template या experiment के हिसाब से slice करें (प्रति message 20 तक)। Metadata मनमाना JSON है, 2 KB तक, जो हर read और webhook पर बिना छेड़छाड़ के round-trip करता है, ताकि आपके अपने IDs message के साथ चलते रहें।

tagged.ts
await bird.email.send({
  from:     "Bird <hello@bird.com>",
  to:       ["ada@example.com"],
  subject:  "Your invite is ready",
  html:     "<p>Welcome aboard, Ada.</p>",
  tags:     [{ name: "campaign", value: "spring-2026" }],
  metadata: { user_id: "u_2bX91", order_id: "ord_5512" },
});

हर message को उसके पूरे जीवनकाल में देखें।

एक send तुरंत 202 लौटाता है; नतीजा हर recipient के लिए एक webhook के रूप में आता है। एक signature verify करें, type पर switch करें: वही envelope जिसे आप SMS, voice और WhatsApp के लिए पहले से handle करते हैं।

app/api/webhooks/bird/route.ts
signed
import { bird } from "@/lib/bird";

export async function POST(req: Request) {
  const event = bird.webhooks.unwrap(
    await req.text(),
    Object.fromEntries(req.headers),
  );

  switch (event.type) {
    case "email.delivered":
      await markDelivered(event.data.email_id);
      break;
    case "email.bounced":
      await flag(event.data.recipient, event.data.bounce_type);
      break;
  }

  return new Response(null, { status: 204 });
}

Hard bounces, complaints और unsubscribes आपकी suppression list को भी अपने-आप अपडेट करते हैं, ताकि एक खराब address आपकी reputation को दोबारा नुकसान न पहुँचाए।

  • email.acceptedAPI द्वारा स्वीकार किया गया और delivery के लिए queue किया गया।
  • email.processedबनाया गया और sending pipeline को सौंपा गया।
  • email.deliveredप्राप्त करने वाले mail server ने message स्वीकार कर लिया।
  • email.deferredएक अस्थायी विफलता जिसे Bird अपने-आप retry करता है।
  • email.bouncedस्थायी विफलता: payload में bounce type और SMTP code।
  • email.openedTracking pixel load हुआ (बिना prefetch वाले opens गिने जाते हैं)।
  • email.clickedएक tracked link पर click किया गया।
  • email.complainedrecipient ने message को spam के रूप में रिपोर्ट किया।
  • email.unsubscribedrecipient ने message body में एक tracked link के ज़रिए unsubscribe किया।

live होने से पहले हर नतीजा test करें।

sandbox में, नतीजा address तय करता है, आपके account की स्थिति नहीं। साफ delivery के लिए delivered@messagebird.dev पर भेजें, या हर failure path को असली pipeline और webhooks के ज़रिए चलाने के लिए bounce@, complaint@ और suppressed@ पर भेजें। न कोई domain verify करना, न आपकी reputation पर कोई जोखिम। Production sending उसी तरह gated है जैसे होना चाहिए: पहले आप एक domain verify करते हैं, और एक नया domain या dedicated IP पूरा volume ले जाने से पहले reputation warmup से गुज़रता है।

docs में और गहराई से जानें।

sending guide पढ़ें, email events और webhooks wire up करें, या अगर आप किसी दूसरे provider से आ रहे हैं, तो SendGrid, SES, Mailgun या Resend से एक migration guide follow करें।

Sending से जुड़े सवाल-जवाब

क्या मैं transactional और marketing दोनों तरह के Email भेज सकता हूँ?+
हाँ। दोनों एक ही send API से जाते हैं; फर्क सिर्फ category फील्ड का है, जो तय करता है कि suppression और unsubscribes कैसे लागू होंगे। password reset और receipts के लिए transactional चुनें, campaigns के लिए marketing।
क्या आप React Email templates को सपोर्ट करते हैं?+
अपने React Email templates को अपनी application में HTML में render करें — @react-email/render का render function बिना किसी बदलाव के काम करता है — और नतीजे को html body के तौर पर pass करें। आपके template toolchain में कुछ नहीं बदलता।
मैं एक request में कितने emails भेज सकता हूँ?+
प्रति batch call में अधिकतम 100 स्वतंत्र messages, हर एक का अपना recipient, subject और variables। batch एक इकाई के रूप में validate होता है, इसलिए एक invalid message पूरी call को 422 के साथ reject कर देता है — आप कभी आधा-अधूरा नहीं भेजते। एक single message में to, cc और bcc मिलाकर 1–50 recipients होते हैं।
अगर कोई request time out हो जाए और मैं उसे retry करूँ तो क्या होगा?+
हर logical send के साथ एक Idempotency-Key भेजें। अगर मूल request सफल रही पर response खो गया, तो उसी key के साथ दोबारा भेजने पर मूल नतीजा ही वापस मिलता है (एक Idempotency-Replay header के साथ चिह्नित), न कि दोबारा भेजा जाता है।
rate limits क्या हैं?+
Single sends और batches की अलग-अलग limits हैं — free tier पर 10 single sends और 5 batch calls प्रति मिनट (5 × 100 = 500 messages/min), जो Growth पर बढ़कर 1,000 sends और 100 batch calls प्रति मिनट हो जाती हैं। Limits requests गिनती हैं, recipients नहीं, इसलिए batching ही volume बढ़ाने की चाबी है।
असली email भेजे बिना मैं test कैसे करूँ?+
delivered@messagebird.dev जैसे किसी sandbox address पर भेजें — नतीजा address से तय होता है, आपके account की स्थिति से नहीं — ताकि domain verify करने से पहले ही आप sends, webhooks और suppression आज़मा सकें। bounce@ और complaint@ जैसे addresses उन नतीजों को असली pipeline के ज़रिए simulate करते हैं।
क्या मैं MTA खुद, on-prem चला सकता हूँ?+
ज़्यादातर टीमें अपने खुद के mail servers कभी नहीं चलातीं; hosted Email API यह उनके लिए करता है। पर अगर आपके पास MTA खुद चलाने की कोई ठोस वजह है, जैसे data-residency नियम या मौजूदा on-prem setup, तो Bird दो के license देता है: Momentum और PowerMTA। infrastructure आप चलाते हैं; deliverability stack वही है जो hosted API के पीछे है।

दुनिया का करीब 40% commercial email पहले से ही Bird पर चलता है।

एक दशक से हमारे चलाए infrastructure पर transactional और marketing email। Sending, Bird Email API की एक क्षमता है: deliverability, dedicated IPs, suppression और analytics इसके साथ आते हैं।

एक चैनल से शुरुआत करें।
तैयार होने पर बाकी जोड़ें।

एक test API key तुरंत आपकी है। जब आप payment method जोड़ते हैं और sender verify करते हैं, तब production अनलॉक हो जाता है।

Claude Code, Cursor या Codex इस्तेमाल कर रहे हैं? एक setup prompt कॉपी करें और आपका agent आपके लिए Bird CLI और skills इंस्टॉल कर देगा। अपना चुनें:

Cursor