Verify V2 is the latest version of Twilio's phone verification API. With Verify V2, customers can quickly and easily add account security to their webapps, with the same Twilio libraries you already use. Please continue reading for additional information.
New in Verify V2
With Verify V2, we are introducing a number of changes over the old Verify V1 API. Here are some of the highlights:
- Verify V2 API commands are now built into Twilio's Helper Libraries
- This means you'll use your Twilio Account SID and Auth Token
- The API endpoint for Verify V2 is now https://verify.twilio.com/v2/.
- Verify V2 applications are now known as Verification Services -
- Each service has a
- Verification Services are found in Console at https://www.twilio.com/console/verify/services.
- Each service has a
- Each individual verification from a Verification Service has a
- Phone Numbers now use standard E.164 formatting.
For more details, please see Verify V2 API (Twilio Docs).
Here are the steps for creating a new Verify V2 service via Console:
- Access the Verify Services page in Console.
- Click Create new.
- Enter the desired Friendly name, select the channels you want to use, and then click Create.
- Your Service will be created. Adjust the settings as desired, and then click Save.
Verify V2 Services can also be created via the REST API. Here’s an example cURL script:
curl -X POST https://verify.twilio.com/v2/Services \
--data-urlencode "FriendlyName=My Verify V2 Service" \
--data-urlencode "CodeLength=6" \
--data-urlencode "LookupEnabled=true" \
--data-urlencode "SkipSmsToLandlines=true" \
This example will create a new Verify V2 Verification Service called
V2 Service under the project SID used in this request. This service will use 6-digit authentication codes, and block verifications with landline phone numbers. To make this script work for you, make the following updates, and then paste it into a terminal window:
- Line 2 update with the desired Verification Service name
- Line 3 update with the desired verification code digit length
- Line 6 update with your Account SID and Auth Token
Additional optional parameters can be added in your request including PSD2 parameters, specific text-to-speech services, and more. For full details on each of the available options, please see Create a Verification Service (Twilio Docs).
Migrating to Verify V2
We have created a guide to assist users transitioning existing Authy Verify (V1) applications over to V2. For full details, please see the Verify V2 Migration Guide (Twilio Docs).