Two-Factor Authentication API

Give your customers the peace of mind they deserve. Quickly and easily add two-factor authentication to your software, website, or application to secure user accounts and personal information.

Two-factor authentication made simple

Securing your users’ personal information is critical—and so is creating a good user experience. Bandwidth’s Authentication-enabled Messaging API helps you accomplish both missions quickly and easily.

Customizable codes and messages

Customize your authentication messages to balance security and ease of use—conveying brand and safety. Create the right amount of security for your org by setting a code expiration timeframe that meets your unique needs.

Only pay for successful authentication

Don’t waste budget on unsuccessful authentication attempts. Whether because of wrong numbers or a missed message, you only pay for successful authentication using our API.

Use your own number for instant brand identity

You can use your existing numbers to send one-time passcodes. This allows you to protect your brand equity by not sharing numbers with other businesses, creating a better overall end-user experience.

const BandwidthMfa = require(‘@bandwidth/mfa’);
BandwidthMfa.Configuration.basicAuthUserName = “token”;
BandwidthMfa.Configuration.basicAuthPassword = “secret”;
const mfaController = BandwidthMfa.APIController;

mfaController.createMessagingTwoFactor(“accountId”, {
from: “+19999999999”,
to: “+18888888888”,
applicationId: “1-2-3”,
scope: “authorization”

mfaController.createVerifyTwoFactor(“accountId”, {
from: “+19999999999”,
to: “+18888888888”,
applicationId: “1-2-3”,
scope: “authorization”,
code: “123456”
Two-factor authentication example.

2FA built for developers

Ready to reduce fraud and protect your users with one-time codes and account verification? Our Authentication-enabled Messaging API makes it easy to send custom messages over voice and SMS, from your own numbers without the need for additional telecom infrastructure.

Build your full SMS strategy

Text messaging isn’t just for 2FA. Bandwidth’s robust Messaging API platform gives you the keys to create your own unique voice and messaging solutions. Our flexible platform even lets you choose what kind of number works for you!

Toll-Free MMS

Text-enable your existing toll-free numbers and send verification codes from a number your customers already recognize.
Learn more
message with 800

10 Digit Long Code (10DLC)

Send high-volume, high-throughput codes from your local number. With 10DLC you don’t need to get a new number to send customers authentication codes.
Learn more
Message showing local area code 919

Short Codes

Use the same short code you use to send appointment reminders and alerts to send verification codes and passwords to your customers, securing their accounts.
Learn more

Voice API

Support land-lines while providing texting as a fallback with voice authentication. Send codes with programmable voice calling when you connect our Authentication-enabled Messaging API to our flexible and powerful Voice API.
Learn more

Don’t worry—our signature support is always included

We take a unique approach to support: we focus on making sure our customers are successful. How? With dedicated support that’s included, a support team made up of industry vets, and tools and processes to ensure customer success and satisfaction. You’ll wonder why everyone doesn’t have the same approach.

  • Dedicated support to help you every step of the way
  • Assigned single point of contact with all products
  • 24/7 proactive Network Operations Center (NOC)
  • >97% CSAT delivering Technical Assistance Center (TAC)
  • Expert business development managers to help navigate your changing needs
  • Dedicated team of porting experts

How can your industry be transformed with Bandwidth?

Software & products

Authenticate user accounts with codes delivered via SMS or phone call.

Finance & banking

Secure customer financial information, verify account changes, and validate high-value transactions.


Protect sensitive patient information and simplify health portal logins with two-factor authentication codes.