Long codes

Local numbers, two-way by default.

A long code is a standard 10-digit phone number that sends and receives SMS. It's the default sender for two-way conversations, OTP, and alerts at moderate volume. For US application traffic it's registered through A2P 10DLC.

send-notification.ts
202 · 0.4s
import { BirdClient } from "@messagebird/sdk";

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

const { data, error } = await bird.sms.send({
  from:     "Bird",
  to:       "+15005550006",
  text:     "Your order #4821 has shipped. Track it: bird.ly/t/4821x",
  category: "transactional",
}).safe();

if (error) throw error;
console.log(data.id);
// → "sms_4kT01Lq2m..."
Hi Ada, reminder of your appointment tomorrow at 14:30 with Dr. Kowalski.
Your order #4821 has shipped. Track it: bird.ly/t/4821x
Your subscription renews on 3 Sep for €12/mo. Manage it here: bird.ly/account

When a long code is the right call.

Long codes are one of the four sender types on the Bird SMS numbers surface, part of the broader Bird SMS API. They're local, two-way, and quick to provision: the right starting point for most conversational and transactional traffic before volume justifies a short code.

What a long code gives you.

Local presence, two-way traffic, moderate volume.

  1. 01

    A local 10-digit number.

    Recipients see an area code from their own country or region, which reads as a real sender rather than a marketing blast.

  2. 02

    Two-way by default.

    Point the number's inbound traffic at a webhook and replies arrive as signed events, the foundation for conversational flows.

  3. 03

    Registered through A2P 10DLC.

    US application traffic runs over registered 10DLC campaigns, which earns vetted throughput and the carriers' trust rather than a filtering risk.

  4. 04

    Live as soon as registration clears.

    Buy the number immediately; it starts carrying registered traffic once its 10DLC campaign is approved.

Buy one and start sending.

Search by country and capability, buy the number, and route its inbound at a webhook, the same client you send with. The same code shape provisions any sender type; only the type field changes.

long-code.ts
201 · purchased
const { data: available } = await bird.numbers.search({
  country: "US",
  type:    "long-code",
  capabilities: ["sms"],
}).safe();

const { data: number } = await bird.numbers.buy({
  number:  available[0].number,
  webhook: "https://example.com/webhooks/bird",
}).safe();

Registration is part of the deal.

To send application-to-person traffic to US numbers, a long code runs over a registered A2P 10DLC campaign. Bird files the brand and campaign from the dashboard and reports approval status through the API, so you know exactly when full throughput is available.

Start on a long code, scale when you need to.

Long codes are one sender type on the Bird SMS numbers surface. Provision one, register the campaign, and route inbound from the same API you send with.

Start with one channel.
Add the others when you're ready.

A test API key is yours immediately. Production unlocks when you add a payment method and verify a sender.

Using Claude Code, Cursor, or Codex? Copy a setup prompt and your agent installs the Bird CLI and skills for you. Pick yours:

Cursor