Bird 产品
九大接口。 一个平台。 统一架构。
Email、SMS、Voice、WhatsApp、Verify、Lookup、RCS、Push 和 Realtime — 每一个都是一流的 API。相同的认证、相同的幂等性、相同的 Webhooks、相同的错误封装。学会一个,就等于学会了全部。
全部产品。 九大接口,一个 SDK。
01POST /v1/emails
Email. 为同时处理多种消息的开发者打造的邮件 API。
welcome.tsx
await bird.email.send({
to: ["alex@example.com"],
subject: "Welcome to Bird",
html: "<p>You're in. Let's ship.</p>",
});02POST /v1/sms
SMS. 为真正需要快速交付的开发者打造的 SMS API。
notify.ts
await bird.sms.send({
to: "+15005550006",
text: "Your code is 847291. Expires in 10 min.",
});03POST /v1/voice/calls
Voice. 用 JSON 实现可编程语音。通话、IVR、录音、TTS。
dial.ts
await bird.voice.calls.create({
to: "+15005550010",
from: "+14155550199",
flow: [
{ say: "Your order is confirmed." },
],
});04POST /v1/whatsapp/messages
WhatsApp. WhatsApp Business API,省去 BSP 的繁琐流程。
message.ts
await bird.whatsapp.send({
to: "+15005550006",
type: "text",
text: { body: "Order confirmed! 🎉" },
});05POST /v1/verify/verifications
Verify. 为需要验证码必达的开发者打造的 OTP API。
verify.ts
await bird.verify.verifications.create({
to: { phone_number: "+15005550006" },
});
// check by target — no id to store
await bird.verify.verifications.check({
to: { phone_number: "+15005550006" }, code: userCode,
});06GET /v1/lookup
Lookup. 号码智能查询:线路类型、运营商、欺诈信号。
lookup.ts
const { lineType, carrier, fraud } =
await bird.lookup.get("+15005550006");07POST /v1/rcs
RCS. RCS 商业消息 — SMS 更出色的升级版。
rich.ts
await bird.rcs.send({
to: "+15005550006",
text: "Your order shipped! 📦",
suggestions: [
{ type: "openUrl", text: "Track it", url },
],
});08POST /v1/push
Push. 适用于 iOS、Android 和 Web 的推送通知。
push.ts
await bird.push.send({
to: { deviceToken },
notification: {
title: "Order shipped!",
body: "Your package is on its way.",
},
});09POST /v1/realtime/publish
Realtime. 基于 WebSocket 的托管发布/订阅服务。订阅、发布、弹性扩展。
realtime.ts
await bird.realtime.publish({
channel: "orders",
event: "order.shipped",
data: { orderId, status: "shipped" },
});以上每个产品共享同一套认证模型、同一套幂等性契约、同一套错误封装、同一套 Webhook 契约、同一套游标分页方案。学会一个,就等于学会了全部。
/ Auth
/ Idempotency
/ Errors
/ Webhooks
/ Pagination
/ Typed IDs