Chapter 1

Get Set Up: Migrate from Bandwidth to Twilio SMS API

Person on laptop

Step 1: Create and Configure Your Twilio Account

Before diving into migration, take a few preparatory steps to set yourself up for success:

  • Sign Up for a Twilio Account: Begin by creating a Twilio account (if you haven’t already).
  • Business Verification & Compliance: Prepare your business details for Carrier compliance requirements. Twilio uses a centralized Trust Hub for verifying customers (Know Your Customer) and registering messaging use cases. Create a Primary Business Profile in the Trust Hub, which streamlines compliance across all channels​. For ISV customers use this guide to set up your customers for success on 10DLC numbers.  For U.S. messaging, you’ll need to register your brand and campaign for A2P 10DLC (10-digit long codes) to comply with carrier rules. Twilio’s onboarding wizard will guide you through each step, making it as easy as possible to provide the required information​.
    If you plan to use a Toll-Free number, be ready to submit a brief use-case description for verification.
Twilio Console sign up page

Step 2: Install the Twilio SDK for Your Language

Twilio provides SDKs for all major programming languages using our quickstart guides.

Node.js Example:

  • npm install twilio

Twilio Advantage: Developer friendly SDKs with native support for delivery receipts, webhooks, error tracing, and real-time observability.

Close-up of a person's hand using a black gaming mouse with neon blue and pink lighting.

Step 3: Start Moving Your Numbers

Man with glasses focused on computer screen displaying code at nighttime

You can bring your existing phone numbers or short codes from Bandwidth to Twilio. The below information covers how to migrate your 10DLC and Toll Free numbers. Due to the carrier compliance requirements for short codes, short code numbers follow a separate migration process; please refer to the US Short Code Migration Process and FAQ.

  • For 10DLC and Toll Free: Port Your Phone Numbers to Twilio: You can bring over your existing long codes and toll-free numbers to Twilio through a porting process. Start by gathering your Bandwidth account details (account number, PIN if applicable, and a copy of the latest bill if required for verification). In the Twilio Console, initiate a port request for each number or batch of numbers. Twilio will coordinate with Bandwidth SNS and the carriers to transfer the numbers. A standard port for a small quantity of numbers typically takes about 1-2 weeks (excluding public holidays) once paperwork is submitted​.  Larger bulk ports (50+ numbers) may take 4–6 weeks​.  

  • Twilio will provide an estimated completion date, to avoid any business impact. During the interim, your numbers continue to work on Bandwidth until the moment they switch to Twilio, so there’s low to no downtime. (You can also set up a temporary Twilio number for testing while you wait.)  Additionally, you can leverage our Porting Eligibility API to automate the process of verification of each number.

  • Ensure you complete the necessary compliance setup for the number types you are using. 

    • For A2P 10DLC, complete Brand and Campaign registration. Guides are available based on your customer type

    • Once your 10DLC numbers are ported-in, you may associate them to your registered Campaign by adding them to the Messaging Service you created during that process (see docs above). 

  • For Toll-Free numbers, complete Toll-Free verification. You must complete verification even if you have already done so on Bandwidth.

  • If you also send or receive Voice calls on your numbers, we strongly advise setting up SHAKEN/STIR and Voice Integrity as well – it’s free of cost and helps bolster your call reputation with carriers and reduce the risk of “Spam Likely” labeling.

Twilio Advantage: Full control over sender type improves branding, deliverability, and compliance alignment.

Step 4: Replace Bandwidth Messaging Code with Twilio

BEFORE: Bandwidth Code Example

"id": "1589228074636lm4k2je7j7jklbn2",
"owner": "+15554443333",
"applicationId": "93de2206-9669-4e07-948d-329f4b722ee2"
"time": "2024-12-02T20:15:57.278Z",
"segmentCount": 2,
"direction": "in",
"to": [
"+15552223333"
],
"from": "+15553332222",
"media": [
"https://dev.bandwidth.com/images/bandwidth-logo.png"
],
"text": "Hello world",
"tag": "custom tag",
"priority": "default",
"expiration": "2021-02-01T11:29:18-05:00"

AFTER: Twilio Programmable Messaging

const client = require('twilio')('TWILIO_SID', 'TWILIO_AUTH_TOKEN');
client.messages.create({
  from: 'TWILIO_NUMBER',
  to: '+1234567890',
  body: 'Hello from Twilio!',
  statusCallback: 'https://yourdomain.com/sms-status'
});

Twilio Advantage: A full-featured, scalable API with support for delivery tracking, messaging services, sender pooling, and advanced analytics.