Audiences और contacts

साफ-सुथरी लिस्ट, पहले से बनी हुई।

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

अपने contacts एक बार स्टोर करें, email से unique रखें, और उन्हें उन audiences में समूहित करें जिन्हें आप किसी broadcast से टारगेट करते हैं। एक typed property registry आपके डेटा को साफ रखती है, और 1,000-row batch upsert किसी लिस्ट को तेज़ी से ले आता है।

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..."

एक ही contact record. ऐसे attributes जो इधर-उधर नहीं भटकते।

Audiences Bird Email API का हिस्सा हैं: एक contact email से unique होता है और आपकी सभी audiences में शेयर होता है, एक audience बस उन्हीं contacts का एक सेट है, और attributes हमेशा contact पर रहते हैं, हर लिस्ट पर कॉपी नहीं होते। property registry का मतलब है कि गलत टाइप किया गया field लिखते समय ही रिजेक्ट हो जाता है, किसी campaign में जाकर पता नहीं चलता।

पाँच चीज़ें जो आपके डेटा को साफ रखती हैं।

डेटा मॉडल खुद हिसाब-किताब संभालता है, इसलिए आपकी लिस्ट खराब नहीं होतीं।

  1. 01

    हर व्यक्ति का एक record।

    हर email पर एक contact, जिसमें first और last name, एक external ID, और आपका अपना custom data होता है।

  2. 02

    Audiences यानी membership।

    एक audience उन contacts का सेट है जिन्हें आप आज़ादी से जोड़ते और हटाते हैं। Attributes हमेशा contact पर रहते हैं, कभी लिस्ट पर कॉपी नहीं होते।

  3. 03

    Typed property registry।

    अपने custom fields पहले ही परिभाषित करें: string, number, या boolean, वैकल्पिक fallbacks के साथ। अनजान keys और गलत-type वाली values लिखते समय ही रिजेक्ट हो जाती हैं।

  4. 04

    1,000 तक batch upsert करें।

    एक ही call में 1,000 तक contacts upsert करें, और उन्हें उसी request में किसी audience से जोड़ दें।

  5. 05

    Exact-match lookup।

    किसी contact को exact email match से खोजें, ताकि आपके अपने सिस्टम हर record स्कैन किए बिना sync कर सकें।

एक ही call में पूरी लिस्ट ले आएँ।

Upsert is idempotent on the identifiers each entry carries, so re-running an import updates rather than duplicates. Add up to 1,000 contacts and join them to an audience in the same request, with no separate membership step and no de-dupe pass afterward. Larger lists go up in batches of 1,000. Each call is independent, so an interrupted import is safe to resume where it stopped.

import.ts
202
// Upsert up to 1,000 contacts and add them to an audience at once.
const result = await bird.contacts.batch({
  audience_ids: ["adn_01krdgeqcxet5s7t44vh8rt9mg"],
  contacts: [
    { email: "ada@example.com",   first_name: "Ada",   data: { plan: "growth" } },
    { email: "grace@example.com", first_name: "Grace", data: { plan: "free" } },
  ],
});

// Per-contact results come back in submission order.
for (const item of result.data) {
  console.log(item.email, item.status);
}

ऐसे fields जो भटक नहीं सकते।

Custom contact data एक typed registry से गुज़रता है। हर field को एक बार string, number, या boolean के रूप में एक वैकल्पिक fallback के साथ घोषित करें, और गलत टाइप की गई key या गलत-type वाली value उसी पल रिजेक्ट हो जाती है जब आप उसे लिखते हैं, किसी campaign के बीच में जाकर पता नहीं चलता। चूँकि attributes contact पर रहते हैं, लिस्ट पर नहीं, किसी को audiences के बीच ले जाने पर पीछे कोई पुरानी कॉपी नहीं छूटती।

बाकी Email के साथ काम करता है।

यहाँ बनाई गई audiences को किसी broadcast से टारगेट करें, और वही contacts send API के ज़रिए transactional mail पाते हैं।

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

एक दशक से हमारे चलाए इंफ्रास्ट्रक्चर पर transactional और marketing email। Audiences, Bird Email API की एक क्षमता है: sending, broadcasts, deliverability, suppression, और analytics इसी के साथ आते हैं।

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

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

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

Cursor