SMS OTP

SMS से कोड भेजें. recipient के आधार पर जाँचें.

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

SMS verification sends a one-time code to a phone number and confirms the person typing it back holds the line. Bird generates the code, sends it, enforces per-recipient caps, and checks it by recipient, so there's no id to store and no resend endpoint to wire.

verify.ts
200 · pending
import { BirdClient } from "@messagebird/sdk";

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

// Send the code, then check it by recipient.
await bird.verify.verifications.create({
  to: { phone_number: "+15551234567" },
}).safe();

const { data } = await bird.verify.verifications.check({
  to:   { phone_number: "+15551234567" },
  code: userInput,
}).safe();

SMS OTP भेजने के लिए एक कॉल और जाँचने के लिए एक कॉल है।

SMS Bird Verify API पर एक फ़ोन-फ़ैमिली चैनल है: फ़ोन नंबर के साथ एक verification पोस्ट करें और हम साझा Authifly SMS sender पर कोड भेजते हैं; उसी नंबर से इसे जाँचें। create को दोबारा पोस्ट करना ही resend है (create-or-retry), और सेशन का हर कोड तब तक वैध रहता है जब तक वह वेरिफाई नहीं हो जाता, एक्सपायर नहीं हो जाता, या उसके attempts खत्म नहीं हो जाते।

SMS verification पर आपको क्या मिलता है।

हर सेंड में बिल्ट-इन।

  1. 01

    फ़ोन नंबर से संबोधित।

    एक अकेला E.164 फ़ोन नंबर पास करें। हम इसे नॉर्मलाइज़ करते हैं और उसके देश के लिए रिज़ॉल्व किए गए sender पर SMS से भेजते हैं।

  2. 02

    सर्वर-जनरेटेड, हैश किए गए कोड।

    डिफ़ॉल्ट रूप से 6-अंकों का कोड (4–10 कॉन्फ़िगर करने योग्य), जो एक क्रिप्टोग्राफ़िक रैंडम स्रोत से जनरेट होता है और सिर्फ़ HMAC के रूप में स्टोर होता है। आप कभी प्लेनटेक्स्ट नहीं देखते।

  3. 03

    Resend वही कॉल है।

    Re-post the create to resend once the 60-second cooldown passes: same session, new code, both still valid. No separate resend endpoint.

  4. 04

    प्रति-recipient सीमाएँ शामिल।

    एक प्रति-recipient सेंड कैप सेंड वॉल्यूम और बेकाबू खर्च को सीमित करता है, Retry-After के साथ 429 है।

  5. 05

    पहुँच जो देश के हिसाब से बढ़ती है।

    SMS आज साझा Authifly sender पर भेजा जाता है, जहाँ यह रजिस्टर्ड है वहाँ डिलीवर करने योग्य, और डेडिकेटेड व रजिस्टर्ड senders आने पर पहुँच बढ़ाते जाते हैं।

पूरा फ़्लो, दो कॉल।

Create-or-retry sends the code to the phone number; check confirms it by that number. There's no id to thread between the two: the recipient is the key.

sms-otp.ts
200
await bird.verify.verifications.create({
  to: { phone_number: "+15551234567" },
}).safe();

const { data } = await bird.verify.verifications.check({
  to:   { phone_number: "+15551234567" },
  code: userInput,
}).safe();

// data.result is true or false; data.reason elaborates ("expired", "already_verified", …)

वह verification API जिसमें स्टोर करने के लिए कुछ नहीं।

SMS is one channel of Bird Verify: email and WhatsApp ship with it, and voice is rolling out, all on the same two endpoints.

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

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

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

Cursor