Audiences और contacts
प्रीव्यू मेंसाफ-सुथरी लिस्ट, पहले से बनी हुई।
अपने contacts एक बार स्टोर करें, email से unique रखें, और उन्हें उन audiences में समूहित करें जिन्हें आप किसी broadcast से टारगेट करते हैं। एक typed property registry आपके डेटा को साफ रखती है, और 1,000-row batch upsert किसी लिस्ट को तेज़ी से ले आता है।
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..."
You can sign in any time at bird.com/login.
Your test API key is on your dashboard, ready to send.
एक ही contact record. ऐसे attributes जो इधर-उधर नहीं भटकते।
Audiences Bird Email API का हिस्सा हैं: एक contact email से unique होता है और आपकी सभी audiences में शेयर होता है, एक audience बस उन्हीं contacts का एक सेट है, और attributes हमेशा contact पर रहते हैं, हर लिस्ट पर कॉपी नहीं होते। property registry का मतलब है कि गलत टाइप किया गया field लिखते समय ही रिजेक्ट हो जाता है, किसी campaign में जाकर पता नहीं चलता।
पाँच चीज़ें जो आपके डेटा को साफ रखती हैं।
डेटा मॉडल खुद हिसाब-किताब संभालता है, इसलिए आपकी लिस्ट खराब नहीं होतीं।
- 01
हर व्यक्ति का एक record।
हर email पर एक contact, जिसमें first और last name, एक external ID, और आपका अपना custom data होता है।
- 02
Audiences यानी membership।
एक audience उन contacts का सेट है जिन्हें आप आज़ादी से जोड़ते और हटाते हैं। Attributes हमेशा contact पर रहते हैं, कभी लिस्ट पर कॉपी नहीं होते।
- 03
Typed property registry।
अपने custom fields पहले ही परिभाषित करें: string, number, या boolean, वैकल्पिक fallbacks के साथ। अनजान keys और गलत-type वाली values लिखते समय ही रिजेक्ट हो जाती हैं।
- 04
1,000 तक batch upsert करें।
एक ही call में 1,000 तक contacts upsert करें, और उन्हें उसी request में किसी audience से जोड़ दें।
- 05
Exact-match lookup।
किसी contact को exact email match से खोजें, ताकि आपके अपने सिस्टम हर record स्कैन किए बिना sync कर सकें।
एक ही call में पूरी लिस्ट ले आएँ।
Upsert email पर idempotent है, इसलिए import दोबारा चलाने पर contacts अपडेट होते हैं, डुप्लिकेट नहीं। 1,000 तक contacts जोड़ें और उन्हें उसी request में किसी audience से जोड़ें, किसी अलग membership step या बाद में de-dupe pass की ज़रूरत नहीं। बड़ी लिस्ट 1,000 के batches में जाती हैं। हर call स्वतंत्र है, इसलिए बीच में रुका हुआ import जहाँ रुका वहीं से सुरक्षित रूप से फिर शुरू किया जा सकता है।
// Upsert up to 1,000 contacts and add them to an audience at once.
await bird.email.contacts.batchUpsert({
audienceId: "aud_2bX91Yk8h",
contacts: [
{ email: "ada@example.com", firstName: "Ada", data: { plan: "growth" } },
{ email: "grace@example.com", firstName: "Grace", data: { plan: "free" } },
],
});
ऐसे fields जो भटक नहीं सकते।
Custom contact data एक typed registry से गुज़रता है। हर field को एक बार string, number, या boolean के रूप में एक वैकल्पिक fallback के साथ घोषित करें, और गलत टाइप की गई key या गलत-type वाली value उसी पल रिजेक्ट हो जाती है जब आप उसे लिखते हैं, किसी campaign के बीच में जाकर पता नहीं चलता। चूँकि attributes contact पर रहते हैं, लिस्ट पर नहीं, किसी को audiences के बीच ले जाने पर पीछे कोई पुरानी कॉपी नहीं छूटती।
Audiences और contacts FAQ
क्या contacts per-audience होते हैं या global?+
Property registry क्या है?+
मैं कोई लिस्ट कैसे import करूँ?+
Audiences का broadcasts से क्या संबंध है?+
बाकी Email प्लेटफ़ॉर्म
एक API, keys का एक ही सेट। बाकी क्षमताएँ एक्सप्लोर करें।
दुनिया का लगभग 40% commercial email पहले से ही Bird पर चलता है।
एक दशक से हमारे चलाए इंफ्रास्ट्रक्चर पर transactional और marketing email। Audiences, Bird Email API की एक क्षमता है: sending, broadcasts, deliverability, suppression, और analytics इसी के साथ आते हैं।